#include <sampler.hpp>
Static Public Member Functions | |
static void | set_take_screenshot (int val) |
Set flag that indicates if computed data is to be written to file or not. | |
static void | init_file_names (void) |
Allocate enough memory for the filenames of the files that are written to disc [see set_take_screenshot(int val)]. | |
static void | free_file_name (void) |
Free the allocated memory for the filenames again. | |
static void | set_file_name (char *fname) |
Set the filename. | |
static void | set_file_names (char *fname_png_in, char *fname_pzd_in) |
Set the filenames. | |
static void | compress_residue (imgdata_t *img) |
Compress residual signal. | |
static void | upsample (uchar_t *src, uchar_t **dst, int img_w, int img_h, int pitch, int bytes_pp) |
Perform upsampling. | |
static __forceinline void | upsample_rt (imgdata_t *src_img, imgdata_t *dst_img, int src_sx, int src_sy) |
Perform upsampling. | |
static __forceinline void | upsample_rt (imgdata_t *src_img, imgdata_t *dst_img) |
Perform upsampling. | |
static void | downsample (uchar_t *src, uchar_t **dst, int img_w, int img_h, int pitch, int bytes_pp) |
Perform downsampling. | |
static int | diff_img_memsave (imgdata_t *img_src1, imgdata_t *img_src2, imgdata_t *img_dst) |
Calculate difference image. | |
static uchar_t * | diff_img (uchar_t *dat1, uchar_t *dat2, int img_w, int img_h, int pitch, int bytes_pp) |
Calculate difference image. | |
static uchar_t * | blend_img_residual (uchar_t *residual_diff_dat1, uchar_t *dat2, int img_w, int img_h, int pitch, int bytes_pp) |
Blend upsampled image with the residual signal. The residual signal comes from the EZW-compressed difference-images. The input images and the output image must have equal dimensions. | |
static __forceinline void | blend_img_residual_rt2 (imgdata_t *diff_img, imgdata_t *upsamp_img, imgdata_t *blend_img) |
Blend upsampled image with the residual signal. The residual signal comes from the EZW-compressed difference-images. The input images and the output image must have equal dimensions. | |
static __forceinline void | cut_upsample (imgdata_t *diff_img, imgdata_t *upsamp_img, imgdata_t *blend_img) |
Only perform upsampling. The input images and the output image must have equal dimensions. |
static uchar_t* SAMPLER::blend_img_residual | ( | uchar_t * | residual_diff_dat1, | |
uchar_t * | dat2, | |||
int | img_w, | |||
int | img_h, | |||
int | pitch, | |||
int | bytes_pp | |||
) | [inline, static] |
Blend upsampled image with the residual signal. The residual signal comes from the EZW-compressed difference-images. The input images and the output image must have equal dimensions.
residual_diff_dat1 | The residual data. | |
dat2 | The upsampled data. | |
img_w | The width of the images. | |
img_h | The height of the images. | |
pitch | The pitch of the images. | |
bytes_pp | The bytes per pixel of the images. |
static __forceinline void SAMPLER::blend_img_residual_rt2 | ( | imgdata_t * | diff_img, | |
imgdata_t * | upsamp_img, | |||
imgdata_t * | blend_img | |||
) | [inline, static] |
Blend upsampled image with the residual signal. The residual signal comes from the EZW-compressed difference-images. The input images and the output image must have equal dimensions.
diff_img | The residual data. | |
upsamp_img | The upsampled data. | |
blend_img | The destination to write the result to. |
static void SAMPLER::compress_residue | ( | imgdata_t * | img | ) | [inline, static] |
Compress residual signal.
img | The image to process. |
static __forceinline void SAMPLER::cut_upsample | ( | imgdata_t * | diff_img, | |
imgdata_t * | upsamp_img, | |||
imgdata_t * | blend_img | |||
) | [inline, static] |
Only perform upsampling. The input images and the output image must have equal dimensions.
diff_img | The residual data (not used). | |
upsamp_img | The upsampled data. | |
blend_img | The destination to write the result to. |
static uchar_t* SAMPLER::diff_img | ( | uchar_t * | dat1, | |
uchar_t * | dat2, | |||
int | img_w, | |||
int | img_h, | |||
int | pitch, | |||
int | bytes_pp | |||
) | [inline, static] |
Calculate difference image.
The two images for the difference calculation are assumed to be of equal dimensions.
dat1 | The first image for the difference-calculation. | |
dat2 | The second image for the difference-calculation. | |
img_w | The width of the source-images. | |
img_h | The height of the source-images. | |
pitch | The pitch of the source-images. | |
bytes_pp | The bytes per pixel of the source-images. |
static int SAMPLER::diff_img_memsave | ( | imgdata_t * | img_src1, | |
imgdata_t * | img_src2, | |||
imgdata_t * | img_dst | |||
) | [inline, static] |
Calculate difference image.
The two images for the difference calculation are assumed to be of equal dimensions.
img_src1 | The first image for the difference-calculation. | |
img_src2 | The second image for the difference-calculation. | |
img_dst | The destination image for the difference-calculation. It is assumed, that the memory is prealloced before calling this method. |
static void SAMPLER::downsample | ( | uchar_t * | src, | |
uchar_t ** | dst, | |||
int | img_w, | |||
int | img_h, | |||
int | pitch, | |||
int | bytes_pp | |||
) | [inline, static] |
Perform downsampling.
Use custom 5x5 filter.
src | The source-data. | |
dst | The destination for the downsampled image. | |
img_w | The width of the source-image. | |
img_h | The height of the source-image. | |
pitch | The pitch of the source-image. | |
bytes_pp | The bytes per pixel of the source-image. |
static void SAMPLER::set_file_name | ( | char * | fname | ) | [inline, static] |
Set the filename.
fname | The filename. |
static void SAMPLER::set_file_names | ( | char * | fname_png_in, | |
char * | fname_pzd_in | |||
) | [inline, static] |
Set the filenames.
fname_png_in | The filename for a PNG file. | |
fname_pzd_in | The filename for a PZD/PRD file (newly designed fileformats). |
static void SAMPLER::set_take_screenshot | ( | int | val | ) | [inline, static] |
Set flag that indicates if computed data is to be written to file or not.
val | The flag. |
static void SAMPLER::upsample | ( | uchar_t * | src, | |
uchar_t ** | dst, | |||
int | img_w, | |||
int | img_h, | |||
int | pitch, | |||
int | bytes_pp | |||
) | [inline, static] |
Perform upsampling.
Use Kobbelt's interpolatory subdivision filter with weights (-1/16, 9/16, 9/16, -1/16)
src | The source-data. | |
dst | The destination for the upsampled image. | |
img_w | The width of the source-image. | |
img_h | The height of the source-image. | |
pitch | The pitch of the source-image. | |
bytes_pp | The bytes per pixel of the source-image. |
static __forceinline void SAMPLER::upsample_rt | ( | imgdata_t * | src_img, | |
imgdata_t * | dst_img | |||
) | [inline, static] |
Perform upsampling.
Use Kobbelt's interpolatory subdivision filter with weights (-1/16, 9/16, 9/16, -1/16). The target img is always 4 bytes per pixel
src_img | The source-data. | |
dst_img | The destination for the upsampled image. |
static __forceinline void SAMPLER::upsample_rt | ( | imgdata_t * | src_img, | |
imgdata_t * | dst_img, | |||
int | src_sx, | |||
int | src_sy | |||
) | [inline, static] |
Perform upsampling.
Use Kobbelt's interpolatory subdivision filter with weights (-1/16, 9/16, 9/16, -1/16). The target img is always 4 bytes per pixel
src_img | The source-data. | |
dst_img | The destination for the upsampled image. | |
src_sx | X offset. | |
src_sy | Y offset. |