Classes | Functions

CxUtils::PNG Namespace Reference

Classes

struct  InputSource
 Input source for PNG decompression manager. More...
struct  OutputSource
 Output source for PNG compression manager. More...

Functions

CX_UTILS_DLL int DecompressImage (const unsigned char *png, const unsigned int pngSize, unsigned char **image, unsigned short *width, unsigned short *height, unsigned char *channels)
 Takes PNG 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 **png, unsigned int *pngBufferSize, unsigned int *pngSize)
 Compresses RAW image data to PNG format.
void ReadData (png_structp png_ptr, png_bytep data, png_size_t length)
void WriteData (png_structp png_ptr, png_bytep data, png_size_t length)

Function Documentation

int CxUtils::PNG::CompressImage ( const unsigned short  width,
const unsigned short  height,
const unsigned char  channels,
const unsigned char *  image,
unsigned char **  png,
unsigned int *  pngBufferSize,
unsigned int *  pngSize 
)

Compresses RAW image data to PNG format.

Parameters:
[in]imagePointer to raw image data that needs to be compressed. Data must be in BGR channel format.
[in]widthThe width of the image.
[in]heightThe height of the image.
[in]channelsThe number of channels in the image.
[out]pngPointer to buffer which will store resulting PNG data. If NULL or too small this buffer will grow dynamically.
[out]pngBufferSizeThe size of the buffer in bytes holding the compressed PNG.
[out]pngSizeThe size of the PNG data inside the buffer in bytes.
Returns:
1 on success, 0 on failure.

Definition at line 265 of file png.cpp.

int CxUtils::PNG::DecompressImage ( const unsigned char *  png,
const unsigned int  pngSize,
unsigned char **  image,
unsigned short *  width,
unsigned short *  height,
unsigned char *  channels 
)

Takes PNG data inside of a buffer and decompresses it to another buffer which will store the raw image.

Parameters:
[in]pngPointer to PNG data.
[in]pngSizeThe size in bytes of the PNG data.
[out]imagePointer 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]widthThe width of the image decompressed.
[out]heightThe height of the image decompressed.
[out]channelsThe number of channels in the decompressed image.
Returns:
1 on success, 0 on failure.

Definition at line 112 of file png.cpp.

void CxUtils::PNG::ReadData ( png_structp  png_ptr,
png_bytep  data,
png_size_t  length 
)

Definition at line 77 of file png.cpp.

void CxUtils::PNG::WriteData ( png_structp  png_ptr,
png_bytep  data,
png_size_t  length 
)

Definition at line 228 of file png.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines