Classes | |
class | Compressor |
If compressing multiple JPEG images, use a compressor because it will re-use memory for a slight speed up. More... | |
struct | InputSource |
Input source for JPEG decompression manager. More... | |
struct | OutputSource |
Output source for JPEG compression manager. More... | |
Functions | |
CX_UTILS_DLL int | ConvertMJPEG2JPEG (const unsigned char *mjpeg, const unsigned int mjpegSize, unsigned char **jpeg, unsigned int *jpegSize) |
Takes an MJPEG frame data, and converts to JPEG data. | |
CX_UTILS_DLL int | DecompressImage (const unsigned char *jpeg, const unsigned int jpegSize, unsigned char **image, unsigned short *width, unsigned short *height, unsigned char *channels) |
Takes JPEG data inside of a buffer and decompresses it to another buffer which will store the raw image. | |
CX_UTILS_DLL int | CompressImage (const unsigned short width, const unsigned short height, const unsigned char channels, const unsigned char *image, unsigned char **jpeg, unsigned int *jpegBufferSize, unsigned int *jpegSize, const int quality=-1) |
Compresses RAW image data to JPEG format. | |
void | InitSource (j_decompress_ptr cinfo) |
boolean | FillInputBuffer (j_decompress_ptr cinfo) |
void | SkipInputData (j_decompress_ptr cinfo, long num_bytes) |
void | TerminateSource (j_decompress_ptr cinfo) |
void | ErrorExit (j_common_ptr cinfo) |
void | InitDestination (j_compress_ptr cinfo) |
boolean | EmptyOutputBuffer (j_compress_ptr cinfo) |
void | TerminateDestination (j_compress_ptr cinfo) |
int CxUtils::JPEG::CompressImage | ( | const unsigned short | width, |
const unsigned short | height, | ||
const unsigned char | channels, | ||
const unsigned char * | image, | ||
unsigned char ** | jpeg, | ||
unsigned int * | jpegBufferSize, | ||
unsigned int * | jpegSize, | ||
const int | quality = -1 |
||
) |
Compresses RAW image data to JPEG format.
[in] | image | Pointer to raw image data that needs to be compressed. Data must be in BGR channel format. |
[in] | width | The width of the image. |
[in] | height | The height of the image. |
[in] | channels | The number of channels in the image. |
[out] | jpeg | Pointer to buffer which will store resulting JPEG data. If NULL or too small this buffer will grow dynamically. |
[out] | jpegBufferSize | The size of the buffer in bytes holding the compressed JPEG. |
[out] | jpegSize | The size of the JPEG data inside the buffer in bytes. |
[in] | quality | The compression quality. Set to -1 for default, 0 worst and 100 best (but larger size). |
JSAMPLE row to store a single compressed row.
Physical row width in image buffer (width*channels).
int CxUtils::JPEG::ConvertMJPEG2JPEG | ( | const unsigned char * | mjpeg, |
const unsigned int | mjpegSize, | ||
unsigned char ** | jpeg, | ||
unsigned int * | jpegSize | ||
) |
Takes an MJPEG frame data, and converts to JPEG data.
[in] | mjpeg | Pointer to MJPEG data. |
[in] | mjpegSize | The size in bytes of the MJPEG data. |
[out] | jpeg | Pointer to buffer which will store the result. If NULL or too small new memory will be allocated dynamically. Decompressed data will be in BGR format. |
[out] | jpegSize | Pointer to output size of the new JPEG. |
int CxUtils::JPEG::DecompressImage | ( | const unsigned char * | jpeg, |
const unsigned int | jpegSize, | ||
unsigned char ** | image, | ||
unsigned short * | width, | ||
unsigned short * | height, | ||
unsigned char * | channels | ||
) |
Takes JPEG data inside of a buffer and decompresses it to another buffer which will store the raw image.
[in] | jpeg | Pointer to JPEG data. |
[in] | jpegSize | The size in bytes of the JPEG data. |
[out] | image | Pointer to buffer which will store the result. If NULL or too small new memory will be allocated dynamically. Decompressed data will be in BGR format. |
[out] | width | The width of the image decompressed. |
[out] | height | The height of the image decompressed. |
[out] | channels | The number of channels in the decompressed image. |
boolean CxUtils::JPEG::EmptyOutputBuffer | ( | j_compress_ptr | cinfo ) |
boolean CxUtils::JPEG::FillInputBuffer | ( | j_decompress_ptr | cinfo ) |
void CxUtils::JPEG::InitDestination | ( | j_compress_ptr | cinfo ) |
void CxUtils::JPEG::SkipInputData | ( | j_decompress_ptr | cinfo, |
long | num_bytes | ||
) |
void CxUtils::JPEG::TerminateDestination | ( | j_compress_ptr | cinfo ) |