简体   繁体   中英

how to convert jpeg byte array to bitmap byte array using visual studio C++

I've processed a jpeg byte array from a camera. Now I need to convert this jpeg byte array to bitmap byte array using visual studio C++

You'll need a library for that. Eg jpeg-compressor . Using jpeg-compressor, "conversion" to bitmap is straightforward:

#include "jpeg-compressor/jpgd.h"

int width = 0, height = 0, actual_comps = 0;
jpgd::decompress_jpeg_image_from_memory(
    static_cast<unsigned char*>(myJPEGdata), myJPEGdataLength,
    &width, &height, &actual_comps, 3 );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM