Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifndef __CXUTILS_IMAGES_JPEG_HANDLER__H
00042 #define __CXUTILS_IMAGES_JPEG_HANDLER__H
00043
00044 #include "cxutils/cxbase.h"
00045
00046 namespace CxUtils
00047 {
00048 namespace JPEG
00049 {
00064 CX_UTILS_DLL int ConvertMJPEG2JPEG(const unsigned char* mjpeg,
00065 const unsigned int mjpegSize,
00066 unsigned char** jpeg,
00067 unsigned int* jpegSize);
00085 CX_UTILS_DLL int DecompressImage(const unsigned char* jpeg,
00086 const unsigned int jpegSize,
00087 unsigned char** image,
00088 unsigned short* width,
00089 unsigned short* height,
00090 unsigned char* channels);
00112 CX_UTILS_DLL int CompressImage(const unsigned short width,
00113 const unsigned short height,
00114 const unsigned char channels,
00115 const unsigned char* image,
00116 unsigned char** jpeg,
00117 unsigned int* jpegBufferSize,
00118 unsigned int* jpegSize,
00119 const int quality = -1);
00120
00128 class CX_UTILS_DLL Compressor
00129 {
00130 public:
00131 Compressor();
00132 ~Compressor();
00133 int CompressImage(const unsigned short width,
00134 const unsigned short height,
00135 const unsigned char channels,
00136 const unsigned char* image,
00137 unsigned char** jpeg,
00138 unsigned int* jpegBufferSize,
00139 unsigned int* jpegSize,
00140 const int quality = -1);
00141 int CompressImageNoResize(const unsigned short width,
00142 const unsigned short height,
00143 const unsigned char channels,
00144 const unsigned char* image,
00145 unsigned char* jpeg,
00146 unsigned int jpegBufferSize,
00147 unsigned int* jpegSize,
00148 const int quality = -1);
00149 private:
00150 void* mpCompressionObject;
00151 };
00152 }
00153 }
00154
00155 #endif
00156