27#include "wincodecsdk.h"
50 255,0,0, 255,255,0, 0,0,
51 255,0,255, 255,255,255, 0,0
69 BYTE imagedata[36] = {1};
70 const BYTE expected_imagedata[36] = {
71 255,0,255, 255,255,255,
77 &IID_IWICBitmapDecoder, (
void**)&
decoder);
82 ok(hbmpdata != 0,
"GlobalAlloc failed\n");
97 win_skip(
"BMP decoder failed to initialize\n");
99 IWICBitmapDecoder_Release(
decoder);
103 hr = IWICBitmapDecoder_GetContainerFormat(
decoder, &guidresult);
105 ok(
IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp),
"unexpected container format\n");
107 hr = IWICBitmapDecoder_GetMetadataQueryReader(
decoder, &queryreader);
110 hr = IWICBitmapDecoder_GetColorContexts(
decoder, 1, &colorcontext, &
count);
113 hr = IWICBitmapDecoder_GetThumbnail(
decoder, &thumbnail);
116 hr = IWICBitmapDecoder_GetPreview(
decoder, &thumbnail);
123 hr = IWICBitmapDecoder_GetFrame(
decoder, 1, &framedecode);
126 hr = IWICBitmapDecoder_GetFrame(
decoder, 0, &framedecode);
133 hr = IWICBitmapFrameDecode_GetSize(framedecode, &
width, &
height);
138 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
140 ok(dpiX == 96.0,
"expected dpiX=96.0, got %f\n", dpiX);
141 ok(dpiY == 96.0,
"expected dpiY=96.0, got %f\n", dpiY);
143 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
145 ok(
IsEqualGUID(&guidresult, &GUID_WICPixelFormat24bppBGR),
"unexpected pixel format\n");
147 hr = IWICBitmapFrameDecode_GetMetadataQueryReader(framedecode, &queryreader);
150 hr = IWICBitmapFrameDecode_GetColorContexts(framedecode, 1, &colorcontext, &
count);
153 hr = IWICBitmapFrameDecode_GetThumbnail(framedecode, &thumbnail);
157 &IID_IWICImagingFactory, (
void**)&
factory);
168 hr = IWICBitmapFrameDecode_CopyPalette(framedecode,
palette);
174 IWICImagingFactory_Release(
factory);
181 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 6,
sizeof(imagedata), imagedata);
188 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 6,
sizeof(imagedata), imagedata);
195 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 4,
sizeof(imagedata), imagedata);
202 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 4, 5, imagedata);
209 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 6,
sizeof(imagedata), imagedata);
211 ok(!
memcmp(imagedata, expected_imagedata,
sizeof(imagedata)),
"unexpected image data\n");
213 hr = IWICBitmapFrameDecode_CopyPixels(framedecode,
NULL, 6,
sizeof(imagedata), imagedata);
215 ok(!
memcmp(imagedata, expected_imagedata,
sizeof(imagedata)),
"unexpected image data\n");
217 IWICBitmapFrameDecode_Release(framedecode);
225 hr = IWICBitmapDecoder_QueryCapability(
decoder, bmpstream, &capability);
229 &IID_IWICBitmapDecoder, (
void**)&decoder2);
233 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
234 ok(
hr ==
S_OK,
"QueryCapability failed, hr=%lx\n",
hr);
236 "unexpected capabilities: %lx\n", capability);
243 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
246 IWICBitmapDecoder_Release(decoder2);
249 IStream_Release(bmpstream);
255 IWICBitmapDecoder_Release(
decoder);
290 BYTE imagedata[2] = {1};
291 const BYTE expected_imagedata[2] = {0x80,0xc0};
293 const WICColor expected_palettedata[2] = {0xff0000ff,0xff00ff00};
297 &IID_IWICBitmapDecoder, (
void**)&
decoder);
302 ok(hbmpdata != 0,
"GlobalAlloc failed\n");
314 ok(
hr ==
S_OK,
"Initialize failed, hr=%lx\n",
hr);
316 hr = IWICBitmapDecoder_GetContainerFormat(
decoder, &guidresult);
318 ok(
IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp),
"unexpected container format\n");
324 hr = IWICBitmapDecoder_GetFrame(
decoder, 0, &framedecode);
331 hr = IWICBitmapFrameDecode_GetSize(framedecode, &
width, &
height);
336 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
338 ok(dpiX == 96.0,
"expected dpiX=96.0, got %f\n", dpiX);
339 ok(dpiY == 96.0,
"expected dpiY=96.0, got %f\n", dpiY);
341 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
343 ok(
IsEqualGUID(&guidresult, &GUID_WICPixelFormat1bppIndexed),
"unexpected pixel format\n");
346 &IID_IWICImagingFactory, (
void**)&
factory);
357 hr = IWICBitmapFrameDecode_CopyPalette(framedecode,
palette);
367 ok(!
memcmp(palettedata, expected_palettedata,
sizeof(palettedata)),
"unexpected palette data\n");
372 IWICImagingFactory_Release(
factory);
379 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 1,
sizeof(imagedata), imagedata);
381 ok(!
memcmp(imagedata, expected_imagedata,
sizeof(imagedata)),
"unexpected image data\n");
383 IWICBitmapFrameDecode_Release(framedecode);
387 &IID_IWICBitmapDecoder, (
void**)&decoder2);
391 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
392 ok(
hr ==
S_OK,
"QueryCapability failed, hr=%lx\n",
hr);
394 "unexpected capabilities: %lx\n", capability);
395 IWICBitmapDecoder_Release(decoder2);
398 IStream_Release(bmpstream);
404 IWICBitmapDecoder_Release(
decoder);
448 BYTE imagedata[2] = {1};
449 const BYTE expected_imagedata[2] = {0x01,0x23};
451 const WICColor expected_palettedata[5] =
452 {0xff0000ff,0xff00ff00,0xffff0000,0xff800080,0xffffffff};
456 &IID_IWICBitmapDecoder, (
void**)&
decoder);
461 ok(hbmpdata != 0,
"GlobalAlloc failed\n");
473 ok(
hr ==
S_OK,
"Initialize failed, hr=%lx\n",
hr);
475 hr = IWICBitmapDecoder_GetContainerFormat(
decoder, &guidresult);
477 ok(
IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp),
"unexpected container format\n");
483 hr = IWICBitmapDecoder_GetFrame(
decoder, 0, &framedecode);
490 hr = IWICBitmapFrameDecode_GetSize(framedecode, &
width, &
height);
495 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
497 ok(
fabs(dpiX - 254.0) < 0.01,
"expected dpiX=96.0, got %f\n", dpiX);
498 ok(
fabs(dpiY - 508.0) < 0.01,
"expected dpiY=96.0, got %f\n", dpiY);
500 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
502 ok(
IsEqualGUID(&guidresult, &GUID_WICPixelFormat4bppIndexed),
"unexpected pixel format\n");
505 &IID_IWICImagingFactory, (
void**)&
factory);
516 hr = IWICBitmapFrameDecode_CopyPalette(framedecode,
palette);
526 ok(!
memcmp(palettedata, expected_palettedata,
sizeof(palettedata)),
"unexpected palette data\n");
531 IWICImagingFactory_Release(
factory);
538 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 1,
sizeof(imagedata), imagedata);
540 ok(!
memcmp(imagedata, expected_imagedata,
sizeof(imagedata)),
"unexpected image data\n");
542 IWICBitmapFrameDecode_Release(framedecode);
546 &IID_IWICBitmapDecoder, (
void**)&decoder2);
550 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
551 ok(
hr ==
S_OK,
"QueryCapability failed, hr=%lx\n",
hr);
553 "unexpected capabilities: %lx\n", capability);
554 IWICBitmapDecoder_Release(decoder2);
557 IStream_Release(bmpstream);
563 IWICBitmapDecoder_Release(
decoder);
603 4,15,0,4,11,9,9,0,0,0,4,14,0,4,3,10,10,7,0,0,4,13,0,4,3,10,10,7,0,0,4,12,0,4,0,1,1,11,0,0,0,4,16,2,16,2,4,4,0,0,0,4,2,16,2,16,4,5,0,0,0,4,16,2,16,2,4,6,0,0,0,4,2,16,2,16,4,8,0,1
618 DWORD imagedata[64] = {1};
619 const DWORD expected_imagedata[64] = {
620 0x0000ff,0xffffff,0x0000ff,0xffffff,0xff0000,0xff0000,0xff0000,0xff0000,
621 0xffffff,0x0000ff,0xffffff,0x0000ff,0xee0000,0xee0000,0xee0000,0xee0000,
622 0x0000ff,0xffffff,0x0000ff,0xffffff,0xdd0000,0xdd0000,0xdd0000,0xdd0000,
623 0xffffff,0x0000ff,0xffffff,0x0000ff,0xcc0000,0xcc0000,0xcc0000,0xcc0000,
624 0x00cc00,0x00cc00,0x00cc00,0x00cc00,0x000000,0x111111,0x111111,0x555555,
625 0x00dd00,0x00dd00,0x00dd00,0x00dd00,0x222222,0xff00ff,0xff00ff,0x333333,
626 0x00ee00,0x00ee00,0x00ee00,0x00ee00,0x222222,0xff00ff,0xff00ff,0x333333,
627 0x00ff00,0x00ff00,0x00ff00,0x00ff00,0x555555,0x444444,0x444444,0x000000};
629 const WICColor expected_palettedata[17] = {
630 0xff000000,0xff111111,0xff0000ff,0xff222222,0xffcc0000,0xffdd0000,
631 0xffee0000,0xff333333,0xffff0000,0xff444444,0xffff00ff,0xff555555,
632 0xff00cc00,0xff00dd00,0xff00ee00,0xff00ff00,0xffffffff};
636 &IID_IWICBitmapDecoder, (
void**)&
decoder);
641 ok(hbmpdata != 0,
"GlobalAlloc failed\n");
653 ok(
hr ==
S_OK,
"Initialize failed, hr=%lx\n",
hr);
655 hr = IWICBitmapDecoder_GetContainerFormat(
decoder, &guidresult);
657 ok(
IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp),
"unexpected container format\n");
663 hr = IWICBitmapDecoder_GetFrame(
decoder, 0, &framedecode);
670 hr = IWICBitmapFrameDecode_GetSize(framedecode, &
width, &
height);
675 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
677 ok(
fabs(dpiX - 72.0) < 0.01,
"expected dpiX=96.0, got %f\n", dpiX);
678 ok(
fabs(dpiY - 72.0) < 0.01,
"expected dpiY=96.0, got %f\n", dpiY);
680 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
682 ok(
IsEqualGUID(&guidresult, &GUID_WICPixelFormat32bppBGR),
"unexpected pixel format\n");
685 &IID_IWICImagingFactory, (
void**)&
factory);
696 hr = IWICBitmapFrameDecode_CopyPalette(framedecode,
palette);
706 ok(!
memcmp(palettedata, expected_palettedata,
sizeof(palettedata)),
"unexpected palette data\n");
711 IWICImagingFactory_Release(
factory);
718 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 32,
sizeof(imagedata), (
BYTE*)imagedata);
720 ok(!
memcmp(imagedata, expected_imagedata,
sizeof(imagedata)),
"unexpected image data\n");
722 IWICBitmapFrameDecode_Release(framedecode);
726 &IID_IWICBitmapDecoder, (
void**)&decoder2);
730 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
731 ok(
hr ==
S_OK,
"QueryCapability failed, hr=%lx\n",
hr);
733 "unexpected capabilities: %lx\n", capability);
734 IWICBitmapDecoder_Release(decoder2);
737 IStream_Release(bmpstream);
743 IWICBitmapDecoder_Release(
decoder);
772 0,8,68,68,0,0,0,0,0,8,68,68,3,48,0,0,0,8,68,68,3,48,0,0,0,8,68,68,0,0,0,0,0,8,81,81,34,34,0,0,0,8,21,21,34,34,0,0,0,8,81,81,34,34,0,0,0,8,21,21,34,34,0,1
787 DWORD imagedata[64] = {1};
788 const DWORD expected_imagedata[64] = {
789 0x0000ff,0xffffff,0x0000ff,0xffffff,0xff0000,0xff0000,0xff0000,0xff0000,
790 0xffffff,0x0000ff,0xffffff,0x0000ff,0xff0000,0xff0000,0xff0000,0xff0000,
791 0x0000ff,0xffffff,0x0000ff,0xffffff,0xff0000,0xff0000,0xff0000,0xff0000,
792 0xffffff,0x0000ff,0xffffff,0x0000ff,0xff0000,0xff0000,0xff0000,0xff0000,
793 0x00ff00,0x00ff00,0x00ff00,0x00ff00,0x000000,0x000000,0x000000,0x000000,
794 0x00ff00,0x00ff00,0x00ff00,0x00ff00,0x000000,0xff00ff,0xff00ff,0x000000,
795 0x00ff00,0x00ff00,0x00ff00,0x00ff00,0x000000,0xff00ff,0xff00ff,0x000000,
796 0x00ff00,0x00ff00,0x00ff00,0x00ff00,0x000000,0x000000,0x000000,0x000000};
798 const WICColor expected_palettedata[6] = {
799 0xff000000,0xff0000ff,0xffff0000,0xffff00ff,0xff00ff00,0xffffffff};
803 &IID_IWICBitmapDecoder, (
void**)&
decoder);
808 ok(hbmpdata != 0,
"GlobalAlloc failed\n");
820 ok(
hr ==
S_OK,
"Initialize failed, hr=%lx\n",
hr);
822 hr = IWICBitmapDecoder_GetContainerFormat(
decoder, &guidresult);
824 ok(
IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp),
"unexpected container format\n");
830 hr = IWICBitmapDecoder_GetFrame(
decoder, 0, &framedecode);
837 hr = IWICBitmapFrameDecode_GetSize(framedecode, &
width, &
height);
842 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
844 ok(
fabs(dpiX - 72.0) < 0.01,
"expected dpiX=96.0, got %f\n", dpiX);
845 ok(
fabs(dpiY - 72.0) < 0.01,
"expected dpiY=96.0, got %f\n", dpiY);
847 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
849 ok(
IsEqualGUID(&guidresult, &GUID_WICPixelFormat32bppBGR),
"unexpected pixel format\n");
852 &IID_IWICImagingFactory, (
void**)&
factory);
863 hr = IWICBitmapFrameDecode_CopyPalette(framedecode,
palette);
873 ok(!
memcmp(palettedata, expected_palettedata,
sizeof(palettedata)),
"unexpected palette data\n");
878 IWICImagingFactory_Release(
factory);
885 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 32,
sizeof(imagedata), (
BYTE*)imagedata);
887 ok(!
memcmp(imagedata, expected_imagedata,
sizeof(imagedata)),
"unexpected image data\n");
889 IWICBitmapFrameDecode_Release(framedecode);
893 &IID_IWICBitmapDecoder, (
void**)&decoder2);
897 hr = IWICBitmapDecoder_QueryCapability(decoder2, bmpstream, &capability);
898 ok(
hr ==
S_OK,
"QueryCapability failed, hr=%lx\n",
hr);
900 "unexpected capabilities: %lx\n", capability);
901 IWICBitmapDecoder_Release(decoder2);
904 IStream_Release(bmpstream);
910 IWICBitmapDecoder_Release(
decoder);
920 sizeof(BITMAPV5HEADER),0,0,0,
936 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
937 0,0,0,0,0,0,0,0,0,0,0,0,
939 0,0,0,0,0,0,0,0,0,0,0,0,
941 0,255,0,0,255,0,255,0
955 DWORD imagedata[2] = {1};
956 const DWORD expected_imagedata[2] = { 0xff, 0xff00 };
960 &IID_IWICBitmapDecoder, (
void**)&
decoder);
965 ok(hbmpdata != 0,
"GlobalAlloc failed\n");
977 ok(
hr ==
S_OK,
"Initialize failed, hr=%lx\n",
hr);
979 hr = IWICBitmapDecoder_GetContainerFormat(
decoder, &guidresult);
981 ok(
IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp),
"unexpected container format\n");
987 hr = IWICBitmapDecoder_GetFrame(
decoder, 0, &framedecode);
994 hr = IWICBitmapFrameDecode_GetSize(framedecode, &
width, &
height);
999 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &dpiX, &dpiY);
1001 ok(
fabs(dpiX - 72.0) < 0.01,
"expected dpiX=72.0, got %f\n", dpiX);
1002 ok(
fabs(dpiY - 72.0) < 0.01,
"expected dpiY=72.0, got %f\n", dpiY);
1004 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &guidresult);
1006 ok(
IsEqualGUID(&guidresult, &GUID_WICPixelFormat32bppBGR),
"unexpected pixel format\n");
1009 &IID_IWICImagingFactory, (
void**)&
factory);
1020 hr = IWICBitmapFrameDecode_CopyPalette(framedecode,
palette);
1026 IWICImagingFactory_Release(
factory);
1033 hr = IWICBitmapFrameDecode_CopyPixels(framedecode, &rc, 32,
sizeof(imagedata), (
BYTE*)imagedata);
1035 ok(!
memcmp(imagedata, expected_imagedata,
sizeof(imagedata)),
"unexpected image data\n");
1037 IWICBitmapFrameDecode_Release(framedecode);
1040 IStream_Release(bmpstream);
1046 IWICBitmapDecoder_Release(
decoder);
1057 UINT pattern_count, pattern_size;
1066 &IID_IWICImagingFactory, (
void**)&
factory);
1070 hr = IWICImagingFactory_CreateComponentInfo(
factory, &CLSID_WICBmpDecoder, &
info);
1074 hr = IWICComponentInfo_GetComponentType(
info, &
type);
1078 hr = IWICComponentInfo_QueryInterface(
info, &IID_IWICBitmapDecoderInfo, (
void**)&decoderinfo);
1084 hr = IWICBitmapDecoderInfo_GetPatterns(decoderinfo, 0,
NULL, &pattern_count, &pattern_size);
1086 ok(pattern_count != 0,
"pattern count is 0\n");
1087 ok(pattern_size > pattern_count *
sizeof(
WICBitmapPattern),
"size=%i, count=%i\n", pattern_size, pattern_count);
1090 hr = IWICBitmapDecoderInfo_GetPatterns(decoderinfo, pattern_size, patterns, &pattern_count, &pattern_size);
1092 ok(pattern_count != 0,
"pattern count is 0\n");
1093 ok(pattern_size > pattern_count *
sizeof(
WICBitmapPattern),
"size=%i, count=%i\n", pattern_size, pattern_count);
1094 ok(patterns[0].
Length != 0,
"pattern length is 0\n");
1095 ok(patterns[0].Pattern !=
NULL,
"pattern is NULL\n");
1096 ok(patterns[0].
Mask !=
NULL,
"mask is NULL\n");
1099 hr = IWICBitmapDecoderInfo_GetPatterns(decoderinfo, pattern_size, patterns, &pattern_count, &pattern_size);
1104 hr = IWICBitmapDecoderInfo_CreateInstance(decoderinfo, &
decoder);
1108 hr = IWICBitmapDecoder_GetContainerFormat(
decoder, &guidresult);
1110 ok(
IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp),
"unexpected container format\n");
1112 IWICBitmapDecoder_Release(
decoder);
1116 ok(hbmpdata != 0,
"GlobalAlloc failed\n");
1128 hr = IWICBitmapDecoderInfo_MatchesPattern(decoderinfo, bmpstream, &boolresult);
1130 ok(boolresult,
"pattern not matched\n");
1132 IStream_Release(bmpstream);
1138 IWICBitmapDecoderInfo_Release(decoderinfo);
1141 IWICComponentInfo_Release(
info);
1144 IWICImagingFactory_Release(
factory);
1159 &IID_IWICImagingFactory, (
void**)&
factory);
1164 ok(hbmpdata != 0,
"GlobalAlloc failed\n");
1175 hr = IWICImagingFactory_CreateDecoderFromStream(
factory, bmpstream,
1180 hr = IWICBitmapDecoder_GetContainerFormat(
decoder, &guidresult);
1182 ok(
IsEqualGUID(&guidresult, &GUID_ContainerFormatBmp),
"unexpected container format\n");
1184 IWICBitmapDecoder_Release(
decoder);
1187 IStream_Release(bmpstream);
1193 IWICImagingFactory_Release(
factory);
1203 &IID_IWICImagingFactory, (
void **)&
factory);
1204 ok(
hr ==
S_OK,
"CoCreateInstance error %#lx\n",
hr);
1213 ok(
hr ==
S_OK,
"CreateDecoder error %#lx\n",
hr);
1214 IWICBitmapDecoder_Release(
decoder);
1216 hr = IWICImagingFactory_CreateDecoder(
factory, &GUID_ContainerFormatBmp, &GUID_VendorMicrosoft, &
decoder);
1217 ok(
hr ==
S_OK,
"CreateDecoder error %#lx\n",
hr);
1218 IWICBitmapDecoder_Release(
decoder);
1220 IWICImagingFactory_Release(
factory);
1227 WICColor encode_palette[2] = {0xff111111, 0xffcccccc};
1228 WICColor source_palette[2] = {0xff555555, 0xffaaaaaa};
1242 &IID_IWICImagingFactory, (
void **)&
factory);
1243 ok(
hr ==
S_OK,
"CoCreateInstance error %#lx\n",
hr);
1246 hr = IWICImagingFactory_CreateBitmap(
factory, 1, 1, &GUID_WICPixelFormat1bppIndexed,
1248 ok(
hr ==
S_OK,
"CreateBitmap error %#lx\n",
hr);
1251 ok(
hr ==
S_OK,
"CreatePalette error %#lx\n",
hr);
1254 ok(
hr ==
S_OK,
"CreateStream error %#lx\n",
hr);
1256 hr = IWICImagingFactory_CreateEncoder(
factory, &GUID_ContainerFormatBmp, &GUID_VendorMicrosoft, &
encoder);
1257 ok(
hr ==
S_OK,
"CreateDecoder error %#lx\n",
hr);
1260 ok(
hr ==
S_OK,
"IWICBitmapEncoder_Initialize error %#lx\n",
hr);
1262 hr = IWICBitmapEncoder_CreateNewFrame(
encoder, &frame_encode, &encode_options);
1263 ok(
hr ==
S_OK,
"CreateNewFrame error %#lx\n",
hr);
1265 hr = IWICBitmapFrameEncode_Initialize(frame_encode, encode_options);
1266 ok(
hr ==
S_OK,
"IWICBitmapFrameEncode_Initialize error %#lx\n",
hr);
1268 IPropertyBag2_Release(encode_options);
1270 hr = IWICBitmapFrameEncode_SetSize(frame_encode, 1, 1);
1274 hr = IWICBitmapFrameEncode_SetPixelFormat(frame_encode, &
pixelformat);
1275 ok(
hr ==
S_OK,
"SetPixelFormat error %#lx\n",
hr);
1278 hr = IWICPalette_InitializeCustom(
palette, encode_palette, 2);
1279 ok(
hr ==
S_OK,
"InitializeCustom error %#lx\n",
hr);
1281 hr = IWICBitmapFrameEncode_SetPalette(frame_encode,
palette);
1282 ok(
hr ==
S_OK,
"SetPalette error %#lx\n",
hr);
1284 hr = IWICPalette_InitializeCustom(
palette, source_palette, 2);
1285 ok(
hr ==
S_OK,
"InitializeCustom error %#lx\n",
hr);
1288 ok(
hr ==
S_OK,
"SetPalette error %#lx\n",
hr);
1291 ok(
hr ==
S_OK,
"WriteSource error %#lx\n",
hr);
1293 hr = IWICBitmapFrameEncode_Commit(frame_encode);
1296 IWICBitmapFrameEncode_Release(frame_encode);
1301 IWICBitmapEncoder_Release(
encoder);
1304 ok(
hr ==
S_OK,
"CreateDecoderFromStream error %#lx\n",
hr);
1306 hr = IWICBitmapDecoder_GetFrame(
decoder, 0, &frame_decode);
1309 hr = IWICBitmapFrameDecode_CopyPalette(frame_decode,
palette);
1310 ok(
hr ==
S_OK,
"CopyPalette error %#lx\n",
hr);
1312 hr = IWICPalette_GetColors(
palette, 2, result_palette, &result_colors);
1313 ok(
hr ==
S_OK,
"GetColors error %#lx\n",
hr);
1314 ok(result_colors == 2,
"Got %i colors\n", result_colors);
1315 ok(result_palette[0] == encode_palette[0],
"Unexpected palette entry: %x\n", result_palette[0]);
1316 ok(result_palette[1] == encode_palette[1],
"Unexpected palette entry: %x\n", result_palette[0]);
1318 IWICBitmapFrameDecode_Release(frame_decode);
1319 IWICBitmapDecoder_Release(
decoder);
1323 hr = IWICImagingFactory_CreateEncoder(
factory, &GUID_ContainerFormatBmp, &GUID_VendorMicrosoft, &
encoder);
1324 ok(
hr ==
S_OK,
"CreateDecoder error %#lx\n",
hr);
1327 ok(
hr ==
S_OK,
"CreateStream error %#lx\n",
hr);
1330 ok(
hr ==
S_OK,
"IWICBitmapEncoder_Initialize error %#lx\n",
hr);
1332 hr = IWICBitmapEncoder_CreateNewFrame(
encoder, &frame_encode, &encode_options);
1333 ok(
hr ==
S_OK,
"CreateNewFrame error %#lx\n",
hr);
1335 hr = IWICBitmapFrameEncode_Initialize(frame_encode, encode_options);
1336 ok(
hr ==
S_OK,
"IWICBitmapFrameEncode_Initialize error %#lx\n",
hr);
1338 IPropertyBag2_Release(encode_options);
1340 hr = IWICBitmapFrameEncode_SetSize(frame_encode, 1, 1);
1344 hr = IWICBitmapFrameEncode_SetPixelFormat(frame_encode, &
pixelformat);
1345 ok(
hr ==
S_OK,
"SetPixelFormat error %#lx\n",
hr);
1348 hr = IWICPalette_InitializeCustom(
palette, source_palette, 2);
1349 ok(
hr ==
S_OK,
"InitializeCustom error %#lx\n",
hr);
1352 ok(
hr ==
S_OK,
"SetPalette error %#lx\n",
hr);
1357 win_skip(
"old WriteSource palette behavior\n");
1358 IWICBitmapFrameEncode_Release(frame_encode);
1359 IWICBitmapEncoder_Release(
encoder);
1362 IWICBitmap_Release(
bitmap);
1363 IWICImagingFactory_Release(
factory);
1366 ok(
hr ==
S_OK,
"WriteSource error %#lx\n",
hr);
1368 hr = IWICBitmapFrameEncode_Commit(frame_encode);
1371 IWICBitmapFrameEncode_Release(frame_encode);
1376 IWICBitmapEncoder_Release(
encoder);
1379 ok(
hr ==
S_OK,
"CreateDecoderFromStream error %#lx\n",
hr);
1381 hr = IWICBitmapDecoder_GetFrame(
decoder, 0, &frame_decode);
1384 hr = IWICBitmapFrameDecode_CopyPalette(frame_decode,
palette);
1385 ok(
hr ==
S_OK,
"CopyPalette error %#lx\n",
hr);
1387 hr = IWICPalette_GetColors(
palette, 2, result_palette, &result_colors);
1388 ok(
hr ==
S_OK,
"GetColors error %#lx\n",
hr);
1389 ok(result_colors == 2,
"Got %i colors\n", result_colors);
1390 ok(result_palette[0] == source_palette[0],
"Unexpected palette entry: %x\n", result_palette[0]);
1391 ok(result_palette[1] == source_palette[1],
"Unexpected palette entry: %x\n", result_palette[0]);
1393 IWICBitmapFrameDecode_Release(frame_decode);
1394 IWICBitmapDecoder_Release(
decoder);
1398 IWICBitmap_Release(
bitmap);
1399 IWICImagingFactory_Release(
factory);
1412 {&GUID_WICPixelFormat24bppBGR,
TRUE,
"WICPixelFormat24bppBGR"},
1413 {&GUID_WICPixelFormatBlackWhite,
FALSE,
"WICPixelFormatBlackWhite"},
1414 {&GUID_WICPixelFormat1bppIndexed,
TRUE,
"WICPixelFormat1bppIndexed"},
1415 {&GUID_WICPixelFormat2bppIndexed,
FALSE,
"WICPixelFormat2bppIndexed"},
1416 {&GUID_WICPixelFormat4bppIndexed,
TRUE,
"WICPixelFormat4bppIndexed"},
1417 {&GUID_WICPixelFormat8bppIndexed,
TRUE,
"WICPixelFormat8bppIndexed"},
1418 {&GUID_WICPixelFormat16bppBGR555,
TRUE,
"WICPixelFormat16bppBGR555"},
1419 {&GUID_WICPixelFormat16bppBGR565,
TRUE,
"WICPixelFormat16bppBGR565"},
1420 {&GUID_WICPixelFormat32bppBGR,
TRUE,
"WICPixelFormat32bppBGR"},
1421 {&GUID_WICPixelFormat32bppBGRA,
TRUE,
"WICPixelFormat32bppBGRA"},
1422 {&GUID_WICPixelFormat8bppGray,
FALSE,
"WICPixelFormat8bppGray"},
1436 &IID_IWICImagingFactory, (
void **)&
factory);
1442 hr = IWICImagingFactory_CreateEncoder(
factory, &GUID_ContainerFormatBmp, &GUID_VendorMicrosoft, &
encoder);
1447 hr = IWICBitmapEncoder_CreateNewFrame(
encoder, &frame_encode,
NULL);
1449 hr = IWICBitmapFrameEncode_Initialize(frame_encode,
NULL);
1456 hr = IWICBitmapFrameEncode_SetPixelFormat(frame_encode, &
pixelformat);
1459 ok(supported ==
tests[
i].supported,
"got %d.\n", supported);
1463 IWICBitmapFrameEncode_Release(frame_encode);
1464 refcount = IWICBitmapEncoder_Release(
encoder);
1465 ok(!refcount,
"got %ld.\n", refcount);
1467 IWICImagingFactory_Release(
factory);
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define HeapFree(x, y, z)
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)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
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
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
#define memcpy(s1, s2, n)
static struct test_info tests[]
_In_ ULONG _In_ ULONG _In_ ULONG Length
@ COINIT_APARTMENTTHREADED
#define IsEqualGUID(rguid1, rguid2)
void __winetest_cdecl winetest_push_context(const char *fmt,...)
void winetest_pop_context(void)
@ WICBitmapEncoderNoCache
@ WICDecodeMetadataCacheOnDemand
@ WICDecodeMetadataCacheOnLoad
@ WICBitmapDecoderCapabilityCanDecodeAllImages
#define WINCODEC_ERR_WRONGSTATE
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
#define WINCODEC_ERR_BADIMAGE
#define WINCODEC_ERR_PALETTEUNAVAILABLE
#define WINCODEC_ERR_CODECNOTHUMBNAIL
#define WINCODEC_ERR_FRAMEMISSING
#define WINCODEC_ERR_INSUFFICIENTBUFFER
struct tagBITMAPFILEHEADER BITMAPFILEHEADER