Project Name  Version 1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Typedefs | Functions
JPEG Wrapper Interface

Defines the API for the JPEG wrapper library. More...

Data Structures

struct  jh_jpegwrap_params_ts
 Defines the parameter block passed to the JPEG library to decompress the JPEG image, which includes image size and scaling factors. More...

Typedefs

typedef struct
jh_jpegwrap_params_ts 
jh_jpegwrap_params_t
 Defines the parameter block passed to the JPEG library to decompress the JPEG image, which includes image size and scaling factors.

Functions

int jh_jpeg_compress (const jh_image_t *sbi, unsigned qual, jh_stream_t *stream, jh_error_t *error, int debug)
 Compresses a residual image, also known as the subband image (SBI), in JPEG JFIF file format and stores the compressed image in memory.
int jh_jpeg_compress_and_attach (const jh_image_t *sdri, unsigned qual, unsigned char *m11, unsigned *m11_sizes, unsigned char *icc, unsigned icc_size, jh_stream_t *stream, jh_error_t *error, int debug)
 Compresses a standard dynamic range image (SDRI) in JPEG JFIF file format, attaches APP11 segments and an ICC profile, and stores the resulting image in memory.
void jh_jpeg_release (unsigned char **jpg_buffer)
 Releases the memory buffer created by jh_jpeg_compress() for the compressed SBI.
int jh_jpeg_decompress_jpeghdr (unsigned char *jpg, size_t jpg_size, int *width, int *height, unsigned char **icc, int *icc_size, unsigned char **tmi, unsigned char **sbi, char *header, int probe_header, jh_jpegwrap_params_t *opts, jh_error_t *error, jh_monitor_t *monitorv)
 Decompresses the JPEG-HDR file.
jh_result_t jh_jpeg_read_header_mem (void *inbuffer, int size, int *width, int *height, int *channels, char *message)
 Reads the JPEG-HDR file to get basic information about the image.

Detailed Description

Defines the API for the JPEG wrapper library.

Function Documentation

int jh_jpeg_compress ( const jh_image_t sbi,
unsigned  qual,
jh_stream_t stream,
jh_error_t error,
int  debug 
)

Compresses a residual image, also known as the subband image (SBI), in JPEG JFIF file format and stores the compressed image in memory.

Note
Later on, while creating the JPEG-HDR file, this compressed image is encoded in APP11 segments and put in the JPEG JFIF header.
Parameters
[in]sbiInput residual image (SBI).
[in]qualEncoding quality to compress the input SBI. Valid values 0 to 100.
[in,out]streamUser-implemented stream to hold encoded data
[in,out]errorUser-allocated error-reporting structure that contains information about the error. Before calling this function, the value of error should be set to 0.
debugRESERVED FOR INTERNAL USE. Must be set to 0.
int jh_jpeg_compress_and_attach ( const jh_image_t sdri,
unsigned  qual,
unsigned char *  m11,
unsigned *  m11_sizes,
unsigned char *  icc,
unsigned  icc_size,
jh_stream_t stream,
jh_error_t error,
int  debug 
)

Compresses a standard dynamic range image (SDRI) in JPEG JFIF file format, attaches APP11 segments and an ICC profile, and stores the resulting image in memory.

Parameters
[in]sdriInput standard dynamic range image (SDRI), also known as the tone-mapped image, or base image.
[in]qualEncoding quality to compress the input SDRI. Valid values 0 to 100.
[in]m11Data to be stored in the APP11 marker.
[in]m11_sizesNull-terminated character string containing the sizes of the APP11 markers stored in the m11 buffer.
[in]iccMemory with the binary form of the ICC profile. NULL is allowed.
[in]icc_sizeSize of the icc buffer.
[in,out]streamUser-implemented stream to hold encoded data
[in,out]errorUser-allocated error-reporting structure that contains information about the error. Before calling this function, the value of error should be set to 0.
debugRESERVED FOR INTERNAL USE. Must be set to 0.
int jh_jpeg_decompress_jpeghdr ( unsigned char *  jpg,
size_t  jpg_size,
int *  width,
int *  height,
unsigned char **  icc,
int *  icc_size,
unsigned char **  tmi,
unsigned char **  sbi,
char *  header,
int  probe_header,
jh_jpegwrap_params_t opts,
jh_error_t error,
jh_monitor_t monitorv 
)

Decompresses the JPEG-HDR file.

Returns
0 if the function does not succeed.
Parameters
[in]jpgInput JPEG-HDR file in memory.
[in]jpg_sizeSize of the JPEG-HDR file.
[out]widthHDR image width, in pixels.
[out]heightHDR image height, in pixels.
[out]iccICC data to be returned, if applicable.
[out]icc_sizeSize of the icc buffer.
[out]tmiResulting SDRI, which is the 8-bit gamma-corrected base image extracted from the JPEG-HDR file.
[out]sbiResulting SBI, which is the 8-bit residual image extracted from the JPEG-HDR file.
[out]headerJPEG-HDR header extracted from the JPEG-HDR file.
[in]probe_headerIf the value is TRUE, only this header check will be conducted to identify the JPEG-HDR file.
[in]optsParameter block for JPEG decompression. If scaling factor is set to 1/2, 1/4, or 1/8, a smaller resulting image is generated.
[in,out]errorUser-allocated error-reporting structure that contains information about the error, if any
[in]monitorvProgress status of the function. Initial value of the jh_monitor_ts cancel field must be 0.
jh_result_t jh_jpeg_read_header_mem ( void *  inbuffer,
int  size,
int *  width,
int *  height,
int *  channels,
char *  message 
)

Reads the JPEG-HDR file to get basic information about the image.

Parameters
[in]inbufferInput JPEG-HDR memory-mapped file.
[in]sizeSize of the inbuffer buffer, in bytes.
[out]widthNumber of columns in the image.
[out]heightNumber of rows in the image.
[out]channelsNumber of channels in the image.
[in,out]messageUser-allocated character string that contains the description of the error, if any.
void jh_jpeg_release ( unsigned char **  jpg_buffer)

Releases the memory buffer created by jh_jpeg_compress() for the compressed SBI.

Note
This function must be called after jh_jpeg_compress() and jh_jpeg_compress_and_attach() are called and as many times as these two functions are successfully executed, one after another.
Returns
0 if the function does not succeed.
Parameters
[out]jpg_buffersbi_jpg buffer allocated in jh_jpeg_compress() for the JPEG-compressed SBI.