90 if (
f <= 0.0031308
f)
return 12.92f *
f;
91 return 1.055f *
powf(
f, 1.0
f/2.4
f) - 0.055f;
95 static inline float from_sRGB_component(
float f)
97 if (
f <= 0.04045
f)
return f / 12.92f;
98 return powf((
f + 0.055
f) / 1.055
f, 2.4
f);
101 static 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.0
f);
114 bgr[1] = (
BYTE)(
g * 255.0
f);
115 bgr[0] = (
BYTE)(
b * 255.0
f);
118 static void to_sRGB(
BYTE *bgr)
130 bgr[2] = (
BYTE)(
r * 255.0
f);
131 bgr[1] = (
BYTE)(
g * 255.0
f);
132 bgr[0] = (
BYTE)(
b * 255.0
f);
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;
727 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
735 res = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
738 for (
y=0;
y<
prc->Height;
y++)
739 for (
x=0;
x<
prc->Width;
x++)
744 pbBuffer[cbStride*
y+4*
x] = pbBuffer[cbStride*
y+4*
x] * 255 /
alpha;
745 pbBuffer[cbStride*
y+4*
x+1] = pbBuffer[cbStride*
y+4*
x+1] * 255 /
alpha;
746 pbBuffer[cbStride*
y+4*
x+2] = pbBuffer[cbStride*
y+4*
x+2] * 255 /
alpha;
757 UINT srcstride, srcdatasize;
759 const BYTE *srcpixel;
763 srcstride = 6 *
prc->Width;
764 srcdatasize = srcstride *
prc->Height;
769 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
775 for (
y=0;
y<
prc->Height;
y++) {
777 dstpixel=(
DWORD*)dstrow;
778 for (
x=0;
x<
prc->Width;
x++) {
780 srcpixel++;
red = *srcpixel++;
781 srcpixel++;
green = *srcpixel++;
782 srcpixel++;
blue = *srcpixel++;
801 UINT srcstride, srcdatasize;
803 const BYTE *srcpixel;
807 srcstride = 8 *
prc->Width;
808 srcdatasize = srcstride *
prc->Height;
813 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
819 for (
y=0;
y<
prc->Height;
y++) {
821 dstpixel=(
DWORD*)dstrow;
822 for (
x=0;
x<
prc->Width;
x++) {
824 srcpixel++;
red = *srcpixel++;
825 srcpixel++;
green = *srcpixel++;
826 srcpixel++;
blue = *srcpixel++;
827 srcpixel++;
alpha = *srcpixel++;
846 res = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
849 for (
y=0;
y<
prc->Height;
y++)
850 for (
x=0;
x<
prc->Width;
x++)
852 BYTE *pixel = pbBuffer+cbStride*
y+4*
x;
853 BYTE c=pixel[0],
m=pixel[1],
y=pixel[2],
k=pixel[3];
854 pixel[0] = (255-
y)*(255-
k)/255;
855 pixel[1] = (255-
m)*(255-
k)/255;
856 pixel[2] = (255-
c)*(255-
k)/255;
871 switch (source_format)
878 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
882 for (
y=0;
y<
prc->Height;
y++)
883 for (
x=0;
x<
prc->Width;
x++)
884 pbBuffer[cbStride*
y+4*
x+3] = 0xff;
890 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
898 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
901 for (
y=0;
y<
prc->Height;
y++)
902 for (
x=0;
x<
prc->Width;
x++)
907 pbBuffer[cbStride*
y+4*
x] = pbBuffer[cbStride*
y+4*
x] * 255 /
alpha;
908 pbBuffer[cbStride*
y+4*
x+1] = pbBuffer[cbStride*
y+4*
x+1] * 255 /
alpha;
909 pbBuffer[cbStride*
y+4*
x+2] = pbBuffer[cbStride*
y+4*
x+2] * 255 /
alpha;
926 switch (source_format)
932 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
942 switch (source_format)
948 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
960 switch (source_format)
964 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
972 for (
y=0;
y<
prc->Height;
y++)
973 for (
x=0;
x<
prc->Width;
x++)
978 pbBuffer[cbStride*
y+4*
x] = pbBuffer[cbStride*
y+4*
x] *
alpha / 255;
979 pbBuffer[cbStride*
y+4*
x+1] = pbBuffer[cbStride*
y+4*
x+1] *
alpha / 255;
980 pbBuffer[cbStride*
y+4*
x+2] = pbBuffer[cbStride*
y+4*
x+2] *
alpha / 255;
993 switch (source_format)
997 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1005 for (
y=0;
y<
prc->Height;
y++)
1006 for (
x=0;
x<
prc->Width;
x++)
1011 pbBuffer[cbStride*
y+4*
x] = pbBuffer[cbStride*
y+4*
x] *
alpha / 255;
1012 pbBuffer[cbStride*
y+4*
x+1] = pbBuffer[cbStride*
y+4*
x+1] *
alpha / 255;
1013 pbBuffer[cbStride*
y+4*
x+2] = pbBuffer[cbStride*
y+4*
x+2] *
alpha / 255;
1026 switch (source_format)
1032 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1046 UINT srcstride, srcdatasize;
1048 const BYTE *srcpixel;
1052 srcstride = 4 *
prc->Width;
1053 srcdatasize = srcstride *
prc->Height;
1058 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
1064 for (
y=0;
y<
prc->Height;
y++) {
1067 for (
x=0;
x<
prc->Width;
x++) {
1068 *dstpixel++=*srcpixel++;
1069 *dstpixel++=*srcpixel++;
1070 *dstpixel++=*srcpixel++;
1073 srcrow += srcstride;
1088 UINT srcstride, srcdatasize;
1090 srcstride = 4 *
prc->Width;
1091 srcdatasize = srcstride *
prc->Height;
1096 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
1103 for (
y = 0;
y <
prc->Height;
y++)
1105 float *gray_float = (
float *)
src;
1108 for (
x = 0;
x <
prc->Width;
x++)
1130 UINT srcstride, srcdatasize;
1132 srcstride = 4 *
prc->Width;
1133 srcdatasize = srcstride *
prc->Height;
1138 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
1144 for (
y = 0;
y <
prc->Height;
y++)
1149 for (
x = 0;
x <
prc->Width;
x++)
1151 BYTE c = cmyk[0],
m = cmyk[1],
y = cmyk[2],
k = cmyk[3];
1152 bgr[0] = (255 -
y) * (255 -
k) / 255;
1153 bgr[1] = (255 -
m) * (255 -
k) / 255;
1154 bgr[2] = (255 -
c) * (255 -
k) / 255;
1169 FIXME(
"Unimplemented conversion path!\n");
1179 switch (source_format)
1185 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1199 UINT srcstride, srcdatasize;
1201 const BYTE *srcpixel;
1206 srcstride = 4 *
prc->Width;
1207 srcdatasize = srcstride *
prc->Height;
1212 res = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
1218 for (
y=0;
y<
prc->Height;
y++) {
1221 for (
x=0;
x<
prc->Width;
x++) {
1222 tmppixel[0]=*srcpixel++;
1223 tmppixel[1]=*srcpixel++;
1224 tmppixel[2]=*srcpixel++;
1227 *dstpixel++=tmppixel[2];
1228 *dstpixel++=tmppixel[1];
1229 *dstpixel++=tmppixel[0];
1231 srcrow += srcstride;
1242 FIXME(
"Unimplemented conversion path!\n");
1252 switch (source_format)
1260 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1275 for (
y = 0;
y <
prc->Height;
y++)
1278 for (
x = 0;
x <
prc->Width;
x++)
1280 float gray = (bgr[2] * 0.2126f + bgr[1] * 0.7152f + bgr[0] * 0.0722f) / 255.0
f;
1281 *(
float *)bgr = gray;
1295 UINT srcstride, srcdatasize;
1300 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1311 srcstride = 4 *
prc->Width;
1312 srcdatasize = srcstride *
prc->Height;
1317 hr = IWICBitmapSource_CopyPixels(
This->source,
prc, srcstride, srcdatasize, srcdata);
1323 for (
y=0;
y <
prc->Height;
y++)
1325 float *srcpixel = (
float*)
src;
1328 for (
x=0;
x <
prc->Width;
x++)
1345 srcstride = 3 *
prc->Width;
1346 srcdatasize = srcstride *
prc->Height;
1357 for (
y = 0;
y <
prc->Height;
y++)
1361 for (
x = 0;
x <
prc->Width;
x++)
1363 float gray = (bgr[2] * 0.2126f + bgr[1] * 0.7152f + bgr[0] * 0.0722f) / 255.0
f;
1380 UINT best_diff, best_index,
i;
1387 BYTE pal_r, pal_g, pal_b;
1388 UINT diff_r, diff_g, diff_b, diff;
1390 pal_r = colors[
i] >> 16;
1391 pal_g = colors[
i] >> 8;
1394 diff_r = bgr[2] - pal_r;
1395 diff_g = bgr[1] - pal_g;
1396 diff_b = bgr[0] - pal_b;
1398 diff = diff_r * diff_r + diff_g * diff_g + diff_b * diff_b;
1399 if (diff == 0)
return i;
1401 if (diff < best_diff)
1422 return IWICBitmapSource_CopyPixels(
This->source,
prc, cbStride, cbBufferSize, pbBuffer);
1432 hr = IWICPalette_GetColors(
This->palette, 256, colors, &
count);
1435 srcstride = 3 *
prc->Width;
1436 srcdatasize = srcstride *
prc->Height;
1447 for (
y = 0;
y <
prc->Height;
y++)
1451 for (
x = 0;
x <
prc->Width;
x++)
1515 *
ppv = &
This->IWICFormatConverter_iface;
1532 TRACE(
"(%p) refcount=%u\n", iface,
ref);
1542 TRACE(
"(%p) refcount=%u\n", iface,
ref);
1546 This->lock.DebugInfo->Spare[0] = 0;
1548 if (
This->source) IWICBitmapSource_Release(
This->source);
1549 if (
This->palette) IWICPalette_Release(
This->palette);
1561 TRACE(
"(%p,%p,%p)\n", iface, puiWidth, puiHeight);
1564 return IWICBitmapSource_GetSize(
This->source, puiWidth, puiHeight);
1574 TRACE(
"(%p,%p)\n", iface, pPixelFormat);
1585 double *pDpiX,
double *pDpiY)
1589 TRACE(
"(%p,%p,%p)\n", iface, pDpiX, pDpiY);
1592 return IWICBitmapSource_GetResolution(
This->source, pDpiX, pDpiY);
1615 return IWICBitmapSource_CopyPalette(
This->source,
palette);
1618 return IWICPalette_InitializeFromPalette(
palette,
This->palette);
1643 return This->dst_format->copy_function(
This,
prc, cbStride, cbBufferSize,
1644 pbBuffer,
This->src_format->format);
1659 TRACE(
"(%p,%p,%s,%u,%p,%0.3f,%u)\n", iface,
source,
debugstr_guid(dstFormat),
1709 res = IWICBitmapSource_GetPixelFormat(
source, &srcFormat);
1730 IWICBitmapSource_AddRef(
source);
1731 This->src_format = srcinfo;
1733 This->dither = dither;
1734 This->alpha_threshold = alpha_threshold;
1780 *pfCanConvert =
TRUE;
1784 *pfCanConvert =
FALSE;
1820 This->lock.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": FormatConverter.lock");
1822 ret = IWICFormatConverter_QueryInterface(&
This->IWICFormatConverter_iface, iid,
ppv);
1823 IWICFormatConverter_Release(&
This->IWICFormatConverter_iface);
static HRESULT WINAPI FormatConverter_CopyPixels(IWICFormatConverter *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
GLint GLint GLsizei width
static const struct pixelformatinfo * get_formatinfo(const WICPixelFormatGUID *format)
static HRESULT copypixels_to_32bppRGBA(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)
GLdouble GLdouble GLdouble r
HRESULT PaletteImpl_Create(IWICPalette **palette)
GLuint GLuint GLsizei count
static HRESULT copypixels_to_32bppBGR(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static HRESULT copypixels_to_32bppRGB(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
GLint GLint GLint GLint GLint x
static HRESULT WINAPI FormatConverter_GetPixelFormat(IWICFormatConverter *iface, WICPixelFormatGUID *pPixelFormat)
#define WINCODEC_ERR_NOTINITIALIZED
struct FormatConverter FormatConverter
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static float to_sRGB_component(float f)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
static void * heap_alloc(size_t len)
static HRESULT copypixels_to_32bppPRGBA(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)
HRESULT FormatConverter_CreateInstance(REFIID iid, void **ppv)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
_Check_return_ __CRT_INLINE float powf(_In_ float x, _In_ float y)
GLboolean GLboolean GLboolean b
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
static UINT rgb_to_palette_index(BYTE bgr[3], WICColor *colors, UINT count)
static HRESULT copypixels_to_8bppIndexed(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
HRESULT(* copyfunc)(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)
#define InterlockedDecrement
static HRESULT copypixels_to_32bppGrayFloat(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static const char * debug_wic_rect(const WICRect *rect)
static HRESULT WINAPI FormatConverter_CopyPalette(IWICFormatConverter *iface, IWICPalette *palette)
#define memcpy(s1, s2, n)
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
static FormatConverter * impl_from_IWICFormatConverter(IWICFormatConverter *iface)
GLint GLint GLsizei GLsizei height
static HRESULT copypixels_to_24bppBGR(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
#define WINCODEC_ERR_WRONGSTATE
WICBitmapPaletteType palette_type
#define InterlockedIncrement
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
GLsizei GLsizei GLchar * source
#define WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT
static HRESULT copypixels_to_24bppRGB(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static const struct pixelformatinfo supported_formats[]
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
GLint GLint GLint GLint GLint GLint y
static HRESULT WINAPI FormatConverter_CanConvert(IWICFormatConverter *iface, REFWICPixelFormatGUID srcPixelFormat, REFWICPixelFormatGUID dstPixelFormat, BOOL *pfCanConvert)
GLclampf GLclampf GLclampf alpha
static HRESULT WINAPI FormatConverter_GetResolution(IWICFormatConverter *iface, double *pDpiX, double *pDpiY)
void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static ULONG WINAPI FormatConverter_AddRef(IWICFormatConverter *iface)
WINE_DEFAULT_DEBUG_CHANNEL(wincodecs)
HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp)
static HRESULT WINAPI FormatConverter_QueryInterface(IWICFormatConverter *iface, REFIID iid, void **ppv)
#define HeapFree(x, y, z)
static ULONG WINAPI FormatConverter_Release(IWICFormatConverter *iface)
#define IsEqualIID(riid1, riid2)
static HRESULT copypixels_to_8bppGray(struct FormatConverter *This, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format)
static const IWICFormatConverterVtbl FormatConverter_Vtbl
static BOOL heap_free(void *mem)