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>
32BOOL jpeg_decompress(
const BYTE* input, BYTE* output,
int width,
int height,
int size,
int bpp)
45 wImage* image = winpr_image_new();
49 if (winpr_image_read_buffer(image, input, WINPR_ASSERTING_INT_CAST(
size_t, size)) <= 0)
52 if ((image->width != WINPR_ASSERTING_INT_CAST(
size_t, width)) ||
53 (image->height != WINPR_ASSERTING_INT_CAST(
size_t, height)) ||
54 (image->bitsPerPixel != WINPR_ASSERTING_INT_CAST(
size_t, bpp)))
57 memcpy(output, image->data, 1ull * image->scanline * image->height);
61 winpr_image_free(image, TRUE);
67BOOL jpeg_decompress(WINPR_ATTR_UNUSED
const BYTE* input, WINPR_ATTR_UNUSED BYTE* output,
68 WINPR_ATTR_UNUSED
int width, WINPR_ATTR_UNUSED
int height,
69 WINPR_ATTR_UNUSED
int size, WINPR_ATTR_UNUSED
int bpp)
71 WLog_ERR(
"TODO",
"TODO: implement");