30#include "wincodecsdk.h"
98 *puiWidth =
This->data->width;
99 *puiHeight =
This->data->height;
112 double *pDpiX,
double *pDpiY)
115 *pDpiX =
This->data->xres;
116 *pDpiY =
This->data->yres;
125 if (
IsEqualGUID(
This->data->format, &GUID_WICPixelFormat1bppIndexed) ||
132 colors[0] = 0xff0000ff;
133 colors[1] = 0xff00ff00;
134 colors[2] = 0xffff0000;
135 colors[3] = 0xff000000;
136 colors[4] = 0xffffff00;
137 colors[5] = 0xffff00ff;
138 colors[6] = 0xff00ffff;
139 colors[7] = 0xffffffff;
140 return IWICPalette_InitializeCustom(
palette, colors, 8);
170 bytesperrow = ((
This->data->bpp *
prc->Width)+7)/8;
171 srcstride = ((
This->data->bpp *
This->data->width)+7)/8;
173 if (cbStride < bytesperrow)
176 if ((cbStride *
prc->Height) > cbBufferSize)
179 row_offset =
prc->X *
This->data->bpp;
181 if (row_offset % 8 == 0)
187 src =
This->data->bits + (row_offset / 8) +
prc->Y * srcstride;
199 ok(0,
"bitmap %p was asked to copy pixels not aligned on a byte boundary\n", iface);
223 (*This)->data =
data;
230 ok(
This->ref == 1,
"test bitmap %p deleted with %i references instead of 1\n",
This,
This->ref);
244 for (
i=0;
i<(buffersize/4);
i++)
245 if ((
a[
i]&0xffffff) != (
b[
i]&0xffffff))
254 const float *
a=(
const float*)
expect->bits, *
b=(
const float*)converted_bits;
256 for (
i=0;
i<(buffersize/4);
i++)
269 for (
i=0;
i<buffersize;
i++)
270 if (
a[
i] !=
b[
i] &&
b[
i] != 0xff )
284 for (
i=0;
i<buffersize;
i++)
301 if (!bps) bps = buffersize;
302 printf(
"converted_bits (%u bytes):\n ", buffersize);
303 for (
i = 0;
i < buffersize;
i++)
305 printf(
"%u,", converted_bits[
i]);
306 if (!((
i + 1) % 32))
printf(
"\n ");
307 else if (!((
i+1) % bps))
printf(
" ");
329 BYTE *converted_bits;
334 GUID dst_pixelformat;
342 hr = IWICBitmapSource_GetResolution(
source, &xres, &yres);
347 hr = IWICBitmapSource_GetPixelFormat(
source, &dst_pixelformat);
360 memset(converted_bits, 0xaa, buffersize);
361 hr = IWICBitmapSource_CopyPixels(
source, &
prc,
stride, buffersize, converted_bits);
372 memset(converted_bits, 0xaa, buffersize);
385 0xaa,0xaa,0xaa,0xaa};
387 &GUID_WICPixelFormatBlackWhite, 1,
bits_1bpp, 32, 2, 96.0, 96.0};
389 &GUID_WICPixelFormat1bppIndexed, 1,
bits_1bpp, 32, 2, 96.0, 96.0};
393 0xdb,0xdb,0xdb,0xdb,0xdb,0xdb,0xdb,0xdb,
394 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24};
396 &GUID_WICPixelFormat2bppIndexed, 2,
bits_2bpp, 32, 2, 96.0, 96.0};
400 0x34,0x43,0x34,0x43,0x34,0x43,0x34,0x43,0x34,0x43,0x34,0x43,0x34,0x43,0x34,0x43,
401 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44};
404 &GUID_WICPixelFormat4bppIndexed, 4,
bits_4bpp, 32, 2, 96.0, 96.0};
407 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
408 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0};
410 &GUID_WICPixelFormat8bppIndexed, 8,
bits_8bpp_BW, 32, 2, 96.0, 96.0};
413 0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,0,
414 3,2,1,3,3,2,1,3,3,2,1,3,3,2,1,3,3,2,1,3,3,2,1,3,3,2,1,3,3,2,1,3};
419 0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,
420 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
422 &GUID_WICPixelFormat8bppIndexed, 8,
bits_8bpp, 32, 2, 96.0, 96.0};
425 255,0,0, 0,255,0, 0,0,255, 0,0,0, 255,0,0, 0,255,0, 0,0,255, 0,0,0,
426 255,0,0, 0,255,0, 0,0,255, 0,0,0, 255,0,0, 0,255,0, 0,0,255, 0,0,0,
427 255,0,0, 0,255,0, 0,0,255, 0,0,0, 255,0,0, 0,255,0, 0,0,255, 0,0,0,
428 255,0,0, 0,255,0, 0,0,255, 0,0,0, 255,0,0, 0,255,0, 0,0,255, 0,0,0,
429 0,255,255, 255,0,255, 255,255,0, 255,255,255, 0,255,255, 255,0,255, 255,255,0, 255,255,255,
430 0,255,255, 255,0,255, 255,255,0, 255,255,255, 0,255,255, 255,0,255, 255,255,0, 255,255,255,
431 0,255,255, 255,0,255, 255,255,0, 255,255,255, 0,255,255, 255,0,255, 255,255,0, 255,255,255,
432 0,255,255, 255,0,255, 255,255,0, 255,255,255, 0,255,255, 255,0,255, 255,255,0, 255,255,255};
434 &GUID_WICPixelFormat24bppBGR, 24,
bits_24bppBGR, 32, 2, 96.0, 96.0};
437 0,0,255, 0,255,0, 255,0,0, 0,0,0, 0,0,255, 0,255,0, 255,0,0, 0,0,0,
438 0,0,255, 0,255,0, 255,0,0, 0,0,0, 0,0,255, 0,255,0, 255,0,0, 0,0,0,
439 0,0,255, 0,255,0, 255,0,0, 0,0,0, 0,0,255, 0,255,0, 255,0,0, 0,0,0,
440 0,0,255, 0,255,0, 255,0,0, 0,0,0, 0,0,255, 0,255,0, 255,0,0, 0,0,0,
441 255,255,0, 255,0,255, 0,255,255, 255,255,255, 255,255,0, 255,0,255, 0,255,255, 255,255,255,
442 255,255,0, 255,0,255, 0,255,255, 255,255,255, 255,255,0, 255,0,255, 0,255,255, 255,255,255,
443 255,255,0, 255,0,255, 0,255,255, 255,255,255, 255,255,0, 255,0,255, 0,255,255, 255,255,255,
444 255,255,0, 255,0,255, 0,255,255, 255,255,255, 255,255,0, 255,0,255, 0,255,255, 255,255,255 };
446 &GUID_WICPixelFormat24bppRGB, 24,
bits_24bppRGB, 32, 2, 96.0, 96.0};
449 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80, 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80,
450 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80, 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80,
451 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80, 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80,
452 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80, 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80,
453 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80, 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80,
454 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80, 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80,
455 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80, 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80,
456 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80, 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80};
458 &GUID_WICPixelFormat32bppBGR, 32,
bits_32bppBGR, 32, 2, 96.0, 96.0};
460 &GUID_WICPixelFormat32bppBGRA, 32,
bits_32bppBGR, 32, 2, 96.0, 96.0};
462 &GUID_WICPixelFormat32bppRGBA, 32,
bits_32bppBGR, 32, 2, 96.0, 96.0};
465 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255, 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255,
466 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255, 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255,
467 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255, 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255,
468 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255, 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255,
469 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255,
470 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255,
471 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255,
472 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255};
474 &GUID_WICPixelFormat32bppBGRA, 32,
bits_32bppBGRA, 32, 2, 96.0, 96.0};
476 &GUID_WICPixelFormat32bppRGBA, 32,
bits_32bppBGRA, 32, 2, 96.0, 96.0};
478 &GUID_WICPixelFormat32bppRGB, 32,
bits_32bppBGRA, 32, 2, 96.0, 96.0};
481 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80, 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80,
482 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80, 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80,
483 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80, 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80,
484 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80, 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80,
485 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80, 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80,
486 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80, 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80,
487 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80, 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80,
488 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80, 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80};
490 &GUID_WICPixelFormat32bppPBGRA, 32,
bits_32bppPBGRA, 32, 2, 96.0, 96.0};
492 &GUID_WICPixelFormat32bppPRGBA, 32,
bits_32bppPBGRA, 32, 2, 96.0, 96.0};
495 128,255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,128, 255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,
496 128,255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,128, 255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,
497 128,255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,128, 255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,
498 128,255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,128, 255,128,0,128,0,128,255,128, 0,128,255,128,0,128,255,128, 0,128,0,128,255,128,255,128, 0,128,0,128,0,128,255,
499 128,0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,128, 0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,
500 128,0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,128, 0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,
501 128,0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,128, 0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,
502 128,0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255,128, 0,128,255,128,255,128,255,128, 255,128,0,128,255,128,255,128, 255,128,255,128,0,128,255,128, 255,128,255,128,255,128,255};
504 &GUID_WICPixelFormat64bppRGBA, 64,
bits_64bppRGBA, 32, 2, 96.0, 96.0};
508 0.114000f,0.587000f,0.299000f,0.000000f,0.114000f,0.587000f,0.299000f,0.000000f,
509 0.114000f,0.587000f,0.299000f,0.000000f,0.114000f,0.587000f,0.299000f,0.000000f,
510 0.114000f,0.587000f,0.299000f,0.000000f,0.114000f,0.587000f,0.299000f,0.000000f,
511 0.114000f,0.587000f,0.299000f,0.000000f,0.114000f,0.587000f,0.299000f,0.000000f,
512 0.886000f,0.413000f,0.701000f,1.000000f,0.886000f,0.413000f,0.701000f,1.000000f,
513 0.886000f,0.413000f,0.701000f,1.000000f,0.886000f,0.413000f,0.701000f,1.000000f,
514 0.886000f,0.413000f,0.701000f,1.000000f,0.886000f,0.413000f,0.701000f,1.000000f,
515 0.886000f,0.413000f,0.701000f,1.000000f,0.886000f,0.413000f,0.701000f,1.000000f};
520 0.072200f,0.715200f,0.212600f,0.000000f,0.072200f,0.715200f,0.212600f,0.000000f,
521 0.072200f,0.715200f,0.212600f,0.000000f,0.072200f,0.715200f,0.212600f,0.000000f,
522 0.072200f,0.715200f,0.212600f,0.000000f,0.072200f,0.715200f,0.212600f,0.000000f,
523 0.072200f,0.715200f,0.212600f,0.000000f,0.072200f,0.715200f,0.212600f,0.000000f,
524 0.927800f,0.284800f,0.787400f,1.000000f,0.927800f,0.284800f,0.787400f,1.000000f,
525 0.927800f,0.284800f,0.787400f,1.000000f,0.927800f,0.284800f,0.787400f,1.000000f,
526 0.927800f,0.284800f,0.787400f,1.000000f,0.927800f,0.284800f,0.787400f,1.000000f,
527 0.927800f,0.284800f,0.787400f,1.000000f,0.927800f,0.284800f,0.787400f,1.000000f};
532 29,150,76,0,29,150,76,0,29,150,76,0,29,150,76,0,
533 29,150,76,0,29,150,76,0,29,150,76,0,29,150,76,0,
534 226,105,179,255,226,105,179,255,226,105,179,255,226,105,179,255,
535 226,105,179,255,226,105,179,255,226,105,179,255,226,105,179,255};
540 76,220,127,0,76,220,127,0,76,220,127,0,76,220,127,0,
541 76,220,127,0,76,220,127,0,76,220,127,0,76,220,127,0,
542 247,145,230,255,247,145,230,255,247,145,230,255,247,145,230,255,
543 247,145,230,255,247,145,230,255,247,145,230,255,247,145,230,255};
548 76,76,76, 220,220,220, 127,127,127, 0,0,0, 76,76,76, 220,220,220, 127,127,127, 0,0,0,
549 76,76,76, 220,220,220, 127,127,127, 0,0,0, 76,76,76, 220,220,220, 127,127,127, 0,0,0,
550 76,76,76, 220,220,220, 127,127,127, 0,0,0, 76,76,76, 220,220,220, 127,127,127, 0,0,0,
551 76,76,76, 220,220,220, 127,127,127, 0,0,0, 76,76,76, 220,220,220, 127,127,127, 0,0,0,
552 247,247,247, 145,145,145, 230,230,230, 255,255,255, 247,247,247, 145,145,145, 230,230,230, 255,255,255,
553 247,247,247, 145,145,145, 230,230,230, 255,255,255, 247,247,247, 145,145,145, 230,230,230, 255,255,255,
554 247,247,247, 145,145,145, 230,230,230, 255,255,255, 247,247,247, 145,145,145, 230,230,230, 255,255,255,
555 247,247,247, 145,145,145, 230,230,230, 255,255,255, 247,247,247, 145,145,145, 230,230,230, 255,255,255};
576 IWICBitmapSource_Release(dst_bitmap);
607 &IID_IWICFormatConverter, (
void**)&converter);
611 hr = IWICFormatConverter_CanConvert(converter, &GUID_WICPixelFormat32bppBGRA,
612 &GUID_WICPixelFormat32bppBGR, &can_convert);
614 ok(can_convert,
"expected TRUE, got %i\n", can_convert);
624 IWICFormatConverter_Release(converter);
640static const WCHAR wszTiffCompressionMethod[] = {
'T',
'i',
'f',
'f',
'C',
'o',
'm',
'p',
'r',
'e',
's',
's',
'i',
'o',
'n',
'M',
'e',
't',
'h',
'o',
'd',0};
641static const WCHAR wszCompressionQuality[] = {
'C',
'o',
'm',
'p',
'r',
'e',
's',
's',
'i',
'o',
'n',
'Q',
'u',
'a',
'l',
'i',
't',
'y',0};
642static const WCHAR wszInterlaceOption[] = {
'I',
'n',
't',
'e',
'r',
'l',
'a',
'c',
'e',
'O',
'p',
't',
'i',
'o',
'n',0};
643static const WCHAR wszFilterOption[] = {
'F',
'i',
'l',
't',
'e',
'r',
'O',
'p',
't',
'i',
'o',
'n',0};
644static const WCHAR wszImageQuality[] = {
'I',
'm',
'a',
'g',
'e',
'Q',
'u',
'a',
'l',
'i',
't',
'y',0};
645static const WCHAR wszBitmapTransform[] = {
'B',
'i',
't',
'm',
'a',
'p',
'T',
'r',
'a',
'n',
's',
'f',
'o',
'r',
'm',0};
647static const WCHAR wszChrominance[] = {
'C',
'h',
'r',
'o',
'm',
'i',
'n',
'a',
'n',
'c',
'e',0};
648static const WCHAR wszJpegYCrCbSubsampling[] = {
'J',
'p',
'e',
'g',
'Y',
'C',
'r',
'C',
'b',
'S',
'u',
'b',
's',
'a',
'm',
'p',
'l',
'i',
'n',
'g',0};
649static const WCHAR wszSuppressApp0[] = {
'S',
'u',
'p',
'p',
'r',
'e',
's',
's',
'A',
'p',
'p',
'0',0};
650static const WCHAR wszEnableV5Header32bppBGRA[] = {
'E',
'n',
'a',
'b',
'l',
'e',
'V',
'5',
'H',
'e',
'a',
'd',
'e',
'r',
'3',
'2',
'b',
'p',
'p',
'B',
'G',
'R',
'A',0};
682 for (
i=0;
i < all_prop_cnt;
i++)
703 hr = IPropertyBag2_Read(
options, 1, &pb,
NULL, &pvarValue, &phrError);
712 ok(
idx >= 0,
"Property %s not in output of GetPropertyInfo\n",
718 ok(all_props[
idx].dwType == PROPBAG2_TYPE_DATA,
"Property %s has unexpected dw type, vt=%i\n",
720 ok(all_props[
idx].cfType == 0,
"Property %s has unexpected cf type, vt=%i\n",
724 ok(
SUCCEEDED(
hr),
"Reading property %s from bag failed, hr=%x\n",
731 "Property %s has unexpected initial type, V_VT=%i\n",
744 ok(
V_UNION(&pvarValue, fltVal) ==
data[
i].
f_init_val,
"Property %s has an unexpected initial value, pvarValue=%f\n",
762 ULONG cProperties = 0;
763 ULONG cProperties2 = 0;
764 PROPBAG2 all_props[64] = {{0}};
769 hr = IPropertyBag2_CountProperties(
options, &cProperties);
775 hr = IPropertyBag2_GetPropertyInfo(
options, cProperties, 1, all_props, &cProperties2);
778 hr = IPropertyBag2_GetPropertyInfo(
options, 0, cProperties+1, all_props, &cProperties2);
781 if (cProperties == 0)
783 cProperties2 = cProperties;
788 hr = IPropertyBag2_GetPropertyInfo(
options, 0,
min(64, cProperties), all_props, &cProperties2);
789 ok(
SUCCEEDED(
hr),
"Reading infos from property bag failed, hr=%x\n",
hr);
795 ok(cProperties == cProperties2,
"Mismatch of property count (IPropertyBag2::CountProperties=%i, IPropertyBag2::GetPropertyInfo=%i)\n",
796 (
int)cProperties, (
int)cProperties2);
801 else if (
IsEqualCLSID(clsid_encoder, &CLSID_WICPngEncoder))
803 else if (
IsEqualCLSID(clsid_encoder, &CLSID_WICJpegEncoder))
805 else if (
IsEqualCLSID(clsid_encoder, &CLSID_WICBmpEncoder))
808 for (
i=0;
i < cProperties2;
i++)
810 ok(all_props[
i].pstrName !=
NULL,
"Unset property name in output of IPropertyBag2::GetPropertyInfo\n");
819#ifdef WORDS_BIGENDIAN
825 hr = IUnknown_QueryInterface(
reader, &IID_IWICPersistStream, (
void **)&persist);
826 ok(
hr ==
S_OK,
"QueryInterface failed, hr=%x\n",
hr);
828 hr = IWICPersistStream_LoadEx(persist,
stream,
NULL, persist_options);
831 IWICPersistStream_Release(persist);
853 { 0x100, &
width }, { 0x101, &
height }, { 0x102, &bps },
854 { 0x106, &photo }, { 0x115, &
samples }, { 0x140, &colormap }
859 ok(
hr ==
S_OK,
"IStream_Read error %#x\n",
hr);
861 "wrong TIFF byte order mark %02x\n",
tiff.byte_order);
862 ok(
tiff.version == 42,
"wrong TIFF version %u\n",
tiff.version);
864 pos.QuadPart =
tiff.dir_offset;
866 ok(
hr ==
S_OK,
"IStream_Seek error %#x\n",
hr);
869 &IID_IWICMetadataReader, (
void **)&
reader);
870 ok(
hr ==
S_OK,
"CoCreateInstance error %#x\n",
hr);
880 PropVariantInit(&
id);
881 PropVariantInit(&
value);
884 U(
id).uiVal =
tag[
i].id;
887 "GetValue(%04x) error %#x\n",
tag[
i].
id,
hr);
894 tag[
i].value[0] = -1;
899 IWICMetadataReader_Release(
reader);
906 ok(bps == 1,
"wrong bps %d\n", bps);
907 ok(photo == 1,
"wrong photometric %d\n", photo);
909 ok(colormap == -1,
"wrong colormap %d\n", colormap);
916 ok(bps == 1,
"wrong bps %d\n", bps);
917 ok(photo == 3,
"wrong photometric %d\n", photo);
919 ok(colormap == 6,
"wrong colormap %d\n", colormap);
926 ok(bps == 4,
"wrong bps %d\n", bps);
927 ok(photo == 3,
"wrong photometric %d\n", photo);
929 ok(colormap == 48,
"wrong colormap %d\n", colormap);
936 ok(bps == 8,
"wrong bps %d\n", bps);
937 ok(photo == 3,
"wrong photometric %d\n", photo);
939 ok(colormap == 768,
"wrong colormap %d\n", colormap);
946 ok(bps == 3,
"wrong bps %d\n", bps);
947 ok(photo == 2,
"wrong photometric %d\n", photo);
949 ok(colormap == -1,
"wrong colormap %d\n", colormap);
962 ok(
hr ==
S_OK,
"IStream_Read error %#x\n",
hr);
964 ok(bfh.
bfType == 0x4d42,
"wrong BMP signature %02x\n", bfh.
bfType);
969 ok(
hr ==
S_OK,
"IStream_Read error %#x\n",
hr);
975 ok(bih.bV5Width == 32,
"wrong width %u\n", bih.bV5Width);
976 ok(bih.bV5Height == 2,
"wrong height %u\n", bih.bV5Height);
978 ok(bih.bV5Planes == 1,
"wrong Planes %d\n", bih.bV5Planes);
979 ok(bih.bV5BitCount == 1,
"wrong BitCount %d\n", bih.bV5BitCount);
980 ok(bih.bV5ClrUsed == 256,
"wrong ClrUsed %d\n", bih.bV5ClrUsed);
981 ok(bih.bV5ClrImportant == 256,
"wrong ClrImportant %d\n", bih.bV5ClrImportant);
987 ok(bih.bV5Width == 32,
"wrong width %u\n", bih.bV5Width);
988 ok(bih.bV5Height == 2,
"wrong height %u\n", bih.bV5Height);
990 ok(bih.bV5Planes == 1,
"wrong Planes %d\n", bih.bV5Planes);
991 ok(bih.bV5BitCount == 4,
"wrong BitCount %d\n", bih.bV5BitCount);
992 ok(bih.bV5ClrUsed == 256,
"wrong ClrUsed %d\n", bih.bV5ClrUsed);
993 ok(bih.bV5ClrImportant == 256,
"wrong ClrImportant %d\n", bih.bV5ClrImportant);
999 ok(bih.bV5Width == 32,
"wrong width %u\n", bih.bV5Width);
1000 ok(bih.bV5Height == 2,
"wrong height %u\n", bih.bV5Height);
1002 ok(bih.bV5Planes == 1,
"wrong Planes %d\n", bih.bV5Planes);
1003 ok(bih.bV5BitCount == 8,
"wrong BitCount %d\n", bih.bV5BitCount);
1004 ok(bih.bV5ClrUsed == 256,
"wrong ClrUsed %d\n", bih.bV5ClrUsed);
1005 ok(bih.bV5ClrImportant == 256,
"wrong ClrImportant %d\n", bih.bV5ClrImportant);
1011 ok(bih.bV5Width == 32,
"wrong width %u\n", bih.bV5Width);
1012 ok(bih.bV5Height == 2,
"wrong height %u\n", bih.bV5Height);
1014 ok(bih.bV5Planes == 1,
"wrong Planes %d\n", bih.bV5Planes);
1015 ok(bih.bV5BitCount == 32,
"wrong BitCount %d\n", bih.bV5BitCount);
1016 ok(bih.bV5ClrUsed == 0,
"wrong ClrUsed %d\n", bih.bV5ClrUsed);
1017 ok(bih.bV5ClrImportant == 0,
"wrong ClrImportant %d\n", bih.bV5ClrImportant);
1032 return (
u.c[0] << 24) | (
u.c[1] << 16) | (
u.c[2] << 8) |
u.c[3];
1037 static const char png_sig[8] = {0x89,
'P',
'N',
'G',0x0d,0x0a,0x1a,0x0a};
1038 static const char png_IHDR[8] = {0,0,0,0x0d,
'I',
'H',
'D',
'R'};
1048 memset(&png, 0,
sizeof(png));
1050 ok(
hr ==
S_OK,
"IStream_Read error %#x\n",
hr);
1052 ok(!
memcmp(png.png_sig, png_sig,
sizeof(png_sig)),
"expected PNG signature\n");
1060 ok(png.bit_depth == 1,
"wrong bit_depth %d\n", png.bit_depth);
1061 ok(png.color_type == 0,
"wrong color_type %d\n", png.color_type);
1062 ok(png.compression == 0,
"wrong compression %d\n", png.compression);
1063 ok(png.filter == 0,
"wrong filter %d\n", png.filter);
1064 ok(png.interlace == 0,
"wrong interlace %d\n", png.interlace);
1071 ok(png.bit_depth == 1,
"wrong bit_depth %d\n", png.bit_depth);
1072 ok(png.color_type == 3,
"wrong color_type %d\n", png.color_type);
1073 ok(png.compression == 0,
"wrong compression %d\n", png.compression);
1074 ok(png.filter == 0,
"wrong filter %d\n", png.filter);
1075 ok(png.interlace == 0,
"wrong interlace %d\n", png.interlace);
1082 ok(png.bit_depth == 2,
"wrong bit_depth %d\n", png.bit_depth);
1083 ok(png.color_type == 3,
"wrong color_type %d\n", png.color_type);
1084 ok(png.compression == 0,
"wrong compression %d\n", png.compression);
1085 ok(png.filter == 0,
"wrong filter %d\n", png.filter);
1086 ok(png.interlace == 0,
"wrong interlace %d\n", png.interlace);
1093 ok(png.bit_depth == 4,
"wrong bit_depth %d\n", png.bit_depth);
1094 ok(png.color_type == 3,
"wrong color_type %d\n", png.color_type);
1095 ok(png.compression == 0,
"wrong compression %d\n", png.compression);
1096 ok(png.filter == 0,
"wrong filter %d\n", png.filter);
1097 ok(png.interlace == 0,
"wrong interlace %d\n", png.interlace);
1104 ok(png.bit_depth == 8,
"wrong bit_depth %d\n", png.bit_depth);
1105 ok(png.color_type == 3,
"wrong color_type %d\n", png.color_type);
1106 ok(png.compression == 0,
"wrong compression %d\n", png.compression);
1107 ok(png.filter == 0,
"wrong filter %d\n", png.filter);
1108 ok(png.interlace == 0,
"wrong interlace %d\n", png.interlace);
1115 ok(png.bit_depth == 8,
"wrong bit_depth %d\n", png.bit_depth);
1116 ok(png.color_type == 2,
"wrong color_type %d\n", png.color_type);
1117 ok(png.compression == 0,
"wrong compression %d\n", png.compression);
1118 ok(png.filter == 0,
"wrong filter %d\n", png.filter);
1119 ok(png.interlace == 0 || png.interlace == 1,
"wrong interlace %d\n", png.interlace);
1127#include "pshpack1.h"
1143 UINT color_resolution;
1146 memset(&lsd, 0,
sizeof(lsd));
1148 ok(
hr ==
S_OK,
"IStream_Read error %#x\n",
hr);
1150 ok(!
memcmp(lsd.signature,
"GIF89a", 6),
"wrong GIF signature %.6s\n", lsd.signature);
1152 ok(lsd.width == 32,
"wrong width %u\n", lsd.width);
1153 ok(lsd.height == 2,
"wrong height %u\n", lsd.height);
1154 color_resolution = 1 << (((lsd.packed >> 4) & 0x07) + 1);
1155 ok(color_resolution == 256,
"wrong color resolution %u\n", color_resolution);
1156 ok(lsd.pixel_aspect_ratio == 0,
"wrong pixel_aspect_ratio %u\n", lsd.pixel_aspect_ratio);
1166 ok(
hr ==
S_OK,
"IStream_Seek error %#x\n",
hr);
1170 else if (
IsEqualGUID(encoder, &CLSID_WICBmpEncoder))
1172 else if (
IsEqualGUID(encoder, &CLSID_WICTiffEncoder))
1174 else if (
IsEqualGUID(encoder, &CLSID_WICGifEncoder))
1180 ok(
hr ==
S_OK,
"IStream_Seek error %#x\n",
hr);
1190#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
1194 IUnknown_AddRef(
obj);
1195 rc = IUnknown_Release(
obj);
1196 ok_(__FILE__,
line)(rc ==
ref,
"expected refcount %d, got %d\n",
ref, rc);
1206 &IID_IWICComponentFactory, (
void **)&
factory);
1207 ok(
hr ==
S_OK,
"CoCreateInstance failed, hr=%x\n",
hr);
1209 hr = IWICBitmapFrameEncode_SetPalette(frameencode,
NULL);
1213 ok(
hr ==
S_OK,
"CreatePalette failed, hr=%x\n",
hr);
1215 hr = IWICBitmapFrameEncode_SetPalette(frameencode,
palette);
1220 ok(
hr ==
S_OK,
"InitializePredefined failed, hr=%x\n",
hr);
1223 hr = IWICBitmapFrameEncode_SetPalette(frameencode,
palette);
1224 ok(
hr ==
S_OK,
"SetPalette failed, hr=%x\n",
hr);
1227 hr = IWICBitmapFrameEncode_SetPalette(frameencode,
NULL);
1231 IWICComponentFactory_Release(
factory);
1238 const GUID *container_format =
NULL;
1253 &IID_IWICBitmapEncoder, (
void **)&encoder);
1259 hr = IWICBitmapEncoder_GetContainerFormat(encoder,
NULL);
1262 if (
IsEqualGUID(clsid_encoder, &CLSID_WICPngEncoder))
1263 container_format = &GUID_ContainerFormatPng;
1264 else if (
IsEqualGUID(clsid_encoder, &CLSID_WICBmpEncoder))
1265 container_format = &GUID_ContainerFormatBmp;
1266 else if (
IsEqualGUID(clsid_encoder, &CLSID_WICTiffEncoder))
1267 container_format = &GUID_ContainerFormatTiff;
1268 else if (
IsEqualGUID(clsid_encoder, &CLSID_WICJpegEncoder))
1269 container_format = &GUID_ContainerFormatJpeg;
1273 if (container_format)
1276 hr = IWICBitmapEncoder_GetContainerFormat(encoder, &
guid);
1285 hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frameencode,
NULL);
1289 IWICBitmapEncoder_Release(encoder);
1290 IWICBitmapFrameEncode_Release(frameencode);
1293 &IID_IWICBitmapEncoder, (
void**)&encoder);
1298 ok(hglobal !=
NULL,
"GlobalAlloc failed\n");
1311 hr = IWICBitmapEncoder_SetPalette(encoder,
palette);
1320 hr = IWICBitmapEncoder_SetPalette(encoder,
palette);
1321 if (
IsEqualGUID(clsid_encoder, &CLSID_WICGifEncoder))
1322 ok(
hr ==
S_OK,
"SetPalette failed, hr=%#x\n",
hr);
1328 hr = IWICBitmapEncoder_GetEncoderInfo(encoder, &
info);
1334 hr = IWICBitmapEncoderInfo_GetCLSID(
info, &
clsid);
1339 IWICBitmapEncoderInfo_Release(
info);
1347 hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frameencode, &
options);
1351 ok(
options !=
NULL,
"Encoder initialization has not created an property bag\n");
1363 memset(&propbag, 0,
sizeof(propbag));
1377 hr = IWICBitmapFrameEncode_SetPalette(frameencode,
palette);
1381 hr = IWICBitmapFrameEncode_Initialize(frameencode,
options);
1385 hr = IWICBitmapFrameEncode_SetPixelFormat(frameencode, &
pixelformat);
1392 hr = IWICBitmapFrameEncode_SetSize(frameencode, srcs[
i]->
width, srcs[
i]->
height);
1395 if (
IsEqualGUID(clsid_encoder, &CLSID_WICPngEncoder))
1402 hr = IWICBitmapFrameEncode_SetPalette(frameencode,
palette);
1406 memset(colors, 0,
sizeof(colors));
1407 hr = IWICPalette_InitializeCustom(
palette, colors, 256);
1408 ok(
hr ==
S_OK,
"InitializeCustom error %#x\n",
hr);
1428 "WriteSource(NULL) failed, hr=%x (%s)\n",
hr,
name);
1433 hr = IWICBitmapFrameEncode_Commit(frameencode);
1437 IWICBitmapFrameEncode_Release(frameencode);
1438 IPropertyBag2_Release(
options);
1446 if (clsid_decoder ==
NULL)
1449 IWICBitmapEncoder_Release(encoder);
1455 hr = IWICBitmapEncoder_Commit(encoder);
1465 &IID_IWICBitmapDecoder, (
void**)&decoder);
1473 hr = IWICImagingFactory_CreatePalette(
factory, &frame_palette);
1474 ok(
hr ==
S_OK,
"CreatePalette error %#x\n",
hr);
1476 hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette);
1477 if (
IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder))
1485 hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette);
1486 if (
IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder))
1495 hr = IWICBitmapDecoder_GetFrame(decoder,
i, &framedecode);
1500 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &
pixelformat);
1501 ok(
hr ==
S_OK,
"GetPixelFormat) failed, hr=%x (%s)\n",
hr,
name);
1505 hr = IWICBitmapFrameDecode_CopyPalette(framedecode, frame_palette);
1518 hr = IWICPalette_GetColorCount(frame_palette, &
count);
1519 ok(
hr ==
S_OK,
"GetColorCount error %#x\n",
hr);
1521 memset(colors, 0,
sizeof(colors));
1523 hr = IWICPalette_GetColors(frame_palette,
count, colors, &
ret);
1526 if (
IsEqualGUID(clsid_decoder, &CLSID_WICPngDecoder))
1533 "expected 256, got %u (%s)\n",
count,
name);
1535 ok(colors[0] == 0x11111111,
"got %08x (%s)\n", colors[0],
name);
1536 ok(colors[1] == 0x22222222,
"got %08x (%s)\n", colors[1],
name);
1539 ok(colors[2] == 0x33333333,
"got %08x (%s)\n", colors[2],
name);
1540 ok(colors[3] == 0x44444444,
"got %08x (%s)\n", colors[3],
name);
1543 ok(colors[4] == 0x55555555,
"got %08x (%s)\n", colors[4],
name);
1544 ok(colors[5] == 0,
"got %08x (%s)\n", colors[5],
name);
1548 else if (
IsEqualGUID(clsid_decoder, &CLSID_WICBmpDecoder) ||
1549 IsEqualGUID(clsid_decoder, &CLSID_WICTiffDecoder) ||
1557 ok(colors[0] == 0xff111111,
"got %08x (%s)\n", colors[0],
name);
1558 ok(colors[1] == 0xff222222,
"got %08x (%s)\n", colors[1],
name);
1559 ok(colors[2] == 0xff333333,
"got %08x (%s)\n", colors[2],
name);
1560 ok(colors[3] == 0xff444444,
"got %08x (%s)\n", colors[3],
name);
1561 ok(colors[4] == 0xff555555,
"got %08x (%s)\n", colors[4],
name);
1562 ok(colors[5] == 0xff000000,
"got %08x (%s)\n", colors[5],
name);
1568 ok(colors[0] == 0xff111111,
"got %08x (%s)\n", colors[0],
name);
1569 ok(colors[1] == 0xff222222,
"got %08x (%s)\n", colors[1],
name);
1570 ok(colors[2] == 0xff333333,
"got %08x (%s)\n", colors[2],
name);
1571 ok(colors[3] == 0xff444444,
"got %08x (%s)\n", colors[3],
name);
1572 ok(colors[4] == 0xff555555,
"got %08x (%s)\n", colors[4],
name);
1573 ok(colors[5] == 0xff000000,
"got %08x (%s)\n", colors[5],
name);
1579 ok(colors[0] == 0xff111111,
"got %08x (%s)\n", colors[0],
name);
1580 ok(colors[1] == 0xff222222,
"got %08x (%s)\n", colors[1],
name);
1587 ok(colors[0] == 0xff111111,
"got %08x\n", colors[0]);
1588 ok(colors[1] == 0xff222222,
"got %08x\n", colors[1]);
1592 IWICBitmapFrameDecode_Release(framedecode);
1598 IWICPalette_Release(frame_palette);
1599 IWICBitmapDecoder_Release(decoder);
1605 IWICBitmapEncoder_Release(encoder);
1619 ok(
hr ==
S_OK,
"CreatePalette error %#x\n",
hr);
1621 memset(colors, 0,
sizeof(colors));
1622 colors[0] = 0x11111111;
1623 colors[1] = 0x22222222;
1624 colors[2] = 0x33333333;
1625 colors[3] = 0x44444444;
1626 colors[4] = 0x55555555;
1628 hr = IWICPalette_InitializeCustom(
palette, colors, 256);
1629 ok(
hr ==
S_OK,
"InitializeCustom error %#x\n",
hr);
1663 test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc,
NULL,
"test_encoder_rects width=-1",
NULL);
1667 test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc,
NULL,
"test_encoder_rects height=0",
NULL);
1670 test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc,
NULL,
"test_encoder_rects height=-1",
NULL);
1699 ok(
hr ==
S_OK,
"CreatePalette error %#x\n",
hr);
1702 ok(
hr ==
S_OK,
"GetColorCount error %#x\n",
hr);
1706 hr = IWICImagingFactory_CreateFormatConverter(
factory, &converter);
1707 ok(
hr ==
S_OK,
"CreateFormatConverter error %#x\n",
hr);
1711 ok(
hr ==
S_OK,
"Initialize error %#x\n",
hr);
1712 hr = IWICFormatConverter_CopyPalette(converter,
palette);
1713 ok(
hr == 0xdeadbeef,
"unexpected error %#x\n",
hr);
1714 hr = IWICFormatConverter_CopyPixels(converter,
NULL, 32 * 3,
sizeof(
buf),
buf);
1715 ok(
hr ==
S_OK,
"CopyPixels error %#x\n",
hr);
1716 IWICFormatConverter_Release(converter);
1719 hr = IWICImagingFactory_CreateFormatConverter(
factory, &converter);
1720 ok(
hr ==
S_OK,
"CreateFormatConverter error %#x\n",
hr);
1725 hr = IWICFormatConverter_CopyPalette(converter,
palette);
1727 hr = IWICFormatConverter_CopyPixels(converter,
NULL, 32,
sizeof(
buf),
buf);
1729 IWICFormatConverter_Release(converter);
1732 hr = IWICImagingFactory_CreateFormatConverter(
factory, &converter);
1733 ok(
hr ==
S_OK,
"CreateFormatConverter error %#x\n",
hr);
1737 ok(
hr ==
S_OK,
"Initialize error %#x\n",
hr);
1738 hr = IWICFormatConverter_CopyPalette(converter,
palette);
1739 ok(
hr ==
S_OK,
"CopyPalette error %#x\n",
hr);
1742 ok(
hr ==
S_OK,
"GetColorCount error %#x\n",
hr);
1745 hr = IWICFormatConverter_CopyPixels(converter,
NULL, 32,
sizeof(
buf),
buf);
1746 ok(
hr ==
S_OK,
"CopyPixels error %#x\n",
hr);
1748 for (
i = 0;
i < 32 * 2;
i++)
1750 ok(
count == 0,
"expected 0\n");
1751 IWICFormatConverter_Release(converter);
1754 hr = IWICImagingFactory_CreateFormatConverter(
factory, &converter);
1755 ok(
hr ==
S_OK,
"CreateFormatConverter error %#x\n",
hr);
1759 ok(
hr ==
S_OK,
"Initialize error %#x\n",
hr);
1760 hr = IWICFormatConverter_CopyPalette(converter,
palette);
1761 ok(
hr ==
S_OK,
"CopyPalette error %#x\n",
hr);
1764 ok(
hr ==
S_OK,
"GetColorCount error %#x\n",
hr);
1766 hr = IWICFormatConverter_CopyPixels(converter,
NULL, 32,
sizeof(
buf),
buf);
1767 ok(
hr ==
S_OK,
"CopyPixels error %#x\n",
hr);
1769 for (
i = 0;
i < 32 * 2;
i++)
1771 ok(
count != 0,
"expected != 0\n");
1772 IWICFormatConverter_Release(converter);
1775 hr = IWICImagingFactory_CreateFormatConverter(
factory, &converter);
1776 ok(
hr ==
S_OK,
"CreateFormatConverter error %#x\n",
hr);
1780 ok(
hr ==
S_OK,
"Initialize error %#x\n",
hr);
1781 hr = IWICFormatConverter_CopyPalette(converter,
palette);
1782 ok(
hr ==
S_OK,
"CopyPalette error %#x\n",
hr);
1785 ok(
hr ==
S_OK,
"GetColorCount error %#x\n",
hr);
1787 hr = IWICFormatConverter_CopyPixels(converter,
NULL, 32,
sizeof(
buf),
buf);
1788 ok(
hr ==
S_OK,
"CopyPixels error %#x\n",
hr);
1790 for (
i = 0;
i < 32 * 2;
i++)
1792 ok(
count != 0,
"expected != 0\n");
1793 IWICFormatConverter_Release(converter);
1796 hr = IWICImagingFactory_CreateFormatConverter(
factory, &converter);
1797 ok(
hr ==
S_OK,
"CreateFormatConverter error %#x\n",
hr);
1801 ok(
hr ==
S_OK,
"Initialize error %#x\n",
hr);
1802 hr = IWICFormatConverter_CopyPalette(converter,
palette);
1803 ok(
hr ==
S_OK,
"CopyPalette error %#x\n",
hr);
1806 ok(
hr ==
S_OK,
"GetColorCount error %#x\n",
hr);
1808 hr = IWICFormatConverter_CopyPixels(converter,
NULL, 32,
sizeof(
buf),
buf);
1809 ok(
hr ==
S_OK,
"CopyPixels error %#x\n",
hr);
1811 for (
i = 0;
i < 32 * 2;
i++)
1813 ok(
count != 0,
"expected != 0\n");
1814 IWICFormatConverter_Release(converter);
1817 hr = IWICImagingFactory_CreateFormatConverter(
factory, &converter);
1818 ok(
hr ==
S_OK,
"CreateFormatConverter error %#x\n",
hr);
1825 hr = IWICFormatConverter_CopyPalette(converter,
palette);
1826 ok(
hr ==
S_OK,
"CopyPalette error %#x\n",
hr);
1829 ok(
hr ==
S_OK,
"GetColorCount error %#x\n",
hr);
1831 hr = IWICFormatConverter_CopyPixels(converter,
NULL, 32,
sizeof(
buf),
buf);
1832 ok(
hr ==
S_OK,
"CopyPixels error %#x\n",
hr);
1834 for (
i = 0;
i < 32 * 2;
i++)
1836 ok(
count != 0,
"expected != 0\n");
1838 IWICFormatConverter_Release(converter);
1851 &IID_IWICImagingFactory, (
void **)&
factory);
1852 ok(
hr ==
S_OK,
"failed to create factory: %#x\n",
hr);
1957 IWICImagingFactory_Release(
factory);
struct mke2fs_defaults settings[]
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define InterlockedIncrement
#define InterlockedDecrement
#define STDMETHODCALLTYPE
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
#define HeapFree(x, y, z)
static const WCHAR version[]
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLboolean GLboolean GLboolean GLboolean a
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 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 * u
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 GLint GLint j
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
_Check_return_ __CRT_INLINE float __CRTDECL fabsf(_In_ float x)
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
#define memcpy(s1, s2, n)
#define expect(expected, got)
#define todo_wine_if(is_todo)
static const BYTE bits_8bpp_BW[]
static const struct bitmap_data testdata_8bppGray
static const struct property_opt_test_data testdata_jpeg_props[]
static const WCHAR wszImageQuality[]
static void test_set_frame_palette(IWICBitmapFrameEncode *frameencode)
static int find_property_index(const WCHAR *name, PROPBAG2 *all_props, int all_prop_cnt)
static void test_encoder_properties(const CLSID *clsid_encoder, IPropertyBag2 *options)
static HRESULT WINAPI BitmapTestSrc_GetResolution(IWICBitmapSource *iface, double *pDpiX, double *pDpiY)
static const struct setting png_interlace_settings[]
static const struct bitmap_data testdata_32bppRGBA
static const struct bitmap_data testdata_32bppPBGRA
static const struct bitmap_data testdata_32bppGrayFloat_xp
static const struct bitmap_data testdata_BlackWhite
static BOOL is_indexed_format(const GUID *format)
static HRESULT WINAPI BitmapTestSrc_CopyPixels(IWICBitmapSource *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
static const struct bitmap_data testdata_4bppIndexed
static const struct bitmap_data testdata_8bppIndexed_BW
static const BYTE bits_32bppPBGRA[]
static const struct bitmap_data testdata_24bppBGR_gray
static HRESULT WINAPI BitmapTestSrc_GetPixelFormat(IWICBitmapSource *iface, WICPixelFormatGUID *pPixelFormat)
static void CreateTestBitmap(const bitmap_data *data, BitmapTestSrc **This)
static const WCHAR wszInterlaceOption[]
static const struct bitmap_data testdata_32bppPRGBA
static BOOL compare_bits(const struct bitmap_data *expect, UINT buffersize, const BYTE *converted_bits)
static const BYTE bits_8bppGray_xp[]
static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID *clsid_encoder, const struct bitmap_data **dsts, const CLSID *clsid_decoder, WICRect *rc, const struct setting *settings, const char *name, IWICPalette *palette)
static const struct bitmap_data testdata_32bppBGR
static const BYTE bits_32bppBGR[]
static void check_gif_format(IStream *stream, const WICPixelFormatGUID *format)
static unsigned be_uint(unsigned val)
static HRESULT WINAPI BitmapTestSrc_CopyPalette(IWICBitmapSource *iface, IWICPalette *palette)
static const struct bitmap_data testdata_32bppGrayFloat
static const float bits_32bppGrayFloat[]
static void _expect_ref(IUnknown *obj, ULONG ref, int line)
static ULONG WINAPI BitmapTestSrc_AddRef(IWICBitmapSource *iface)
static const WCHAR wszChrominance[]
static const struct bitmap_data testdata_64bppRGBA
static const BYTE bits_4bpp[]
static const IWICBitmapSourceVtbl BitmapTestSrc_Vtbl
static void compare_bitmap_data(const struct bitmap_data *src, const struct bitmap_data *expect, IWICBitmapSource *source, const char *name)
static void test_default_converter(void)
static void test_encoder_rects(void)
static const struct bitmap_data testdata_8bppIndexed
static const struct property_opt_test_data testdata_bmp_props[]
static const BYTE bits_1bpp[]
static const BYTE bits_24bppBGR_gray[]
static const struct bitmap_data * single_frame[2]
static void DeleteTestBitmap(BitmapTestSrc *This)
static const struct bitmap_data testdata_8bppIndexed_4colors
static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WICPixelFormatGUID *format)
static IWICImagingFactory * factory
static const WCHAR wszBitmapTransform[]
static const WCHAR wszEnableV5Header32bppBGRA[]
static const struct bitmap_data * multiple_frames[3]
static HRESULT WINAPI BitmapTestSrc_GetSize(IWICBitmapSource *iface, UINT *puiWidth, UINT *puiHeight)
static void check_tiff_format(IStream *stream, const WICPixelFormatGUID *format)
HRESULT STDMETHODCALLTYPE IWICBitmapFrameEncode_WriteSource_Proxy(IWICBitmapFrameEncode *This, IWICBitmapSource *pIBitmapSource, WICRect *prc)
static const BYTE bits_8bpp[]
static const BYTE bits_8bpp_4colors[]
static const BYTE bits_32bppBGRA[]
static void test_conversion(const struct bitmap_data *src, const struct bitmap_data *dst, const char *name, BOOL todo)
static const BYTE bits_8bppGray[]
#define EXPECT_REF(obj, ref)
static const struct bitmap_data testdata_32bppBGRA80
static const BYTE bits_24bppRGB[]
static void check_png_format(IStream *stream, const WICPixelFormatGUID *format)
static void test_invalid_conversion(void)
static void test_specific_encoder_properties(IPropertyBag2 *options, const property_opt_test_data *data, PROPBAG2 *all_props, int all_prop_cnt)
static HRESULT WINAPI BitmapTestSrc_QueryInterface(IWICBitmapSource *iface, REFIID iid, void **ppv)
static BOOL near_equal(float a, float b)
static const struct bitmap_data testdata_24bppRGB
static ULONG WINAPI BitmapTestSrc_Release(IWICBitmapSource *iface)
static const struct bitmap_data testdata_2bppIndexed
static const float bits_32bppGrayFloat_xp[]
static const struct bitmap_data testdata_32bppBGRA
static BitmapTestSrc * impl_from_IWICBitmapSource(IWICBitmapSource *iface)
static const WCHAR wszCompressionQuality[]
static const struct property_opt_test_data testdata_png_props[]
static const struct bitmap_data testdata_32bppRGB
static const BYTE bits_64bppRGBA[]
static const BYTE bits_24bppBGR[]
static const struct bitmap_data testdata_1bppIndexed
static void test_encoder(const struct bitmap_data *src, const CLSID *clsid_encoder, const struct bitmap_data *dst, const CLSID *clsid_decoder, const char *name)
static const struct bitmap_data testdata_24bppBGR
static const struct bitmap_data testdata_32bppRGBA80
static void load_stream(IUnknown *reader, IStream *stream)
static const struct bitmap_data testdata_8bppGray_xp
static const WCHAR wszSuppressApp0[]
static void test_converter_8bppIndexed(void)
static const struct property_opt_test_data testdata_tiff_props[]
static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
static const WCHAR wszFilterOption[]
static const WCHAR wszLuminance[]
static const WCHAR wszJpegYCrCbSubsampling[]
static const WCHAR wszTiffCompressionMethod[]
static const BYTE bits_2bpp[]
@ COINIT_APARTMENTTHREADED
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
#define IsEqualCLSID(rclsid1, rclsid2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
const char * winetest_platform
IWICBitmapSource IWICBitmapSource_iface
const WICPixelFormatGUID * format
const struct bitmap_data * alt_data
BYTE background_color_index
#define CONTAINING_RECORD(address, type, field)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
@ WICBitmapEncoderNoCache
@ WICBitmapTransformRotate0
@ WICPngFilterUnspecified
@ WICTiffCompressionDontCare
@ WICBitmapDitherTypeNone
@ WICDecodeMetadataCacheOnDemand
@ WICBitmapPaletteTypeFixedHalftone256
@ WICBitmapPaletteTypeCustom
@ WICBitmapPaletteTypeFixedHalftone64
@ WICBitmapPaletteTypeFixedGray16
@ WICBitmapPaletteTypeMedianCut
@ WICJpegYCrCbSubsamplingDefault
@ WICPersistOptionBigEndian
@ WICPersistOptionLittleEndian
#define WINCODEC_ERR_COMPONENTNOTFOUND
#define WINCODEC_ERR_WRONGSTATE
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
#define WINCODEC_ERR_NOTINITIALIZED
#define WINCODEC_ERR_PALETTEUNAVAILABLE
#define WINCODEC_ERR_VALUEOUTOFRANGE
#define WINCODEC_ERR_FRAMEMISSING
#define WINCODEC_ERR_PROPERTYNOTFOUND