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>
29#if !defined(WITHOUT_FREERDP_3x_DEPRECATED)
33BOOL jpeg_decompress(
const BYTE* input, BYTE* output,
int width,
int height,
int size,
int bpp)
46 wImage* image = winpr_image_new();
50 if (winpr_image_read_buffer(image, input, WINPR_ASSERTING_INT_CAST(
size_t, size)) <= 0)
53 if ((image->width != WINPR_ASSERTING_INT_CAST(
size_t, width)) ||
54 (image->height != WINPR_ASSERTING_INT_CAST(
size_t, height)) ||
55 (image->bitsPerPixel != WINPR_ASSERTING_INT_CAST(
size_t, bpp)))
58 const size_t stride = image->width * image->bitsPerPixel / 8;
59 if (stride < image->scanline)
62 for (UINT32 y = 0; y < image->height; y++)
64 const void* src = &image->data[y * image->scanline];
65 void* dst = &output[y * stride];
66 memcpy(dst, src, stride);
71 winpr_image_free(image, TRUE);
77BOOL jpeg_decompress(WINPR_ATTR_UNUSED
const BYTE* input, WINPR_ATTR_UNUSED BYTE* output,
78 WINPR_ATTR_UNUSED
int width, WINPR_ATTR_UNUSED
int height,
79 WINPR_ATTR_UNUSED
int size, WINPR_ATTR_UNUSED
int bpp)
81 WLog_ERR(
"TODO",
"TODO: implement");