20 #include <freerdp/config.h>
22 #include <winpr/stream.h>
23 #include <winpr/image.h>
25 #include <freerdp/codec/color.h>
27 #include <freerdp/codec/jpeg.h>
32 BOOL jpeg_decompress(
const BYTE* input, BYTE* output,
int width,
int height,
int size,
int bpp)
39 wImage* image = winpr_image_new();
43 if (winpr_image_read_buffer(image, input, size) <= 0)
46 if ((image->width != width) || (image->height != height) || (image->bitsPerPixel != bpp))
49 memcpy(output, image->data, 1ull * image->scanline * image->height);
53 winpr_image_free(image, TRUE);
59 BOOL jpeg_decompress(
const BYTE* input, BYTE* output,
int width,
int height,
int size,
int bpp)