OpenDaVINCI  4.15.3
odcore::wrapper::jpg::JPG Class Reference

#include <JPG.h>

Public Member Functions

virtual ~JPG ()

Static Public Member Functions

static bool compress (void *dest, int &destSize, const uint32_t &width, const uint32_t &height, const uint32_t &bytesPerPixel, const uint8_t *rawImageData, const uint32_t &quality)
static unsigned char * decompress (const unsigned char *src, const uint32_t &srcSize, int *width, int *height, int *actualBytesPerPixel, const uint32_t &requestedBytesPerPixel)

Detailed Description

This class provides static methods to compress and decompress data in JPG format.

Constructor & Destructor Documentation

odcore::wrapper::jpg::JPG::~JPG ( )

Member Function Documentation

bool odcore::wrapper::jpg::JPG::compress ( void *  dest,
int &  destSize,
const uint32_t &  width,
const uint32_t &  height,
const uint32_t &  bytesPerPixel,
const uint8_t *  rawImageData,
const uint32_t &  quality 

This method compresses raw image data using a JPG compressor.

destPointer to destination buffer to receive the compressed image data.
destSizeSize of destination buffer that will be set to the actual amount of bytes used thereof.
widthRaw image's width.
heightRaw image's height.
bytesPerPixelRaw image's bytes per pixel (channels).
rawImageDateRaw image data.
qualityCompression rate (must be between 1 and 100).
true if the compression succeeded.
unsigned char * odcore::wrapper::jpg::JPG::decompress ( const unsigned char *  src,
const uint32_t &  srcSize,
int *  width,
int *  height,
int *  actualBytesPerPixel,
const uint32_t &  requestedBytesPerPixel 

This method decompresses a JPG compressed image.

srcPointer to a buffer containing the compressed image data.
srctSizeSize of buffer.
widthDecompressed image's width.
heightDecompressed image's height.
actualBytesPerPixelDecompressed image's bytes per pixel (channels).
requestedBytesPerPixelExpected decompressed image's bytes per pixel (channels).
Pointer to the decompressed image that MUST be released by the callee or NULL in the case of an error.