2 * Copyright 2012 Vincent Povirk for CodeWeavers
3 * Copyright 2012 Dmitry Timoshkov
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #include "wine/test.h"
30 static IWICImagingFactory *factory;
32 static void test_createbitmap(void)
37 IWICBitmapLock *lock, *lock2;
38 WICBitmapPaletteType palettetype;
41 const BYTE bitmap_data[27] = {
42 128,128,255, 128,128,128, 128,255,128,
43 128,128,128, 128,128,128, 255,255,255,
44 255,128,128, 255,255,255, 255,255,255};
45 BYTE returned_data[27] = {0};
46 BYTE *lock_buffer=NULL, *base_lock_buffer=NULL;
47 UINT lock_buffer_size=0;
48 UINT lock_buffer_stride=0;
49 WICPixelFormatGUID pixelformat = {0};
50 UINT width=0, height=0;
51 double dpix=10.0, dpiy=10.0;
52 int can_lock_null = 1;
54 hr = IWICImagingFactory_CreateBitmap(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
55 WICBitmapCacheOnLoad, &bitmap);
56 ok(hr == S_OK, "IWICImagingFactory_CreateBitmap failed hr=%x\n", hr);
61 hr = IWICImagingFactory_CreatePalette(factory, &palette);
62 ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr);
64 /* Palette is unavailable until explicitly set */
65 hr = IWICBitmap_CopyPalette(bitmap, palette);
66 ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "IWICBitmap_CopyPalette failed hr=%x\n", hr);
68 hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedGray256, FALSE);
69 ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%x\n", hr);
71 hr = IWICBitmap_SetPalette(bitmap, palette);
72 ok(hr == S_OK, "IWICBitmap_SetPalette failed hr=%x\n", hr);
74 hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedGray4, FALSE);
75 ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%x\n", hr);
77 hr = IWICBitmap_CopyPalette(bitmap, palette);
78 ok(hr == S_OK, "IWICBitmap_CopyPalette failed hr=%x\n", hr);
80 hr = IWICPalette_GetType(palette, &palettetype);
81 ok(hr == S_OK, "IWICPalette_GetType failed hr=%x\n", hr);
82 ok(palettetype == WICBitmapPaletteTypeFixedGray256,
83 "expected WICBitmapPaletteTypeFixedGray256, got %x\n", palettetype);
85 IWICPalette_Release(palette);
87 /* pixel data is initially zeroed */
88 hr = IWICBitmap_CopyPixels(bitmap, NULL, 9, 27, returned_data);
89 ok(hr == S_OK, "IWICBitmap_CopyPixels failed hr=%x\n", hr);
92 ok(returned_data[i] == 0, "returned_data[%i] == %i\n", i, returned_data[i]);
94 /* Invalid lock rects */
98 hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock);
99 ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%x\n", hr);
100 if (SUCCEEDED(hr)) IWICBitmapLock_Release(lock);
104 hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock);
105 ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%x\n", hr);
106 if (SUCCEEDED(hr)) IWICBitmapLock_Release(lock);
110 hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock);
111 ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%x\n", hr);
112 if (SUCCEEDED(hr)) IWICBitmapLock_Release(lock);
116 hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock);
117 ok(hr == E_INVALIDARG, "IWICBitmap_Lock failed hr=%x\n", hr);
118 if (SUCCEEDED(hr)) IWICBitmapLock_Release(lock);
121 hr = IWICBitmap_Lock(bitmap, NULL, WICBitmapLockRead, &lock);
122 ok(hr == S_OK || broken(hr == E_INVALIDARG) /* winxp */, "IWICBitmap_Lock failed hr=%x\n", hr);
126 /* entire bitmap is locked */
127 hr = IWICBitmapLock_GetSize(lock, &width, &height);
128 ok(hr == S_OK, "IWICBitmapLock_GetSize failed hr=%x\n", hr);
129 ok(width == 3, "got %d, expected 3\n", width);
130 ok(height == 3, "got %d, expected 3\n", height);
132 IWICBitmapLock_Release(lock);
137 /* lock with a valid rect */
139 hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock);
140 ok(hr == S_OK, "IWICBitmap_Lock failed hr=%x\n", hr);
143 hr = IWICBitmapLock_GetStride(lock, &lock_buffer_stride);
144 ok(hr == S_OK, "IWICBitmapLock_GetStride failed hr=%x\n", hr);
145 /* stride is divisible by 4 */
146 ok(lock_buffer_stride == 12, "got %i, expected 12\n", lock_buffer_stride);
148 hr = IWICBitmapLock_GetDataPointer(lock, &lock_buffer_size, &lock_buffer);
149 ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%x\n", hr);
150 /* buffer size does not include padding from the last row */
151 ok(lock_buffer_size == 33, "got %i, expected 33\n", lock_buffer_size);
152 ok(lock_buffer != NULL, "got NULL data pointer\n");
153 base_lock_buffer = lock_buffer;
155 hr = IWICBitmapLock_GetPixelFormat(lock, &pixelformat);
156 ok(hr == S_OK, "IWICBitmapLock_GetPixelFormat failed hr=%x\n", hr);
157 ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat24bppBGR), "unexpected pixel format\n");
159 hr = IWICBitmapLock_GetSize(lock, &width, &height);
160 ok(hr == S_OK, "IWICBitmapLock_GetSize failed hr=%x\n", hr);
161 ok(width == 3, "got %d, expected 3\n", width);
162 ok(height == 3, "got %d, expected 3\n", height);
164 /* We can have multiple simultaneous read locks */
165 hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock2);
166 ok(hr == S_OK, "IWICBitmap_Lock failed hr=%x\n", hr);
170 hr = IWICBitmapLock_GetDataPointer(lock2, &lock_buffer_size, &lock_buffer);
171 ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%x\n", hr);
172 ok(lock_buffer_size == 33, "got %i, expected 33\n", lock_buffer_size);
173 ok(lock_buffer == base_lock_buffer, "got %p, expected %p\n", lock_buffer, base_lock_buffer);
175 IWICBitmapLock_Release(lock2);
178 if (can_lock_null) /* this hangs on xp/vista */
180 /* But not a read and a write lock */
181 hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockWrite, &lock2);
182 ok(hr == WINCODEC_ERR_ALREADYLOCKED, "IWICBitmap_Lock failed hr=%x\n", hr);
185 /* But we don't need a write lock to write */
186 if (base_lock_buffer)
189 memcpy(base_lock_buffer + lock_buffer_stride*i, bitmap_data + i*9, 9);
192 IWICBitmapLock_Release(lock);
195 /* test that the data we wrote is returned by CopyPixels */
196 hr = IWICBitmap_CopyPixels(bitmap, NULL, 9, 27, returned_data);
197 ok(hr == S_OK, "IWICBitmap_CopyPixels failed hr=%x\n", hr);
200 ok(returned_data[i] == bitmap_data[i], "returned_data[%i] == %i\n", i, returned_data[i]);
202 /* try a valid partial rect, and write mode */
207 hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockWrite, &lock);
208 ok(hr == S_OK, "IWICBitmap_Lock failed hr=%x\n", hr);
212 if (can_lock_null) /* this hangs on xp/vista */
214 /* Can't lock again while locked for writing */
215 hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockWrite, &lock2);
216 ok(hr == WINCODEC_ERR_ALREADYLOCKED, "IWICBitmap_Lock failed hr=%x\n", hr);
218 hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockRead, &lock2);
219 ok(hr == WINCODEC_ERR_ALREADYLOCKED, "IWICBitmap_Lock failed hr=%x\n", hr);
222 hr = IWICBitmapLock_GetStride(lock, &lock_buffer_stride);
223 ok(hr == S_OK, "IWICBitmapLock_GetStride failed hr=%x\n", hr);
224 ok(lock_buffer_stride == 12, "got %i, expected 12\n", lock_buffer_stride);
226 hr = IWICBitmapLock_GetDataPointer(lock, &lock_buffer_size, &lock_buffer);
227 ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%x\n", hr);
228 ok(lock_buffer_size == 15, "got %i, expected 15\n", lock_buffer_size);
229 ok(lock_buffer == base_lock_buffer+6, "got %p, expected %p+6\n", lock_buffer, base_lock_buffer);
231 hr = IWICBitmapLock_GetPixelFormat(lock, &pixelformat);
232 ok(hr == S_OK, "IWICBitmapLock_GetPixelFormat failed hr=%x\n", hr);
233 ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat24bppBGR), "unexpected pixel format\n");
235 hr = IWICBitmapLock_GetSize(lock, &width, &height);
236 ok(hr == S_OK, "IWICBitmapLock_GetSize failed hr=%x\n", hr);
237 ok(width == 1, "got %d, expected 1\n", width);
238 ok(height == 2, "got %d, expected 2\n", height);
240 IWICBitmapLock_Release(lock);
243 hr = IWICBitmap_GetPixelFormat(bitmap, &pixelformat);
244 ok(hr == S_OK, "IWICBitmap_GetPixelFormat failed hr=%x\n", hr);
245 ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat24bppBGR), "unexpected pixel format\n");
247 hr = IWICBitmap_GetResolution(bitmap, &dpix, &dpiy);
248 ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr);
249 ok(dpix == 0.0, "got %f, expected 0.0\n", dpix);
250 ok(dpiy == 0.0, "got %f, expected 0.0\n", dpiy);
252 hr = IWICBitmap_SetResolution(bitmap, 12.0, 34.0);
253 ok(hr == S_OK, "IWICBitmap_SetResolution failed hr=%x\n", hr);
255 hr = IWICBitmap_GetResolution(bitmap, &dpix, &dpiy);
256 ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr);
257 ok(dpix == 12.0, "got %f, expected 12.0\n", dpix);
258 ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy);
260 hr = IWICBitmap_GetSize(bitmap, &width, &height);
261 ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%x\n", hr);
262 ok(width == 3, "got %d, expected 3\n", width);
263 ok(height == 3, "got %d, expected 3\n", height);
265 IWICBitmap_Release(bitmap);
268 static void test_createbitmapfromsource(void)
271 IWICBitmap *bitmap, *bitmap2;
272 IWICPalette *palette;
273 IWICBitmapLock *lock;
276 const BYTE bitmap_data[27] = {
277 128,128,255, 128,128,128, 128,255,128,
278 128,128,128, 128,128,128, 255,255,255,
279 255,128,128, 255,255,255, 255,255,255};
280 BYTE returned_data[27] = {0};
281 BYTE *lock_buffer=NULL;
282 UINT lock_buffer_stride=0;
283 UINT lock_buffer_size=0;
284 WICPixelFormatGUID pixelformat = {0};
285 UINT width=0, height=0;
286 double dpix=10.0, dpiy=10.0;
288 WICBitmapPaletteType palette_type;
290 hr = IWICImagingFactory_CreateBitmap(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
291 WICBitmapCacheOnLoad, &bitmap);
292 ok(hr == S_OK, "IWICImagingFactory_CreateBitmap failed hr=%x\n", hr);
297 hr = IWICImagingFactory_CreatePalette(factory, &palette);
298 ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr);
300 hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedGray256, FALSE);
301 ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%x\n", hr);
303 hr = IWICBitmap_SetPalette(bitmap, palette);
304 ok(hr == S_OK, "IWICBitmap_SetPalette failed hr=%x\n", hr);
306 IWICPalette_Release(palette);
311 hr = IWICBitmap_Lock(bitmap, &rc, WICBitmapLockWrite, &lock);
312 ok(hr == S_OK, "IWICBitmap_Lock failed hr=%x\n", hr);
315 hr = IWICBitmapLock_GetStride(lock, &lock_buffer_stride);
316 ok(hr == S_OK, "IWICBitmapLock_GetStride failed hr=%x\n", hr);
317 ok(lock_buffer_stride == 12, "got %i, expected 12\n", lock_buffer_stride);
319 hr = IWICBitmapLock_GetDataPointer(lock, &lock_buffer_size, &lock_buffer);
320 ok(hr == S_OK, "IWICBitmapLock_GetDataPointer failed hr=%x\n", hr);
321 ok(lock_buffer_size == 33, "got %i, expected 33\n", lock_buffer_size);
322 ok(lock_buffer != NULL, "got NULL data pointer\n");
325 memcpy(lock_buffer + lock_buffer_stride*i, bitmap_data + i*9, 9);
327 IWICBitmapLock_Release(lock);
330 hr = IWICBitmap_SetResolution(bitmap, 12.0, 34.0);
331 ok(hr == S_OK, "IWICBitmap_SetResolution failed hr=%x\n", hr);
333 hr = IWICImagingFactory_CreateBitmapFromSource(factory, (IWICBitmapSource*)bitmap,
334 WICBitmapCacheOnLoad, &bitmap2);
335 ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromSource failed hr=%x\n", hr);
337 IWICBitmap_Release(bitmap);
339 if (FAILED(hr)) return;
341 hr = IWICImagingFactory_CreatePalette(factory, &palette);
342 ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr);
344 /* palette isn't copied for non-indexed formats? */
345 hr = IWICBitmap_CopyPalette(bitmap2, palette);
346 ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "IWICBitmap_CopyPalette failed hr=%x\n", hr);
348 IWICPalette_Release(palette);
350 hr = IWICBitmap_CopyPixels(bitmap2, NULL, 9, 27, returned_data);
351 ok(hr == S_OK, "IWICBitmap_CopyPixels failed hr=%x\n", hr);
354 ok(returned_data[i] == bitmap_data[i], "returned_data[%i] == %i\n", i, returned_data[i]);
356 hr = IWICBitmap_GetPixelFormat(bitmap2, &pixelformat);
357 ok(hr == S_OK, "IWICBitmap_GetPixelFormat failed hr=%x\n", hr);
358 ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat24bppBGR), "unexpected pixel format\n");
360 hr = IWICBitmap_GetResolution(bitmap2, &dpix, &dpiy);
361 ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr);
362 ok(dpix == 12.0, "got %f, expected 12.0\n", dpix);
363 ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy);
365 hr = IWICBitmap_GetSize(bitmap2, &width, &height);
366 ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%x\n", hr);
367 ok(width == 3, "got %d, expected 3\n", width);
368 ok(height == 3, "got %d, expected 3\n", height);
370 IWICBitmap_Release(bitmap2);
372 /* Ensure palette is copied for indexed formats */
373 hr = IWICImagingFactory_CreateBitmap(factory, 3, 3, &GUID_WICPixelFormat4bppIndexed,
374 WICBitmapCacheOnLoad, &bitmap);
375 ok(hr == S_OK, "IWICImagingFactory_CreateBitmap failed hr=%x\n", hr);
377 hr = IWICImagingFactory_CreatePalette(factory, &palette);
378 ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr);
380 hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedGray256, FALSE);
381 ok(hr == S_OK, "IWICPalette_InitializePredefined failed hr=%x\n", hr);
383 hr = IWICBitmap_SetPalette(bitmap, palette);
384 ok(hr == S_OK, "IWICBitmap_SetPalette failed hr=%x\n", hr);
386 IWICPalette_Release(palette);
388 hr = IWICImagingFactory_CreateBitmapFromSource(factory, (IWICBitmapSource*)bitmap,
389 WICBitmapCacheOnLoad, &bitmap2);
390 ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromSource failed hr=%x\n", hr);
392 IWICBitmap_Release(bitmap);
394 hr = IWICImagingFactory_CreatePalette(factory, &palette);
395 ok(hr == S_OK, "IWICImagingFactory_CreatePalette failed hr=%x\n", hr);
397 hr = IWICBitmap_CopyPalette(bitmap2, palette);
398 ok(hr == S_OK, "IWICBitmap_CopyPalette failed hr=%x\n", hr);
400 hr = IWICPalette_GetColorCount(palette, &count);
401 ok(hr == S_OK, "IWICPalette_GetColorCount failed hr=%x\n", hr);
402 ok(count == 256, "unexpected count %d\n", count);
404 hr = IWICPalette_GetType(palette, &palette_type);
405 ok(hr == S_OK, "IWICPalette_GetType failed hr=%x\n", hr);
406 ok(palette_type == WICBitmapPaletteTypeFixedGray256, "unexpected palette type %d\n", palette_type);
408 IWICPalette_Release(palette);
410 hr = IWICBitmap_GetPixelFormat(bitmap2, &pixelformat);
411 ok(hr == S_OK, "IWICBitmap_GetPixelFormat failed hr=%x\n", hr);
412 ok(IsEqualGUID(&pixelformat, &GUID_WICPixelFormat4bppIndexed), "unexpected pixel format\n");
414 hr = IWICBitmap_GetSize(bitmap2, &width, &height);
415 ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%x\n", hr);
416 ok(width == 3, "got %d, expected 3\n", width);
417 ok(height == 3, "got %d, expected 3\n", height);
419 IWICBitmap_Release(bitmap2);
422 static void test_CreateBitmapFromMemory(void)
424 BYTE orig_data3x3[27] = {
425 128,128,255, 128,128,128, 128,255,128,
426 128,128,128, 128,128,128, 255,255,255,
427 255,128,128, 255,255,255, 255,255,255 };
430 128,128,255, 128,128,128, 128,255,128,
431 0,0,0, 0,128,128, 255,255,255,
432 255,128,128, 255,0,0, 0,0,0 };
436 UINT width, height, i;
438 memcpy(data3x3, orig_data3x3, sizeof(data3x3));
440 hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
441 0, 0, NULL, &bitmap);
442 ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
444 hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
445 0, sizeof(data3x3), data3x3, &bitmap);
446 ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
448 hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
449 6, sizeof(data3x3), data3x3, &bitmap);
450 ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr);
452 hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
453 12, sizeof(data3x3), data3x3, &bitmap);
454 ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "expected WINCODEC_ERR_INSUFFICIENTBUFFER, got %#x\n", hr);
456 hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
457 9, sizeof(data3x3) - 1, data3x3, &bitmap);
458 ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "expected WINCODEC_ERR_INSUFFICIENTBUFFER, got %#x\n", hr);
460 hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 3, &GUID_WICPixelFormat24bppBGR,
461 9, sizeof(data3x3), data3x3, &bitmap);
462 ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromMemory error %#x\n", hr);
464 hr = IWICBitmap_GetSize(bitmap, &width, &height);
465 ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr);
466 ok(width == 3, "expected 3, got %u\n", width);
467 ok(height == 3, "expected 3, got %u\n", height);
471 memset(data, 0, sizeof(data));
472 hr = IWICBitmap_CopyPixels(bitmap, NULL, 9, sizeof(data), data);
473 ok(hr == S_OK, "IWICBitmap_CopyPixels error %#x\n", hr);
474 for (i = 0; i < sizeof(data); i++)
475 ok(data[i] == orig_data3x3[i], "%u: expected %u, got %u\n", i, data[i], data3x3[i]);
477 IWICBitmap_Release(bitmap);
479 hr = IWICImagingFactory_CreateBitmapFromMemory(factory, 3, 2, &GUID_WICPixelFormat24bppBGR,
480 13, sizeof(orig_data3x3), orig_data3x3, &bitmap);
481 ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromMemory error %#x\n", hr);
483 hr = IWICBitmap_GetSize(bitmap, &width, &height);
484 ok(hr == S_OK, "IWICBitmap_GetSize error %#x\n", hr);
485 ok(width == 3, "expected 3, got %u\n", width);
486 ok(height == 2, "expected 2, got %u\n", height);
488 memset(data, 0, sizeof(data));
489 hr = IWICBitmap_CopyPixels(bitmap, NULL, 13, sizeof(data), data);
490 ok(hr == S_OK, "IWICBitmap_CopyPixels error %#x\n", hr);
491 for (i = 0; i < sizeof(data); i++)
493 ok(data[i] == data3x2[i], "%u: expected %u, got %u\n", i, data3x2[i], data[i]);
495 todo_wine ok(data[i] == data3x2[i], "%u: expected %u, got %u\n", i, data3x2[i], data[i]);
497 IWICBitmap_Release(bitmap);
505 CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
507 hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
508 &IID_IWICImagingFactory, (void**)&factory);
509 ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%x\n", hr);
512 test_createbitmapfromsource();
513 test_CreateBitmapFromMemory();
515 IWICImagingFactory_Release(factory);