c_cpp 来自http://stackoverflow.com/questions/9094691/examples-or-tutorials-of-using-libjpeg-turbos-tur

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp 来自http://stackoverflow.com/questions/9094691/examples-or-tutorials-of-using-libjpeg-turbos-tur相关的知识,希望对你有一定的参考价值。

#include <turbojpeg.h>

long unsigned int _jpegSize; //!< _jpegSize from above
unsigned char* _compressedImage; //!< _compressedImage from above

int jpegSubsamp, width, height;
unsigned char buffer[width*height*COLOR_COMPONENTS]; //!< will contain the decompressed image

tjhandle _jpegDecompressor = tjInitDecompress();

tjDecompressHeader2(_jpegDecompressor, _compressedImage, _jpegSize, &width, &height, &jpegSubsamp);

tjDecompress2(_jpegDecompressor, _compressedImage, _jpegSize, buffer, width, 0/*pitch*/, height, TJPF_RGB, TJFLAG_FASTDCT);

tjDestroy(_jpegDecompressor);

以上是关于c_cpp 来自http://stackoverflow.com/questions/9094691/examples-or-tutorials-of-using-libjpeg-turbos-tur的主要内容,如果未能解决你的问题,请参考以下文章