90 if (
f <= 0.0031308f)
return 12.92f *
f;
91 return 1.055f *
powf(
f, 1.0f/2.4f) - 0.055f;
95static inline float from_sRGB_component(
float f)
97 if (
f <= 0.04045f)
return f / 12.92f;
98 return powf((
f + 0.055f) / 1.055f, 2.4f);
101static void from_sRGB(
BYTE *bgr)
109 r = from_sRGB_component(
r);
110 g = from_sRGB_component(
g);
111 b = from_sRGB_component(
b);
113 bgr[2] = (
BYTE)(
r * 255.0f);
114 bgr[1] = (
BYTE)(
g * 255.0f);
115 bgr[0] = (
BYTE)(
b * 255.0f);
118static void to_sRGB(
BYTE *bgr)
130 bgr[2] = (
BYTE)(
r * 255.0f);
131 bgr[1] = (
BYTE)(
g * 255.0f);
132 bgr[0] = (
BYTE)(
b * 255.0f);
144 switch (source_format)
153 UINT srcstride, srcdatasize;
171 res = IWICPalette_GetColors(
palette, 2, colors, &actualcolors);
176 srcstride = (
prc->Width+7)/8;
177 srcdatasize = srcstride *
prc->Height;
182 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
188 for (
y=0;
y<
prc->Height;
y++) {
190 dstpixel=(
DWORD*)dstrow;
191 for (
x=0;
x<
prc->Width;
x+=8) {
194 *dstpixel++ = colors[srcval>>7&1];
195 if (
x+1 <
prc->Width) *dstpixel++ = colors[srcval>>6&1];
196 if (
x+2 <
prc->Width) *dstpixel++ = colors[srcval>>5&1];
197 if (
x+3 <
prc->Width) *dstpixel++ = colors[srcval>>4&1];
198 if (
x+4 <
prc->Width) *dstpixel++ = colors[srcval>>3&1];
199 if (
x+5 <
prc->Width) *dstpixel++ = colors[srcval>>2&1];
200 if (
x+6 <
prc->Width) *dstpixel++ = colors[srcval>>1&1];
201 if (
x+7 <
prc->Width) *dstpixel++ = colors[srcval&1];
220 UINT srcstride, srcdatasize;
238 res = IWICPalette_GetColors(
palette, 4, colors, &actualcolors);
243 srcstride = (
prc->Width+3)/4;
244 srcdatasize = srcstride *
prc->Height;
249 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
255 for (
y=0;
y<
prc->Height;
y++) {
257 dstpixel=(
DWORD*)dstrow;
258 for (
x=0;
x<
prc->Width;
x+=4) {
261 *dstpixel++ = colors[srcval>>6];
262 if (
x+1 <
prc->Width) *dstpixel++ = colors[srcval>>4&0x3];
263 if (
x+2 <
prc->Width) *dstpixel++ = colors[srcval>>2&0x3];
264 if (
x+3 <
prc->Width) *dstpixel++ = colors[srcval&0x3];
283 UINT srcstride, srcdatasize;
301 res = IWICPalette_GetColors(
palette, 16, colors, &actualcolors);
306 srcstride = (
prc->Width+1)/2;
307 srcdatasize = srcstride *
prc->Height;
312 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
318 for (
y=0;
y<
prc->Height;
y++) {
320 dstpixel=(
DWORD*)dstrow;
321 for (
x=0;
x<
prc->Width;
x+=2) {
324 *dstpixel++ = colors[srcval>>4];
325 if (
x+1 <
prc->Width) *dstpixel++ = colors[srcval&0xf];
343 UINT srcstride, srcdatasize;
349 srcstride =
prc->Width;
350 srcdatasize = srcstride *
prc->Height;
355 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
361 for (
y=0;
y<
prc->Height;
y++) {
363 dstpixel=(
DWORD*)dstrow;
364 for (
x=0;
x<
prc->Width;
x++)
366 *dstpixel++ = 0xff000000|(*srcbyte<<16)|(*srcbyte<<8)|*srcbyte;
385 UINT srcstride, srcdatasize;
399 res = IWICPalette_GetColors(
palette, 256, colors, &actualcolors);
405 srcstride =
prc->Width;
406 srcdatasize = srcstride *
prc->Height;
411 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
417 for (
y=0;
y<
prc->Height;
y++) {
419 dstpixel=(
DWORD*)dstrow;
420 for (
x=0;
x<
prc->Width;
x++)
421 *dstpixel++ = colors[*srcbyte++];
438 UINT srcstride, srcdatasize;
444 srcstride =
prc->Width * 2;
445 srcdatasize = srcstride *
prc->Height;
450 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
456 for (
y=0;
y<
prc->Height;
y++) {
458 dstpixel=(
DWORD*)dstrow;
459 for (
x=0;
x<
prc->Width;
x++)
462 *dstpixel++ = 0xff000000|(*srcbyte<<16)|(*srcbyte<<8)|*srcbyte;
481 UINT srcstride, srcdatasize;
483 const WORD *srcpixel;
487 srcstride = 2 *
prc->Width;
488 srcdatasize = srcstride *
prc->Height;
493 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
499 for (
y=0;
y<
prc->Height;
y++) {
500 srcpixel=(
const WORD*)srcrow;
501 dstpixel=(
DWORD*)dstrow;
502 for (
x=0;
x<
prc->Width;
x++) {
505 *dstpixel++=0xff000000 |
506 ((srcval << 9) & 0xf80000) |
507 ((srcval << 4) & 0x070000) |
508 ((srcval << 6) & 0x00f800) |
509 ((srcval << 1) & 0x000700) |
510 ((srcval << 3) & 0x0000f8) |
511 ((srcval >> 2) & 0x000007);
529 UINT srcstride, srcdatasize;
531 const WORD *srcpixel;
535 srcstride = 2 *
prc->Width;
536 srcdatasize = srcstride *
prc->Height;
541 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
547 for (
y=0;
y<
prc->Height;
y++) {
548 srcpixel=(
const WORD*)srcrow;
549 dstpixel=(
DWORD*)dstrow;
550 for (
x=0;
x<
prc->Width;
x++) {
553 *dstpixel++=0xff000000 |
554 ((srcval << 8) & 0xf80000) |
555 ((srcval << 3) & 0x070000) |
556 ((srcval << 5) & 0x00fc00) |
557 ((srcval >> 1) & 0x000300) |
558 ((srcval << 3) & 0x0000f8) |
559 ((srcval >> 2) & 0x000007);
577 UINT srcstride, srcdatasize;
579 const WORD *srcpixel;
583 srcstride = 2 *
prc->Width;
584 srcdatasize = srcstride *
prc->Height;
589 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
595 for (
y=0;
y<
prc->Height;
y++) {
596 srcpixel=(
const WORD*)srcrow;
597 dstpixel=(
DWORD*)dstrow;
598 for (
x=0;
x<
prc->Width;
x++) {
601 *dstpixel++=((srcval & 0x8000) ? 0xff000000 : 0) |
602 ((srcval << 9) & 0xf80000) |
603 ((srcval << 4) & 0x070000) |
604 ((srcval << 6) & 0x00f800) |
605 ((srcval << 1) & 0x000700) |
606 ((srcval << 3) & 0x0000f8) |
607 ((srcval >> 2) & 0x000007);
625 UINT srcstride, srcdatasize;
627 const BYTE *srcpixel;
631 srcstride = 3 *
prc->Width;
632 srcdatasize = srcstride *
prc->Height;
637 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
643 for (
y=0;
y<
prc->Height;
y++) {
646 for (
x=0;
x<
prc->Width;
x++) {
647 *dstpixel++=*srcpixel++;
648 *dstpixel++=*srcpixel++;
649 *dstpixel++=*srcpixel++;
668 UINT srcstride, srcdatasize;
670 const BYTE *srcpixel;
675 srcstride = 3 *
prc->Width;
676 srcdatasize = srcstride *
prc->Height;
681 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
687 for (
y=0;
y<
prc->Height;
y++) {
690 for (
x=0;
x<
prc->Width;
x++) {
691 tmppixel[0]=*srcpixel++;
692 tmppixel[1]=*srcpixel++;
693 tmppixel[2]=*srcpixel++;
695 *dstpixel++=tmppixel[2];
696 *dstpixel++=tmppixel[1];
697 *dstpixel++=tmppixel[0];
716 res = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
720 for (
y=0;
y<
prc->Height;
y++)
721 for (
x=0;
x<
prc->Width;
x++)
722 pbBuffer[cbStride*
y+4*
x+3] = 0xff;
729 res = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
736 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
744 res = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
747 for (
y=0;
y<
prc->Height;
y++)
748 for (
x=0;
x<
prc->Width;
x++)
753 pbBuffer[cbStride*
y+4*
x] = pbBuffer[cbStride*
y+4*
x] * 255 /
alpha;
754 pbBuffer[cbStride*
y+4*
x+1] = pbBuffer[cbStride*
y+4*
x+1] * 255 /
alpha;
755 pbBuffer[cbStride*
y+4*
x+2] = pbBuffer[cbStride*
y+4*
x+2] * 255 /
alpha;
766 UINT srcstride, srcdatasize;
768 const BYTE *srcpixel;
772 srcstride = 6 *
prc->Width;
773 srcdatasize = srcstride *
prc->Height;
778 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
784 for (
y=0;
y<
prc->Height;
y++) {
786 dstpixel=(
DWORD*)dstrow;
787 for (
x=0;
x<
prc->Width;
x++) {
789 srcpixel++;
red = *srcpixel++;
790 srcpixel++;
green = *srcpixel++;
791 srcpixel++;
blue = *srcpixel++;
810 UINT srcstride, srcdatasize;
812 const BYTE *srcpixel;
816 srcstride = 8 *
prc->Width;
817 srcdatasize = srcstride *
prc->Height;
822 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
828 for (
y=0;
y<
prc->Height;
y++) {
830 dstpixel=(
DWORD*)dstrow;
831 for (
x=0;
x<
prc->Width;
x++) {
833 srcpixel++;
red = *srcpixel++;
834 srcpixel++;
green = *srcpixel++;
835 srcpixel++;
blue = *srcpixel++;
836 srcpixel++;
alpha = *srcpixel++;
855 res = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
858 for (
y=0;
y<
prc->Height;
y++)
859 for (
x=0;
x<
prc->Width;
x++)
861 BYTE *pixel = pbBuffer+cbStride*
y+4*
x;
862 BYTE c=pixel[0],
m=pixel[1],
y=pixel[2],
k=pixel[3];
863 pixel[0] = (255-
y)*(255-
k)/255;
864 pixel[1] = (255-
m)*(255-
k)/255;
865 pixel[2] = (255-
c)*(255-
k)/255;
871 FIXME(
"Unimplemented conversion path!\n");
881 switch (source_format)
888 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
892 for (
y=0;
y<
prc->Height;
y++)
893 for (
x=0;
x<
prc->Width;
x++)
894 pbBuffer[cbStride*
y+4*
x+3] = 0xff;
900 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
908 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
911 for (
y=0;
y<
prc->Height;
y++)
912 for (
x=0;
x<
prc->Width;
x++)
917 pbBuffer[cbStride*
y+4*
x] = pbBuffer[cbStride*
y+4*
x] * 255 /
alpha;
918 pbBuffer[cbStride*
y+4*
x+1] = pbBuffer[cbStride*
y+4*
x+1] * 255 /
alpha;
919 pbBuffer[cbStride*
y+4*
x+2] = pbBuffer[cbStride*
y+4*
x+2] * 255 /
alpha;
936 switch (source_format)
942 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
952 switch (source_format)
958 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
970 switch (source_format)
974 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
982 for (
y=0;
y<
prc->Height;
y++)
983 for (
x=0;
x<
prc->Width;
x++)
988 pbBuffer[cbStride*
y+4*
x] = pbBuffer[cbStride*
y+4*
x] *
alpha / 255;
989 pbBuffer[cbStride*
y+4*
x+1] = pbBuffer[cbStride*
y+4*
x+1] *
alpha / 255;
990 pbBuffer[cbStride*
y+4*
x+2] = pbBuffer[cbStride*
y+4*
x+2] *
alpha / 255;
1003 switch (source_format)
1007 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1015 for (
y=0;
y<
prc->Height;
y++)
1016 for (
x=0;
x<
prc->Width;
x++)
1021 pbBuffer[cbStride*
y+4*
x] = pbBuffer[cbStride*
y+4*
x] *
alpha / 255;
1022 pbBuffer[cbStride*
y+4*
x+1] = pbBuffer[cbStride*
y+4*
x+1] *
alpha / 255;
1023 pbBuffer[cbStride*
y+4*
x+2] = pbBuffer[cbStride*
y+4*
x+2] *
alpha / 255;
1036 switch (source_format)
1042 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1057 UINT srcstride, srcdatasize;
1059 const BYTE *srcpixel;
1063 srcstride = 4 *
prc->Width;
1064 srcdatasize = srcstride *
prc->Height;
1069 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
1078 for (
y = 0;
y <
prc->Height;
y++)
1082 for (
x = 0;
x <
prc->Width;
x++) {
1083 *dstpixel++ = srcpixel[2];
1084 *dstpixel++ = srcpixel[1];
1085 *dstpixel++ = srcpixel[0];
1088 srcrow += srcstride;
1094 for (
y = 0;
y <
prc->Height;
y++)
1098 for (
x = 0;
x <
prc->Width;
x++) {
1099 *dstpixel++ = *srcpixel++;
1100 *dstpixel++ = *srcpixel++;
1101 *dstpixel++ = *srcpixel++;
1104 srcrow += srcstride;
1120 UINT srcstride, srcdatasize;
1122 srcstride = 4 *
prc->Width;
1123 srcdatasize = srcstride *
prc->Height;
1128 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
1135 for (
y = 0;
y <
prc->Height;
y++)
1137 float *gray_float = (
float *)
src;
1140 for (
x = 0;
x <
prc->Width;
x++)
1162 UINT srcstride, srcdatasize;
1164 srcstride = 4 *
prc->Width;
1165 srcdatasize = srcstride *
prc->Height;
1170 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
1176 for (
y = 0;
y <
prc->Height;
y++)
1181 for (
x = 0;
x <
prc->Width;
x++)
1183 BYTE c = cmyk[0],
m = cmyk[1],
y = cmyk[2],
k = cmyk[3];
1184 bgr[0] = (255 -
y) * (255 -
k) / 255;
1185 bgr[1] = (255 -
m) * (255 -
k) / 255;
1186 bgr[2] = (255 -
c) * (255 -
k) / 255;
1201 FIXME(
"Unimplemented conversion path!\n");
1211 switch (source_format)
1217 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1231 UINT srcstride, srcdatasize;
1233 const BYTE *srcpixel;
1238 srcstride = 4 *
prc->Width;
1239 srcdatasize = srcstride *
prc->Height;
1244 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
1250 for (
y=0;
y<
prc->Height;
y++) {
1253 for (
x=0;
x<
prc->Width;
x++) {
1254 tmppixel[0]=*srcpixel++;
1255 tmppixel[1]=*srcpixel++;
1256 tmppixel[2]=*srcpixel++;
1259 *dstpixel++=tmppixel[2];
1260 *dstpixel++=tmppixel[1];
1261 *dstpixel++=tmppixel[0];
1263 srcrow += srcstride;
1274 FIXME(
"Unimplemented conversion path!\n");
1284 switch (source_format)
1292 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1307 for (
y = 0;
y <
prc->Height;
y++)
1310 for (
x = 0;
x <
prc->Width;
x++)
1312 float gray = (bgr[2] * 0.2126f + bgr[1] * 0.7152f + bgr[0] * 0.0722f) / 255.0f;
1313 *(
float *)bgr = gray;
1327 UINT srcstride, srcdatasize;
1332 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1343 srcstride = 4 *
prc->Width;
1344 srcdatasize = srcstride *
prc->Height;
1349 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
1355 for (
y=0;
y <
prc->Height;
y++)
1357 float *srcpixel = (
float*)
src;
1360 for (
x=0;
x <
prc->Width;
x++)
1377 srcstride = 3 *
prc->Width;
1378 srcdatasize = srcstride *
prc->Height;
1389 for (
y = 0;
y <
prc->Height;
y++)
1393 for (
x = 0;
x <
prc->Width;
x++)
1395 float gray = (bgr[2] * 0.2126f + bgr[1] * 0.7152f + bgr[0] * 0.0722f) / 255.0f;
1412 UINT best_diff, best_index,
i;
1419 BYTE pal_r, pal_g, pal_b;
1420 UINT diff_r, diff_g, diff_b, diff;
1422 pal_r = colors[
i] >> 16;
1423 pal_g = colors[
i] >> 8;
1426 diff_r = bgr[2] - pal_r;
1427 diff_g = bgr[1] - pal_g;
1428 diff_b = bgr[0] - pal_b;
1430 diff = diff_r * diff_r + diff_g * diff_g + diff_b * diff_b;
1431 if (diff == 0)
return i;
1433 if (diff < best_diff)
1454 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1464 hr = IWICPalette_GetColors(
This->palette, 256, colors, &
count);
1467 srcstride = 3 *
prc->Width;
1468 srcdatasize = srcstride *
prc->Height;
1479 for (
y = 0;
y <
prc->Height;
y++)
1483 for (
x = 0;
x <
prc->Width;
x++)
1547 *
ppv = &
This->IWICFormatConverter_iface;
1564 TRACE(
"(%p) refcount=%u\n", iface,
ref);
1574 TRACE(
"(%p) refcount=%u\n", iface,
ref);
1578 This->lock.DebugInfo->Spare[0] = 0;
1580 if (
This->source) IWICBitmapSource_Release(
This->source);
1581 if (
This->palette) IWICPalette_Release(
This->palette);
1593 TRACE(
"(%p,%p,%p)\n", iface, puiWidth, puiHeight);
1596 return IWICBitmapSource_GetSize(
This->source, puiWidth, puiHeight);
1606 TRACE(
"(%p,%p)\n", iface, pPixelFormat);
1617 double *pDpiX,
double *pDpiY)
1621 TRACE(
"(%p,%p,%p)\n", iface, pDpiX, pDpiY);
1624 return IWICBitmapSource_GetResolution(
This->source, pDpiX, pDpiY);
1647 return IWICBitmapSource_CopyPalette(
This->source,
palette);
1650 return IWICPalette_InitializeFromPalette(
palette,
This->palette);
1675 return This->dst_format->copy_function(
This,
prc, cbStride, cbBufferSize,
1676 pbBuffer,
This->src_format->format);
1691 TRACE(
"(%p,%p,%s,%u,%p,%0.3f,%u)\n", iface,
source,
debugstr_guid(dstFormat),
1741 res = IWICBitmapSource_GetPixelFormat(
source, &srcFormat);
1762 IWICBitmapSource_AddRef(
source);
1763 This->src_format = srcinfo;
1765 This->dither = dither;
1766 This->alpha_threshold = alpha_threshold;
1812 *pfCanConvert =
TRUE;
1816 *pfCanConvert =
FALSE;
1852 This->lock.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": FormatConverter.lock");
1854 ret = IWICFormatConverter_QueryInterface(&
This->IWICFormatConverter_iface, iid,
ppv);
1855 IWICFormatConverter_Release(&
This->IWICFormatConverter_iface);
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define HeapFree(x, y, z)
WICBitmapPaletteType palette_type
static HRESULT WINAPI FormatConverter_QueryInterface(IWICFormatConverter *iface, REFIID iid, void **ppv)
static UINT rgb_to_palette_index(BYTE bgr[3], WICColor *colors, UINT count)
static HRESULT copypixels_to_32bppRGB(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static FormatConverter * impl_from_IWICFormatConverter(IWICFormatConverter *iface)
static HRESULT WINAPI FormatConverter_CanConvert(IWICFormatConverter *iface, REFWICPixelFormatGUID srcPixelFormat, REFWICPixelFormatGUID dstPixelFormat, BOOL *pfCanConvert)
static const IWICFormatConverterVtbl FormatConverter_Vtbl
static HRESULT WINAPI FormatConverter_CopyPalette(IWICFormatConverter *iface, IWICPalette *palette)
static HRESULT copypixels_to_32bppPRGBA(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
HRESULT FormatConverter_CreateInstance(REFIID iid, void **ppv)
static HRESULT WINAPI FormatConverter_GetResolution(IWICFormatConverter *iface, double *pDpiX, double *pDpiY)
static HRESULT copypixels_to_32bppBGR(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface, IWICBitmapSource *source, REFWICPixelFormatGUID dstFormat, WICBitmapDitherType dither, IWICPalette *palette, double alpha_threshold, WICBitmapPaletteType palette_type)
static ULONG WINAPI FormatConverter_Release(IWICFormatConverter *iface)
static HRESULT copypixels_to_24bppBGR(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static const struct pixelformatinfo supported_formats[]
static const struct pixelformatinfo * get_formatinfo(const WICPixelFormatGUID *format)
static HRESULT copypixels_to_24bppRGB(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static HRESULT copypixels_to_8bppGray(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static HRESULT copypixels_to_8bppIndexed(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static HRESULT WINAPI FormatConverter_CopyPixels(IWICFormatConverter *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
static float to_sRGB_component(float f)
static HRESULT copypixels_to_32bppRGBA(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static ULONG WINAPI FormatConverter_AddRef(IWICFormatConverter *iface)
static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static HRESULT copypixels_to_32bppPBGRA(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static HRESULT WINAPI FormatConverter_GetPixelFormat(IWICFormatConverter *iface, WICPixelFormatGUID *pPixelFormat)
HRESULT(* copyfunc)(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static HRESULT copypixels_to_32bppGrayFloat(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static HRESULT WINAPI FormatConverter_GetSize(IWICFormatConverter *iface, UINT *puiWidth, UINT *puiHeight)
void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride)
HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp)
void convert_rgba_to_bgra(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride)
HRESULT PaletteImpl_Create(IWICPalette **palette)
GLint GLint GLint GLint GLint x
GLclampf GLclampf GLclampf alpha
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_ float __cdecl powf(_In_ float b, _In_ float e)
#define memcpy(s1, s2, n)
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
#define CONTAINING_RECORD(address, type, field)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
@ WICBitmapPaletteTypeCustom
@ WICBitmapPaletteTypeFixedBW
@ WICBitmapPaletteTypeFixedGray16
@ WICBitmapPaletteTypeFixedGray4
@ WICBitmapPaletteTypeMedianCut
static const char * debug_wic_rect(const WICRect *rect)
#define WINCODEC_ERR_WRONGSTATE
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
#define WINCODEC_ERR_NOTINITIALIZED
#define WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT