39#define expect(expected, got) ok((got) == (expected), "Expected %d, got %d\n", (UINT)(expected), (UINT)(got))
40#define expectf(expected, got) ok(fabs((expected) - (got)) < 0.0001, "Expected %f, got %f\n", (expected), (got))
44 unsigned int diff =
x >
y ?
x -
y :
y -
x;
45 return diff <= max_diff;
113 const UINT max_len = 256;
114 const UINT output_len = (
len <= max_len) ?
len : max_len - 1;
118 for (
i = 0;
i < output_len;
i++)
121 if (
len > output_len)
124 return __wine_dbg_strdup(
buffer );
134 memset(&lockeddata, 0x55,
sizeof(lockeddata));
155 UINT n_codecs, info_size,
i;
167 for (
i = 0;
i < n_codecs;
i++)
201 ok_(__FILE__,
line)(
stat ==
Ok,
"Failed to create a Bitmap\n");
226 ok(
NULL != bm,
"Expected bitmap to be initialized\n");
233 ok( !bm,
"expected null bitmap\n" );
238 ok( !bm,
"expected null bitmap\n" );
243 ok( !bm,
"expected null bitmap\n" );
248 ok(
NULL != bm,
"Expected bitmap to be initialized\n");
255 ok( !bm,
"expected null bitmap\n" );
260 ok( bm == (
GpBitmap*)0xdeadbeef,
"expected deadbeef bitmap\n" );
265 ok(
NULL != bm,
"Expected bitmap to be initialized\n");
272 ok( !bm,
"expected null bitmap\n" );
286 memset(rbmi, 0,
sizeof(rbmi));
306 ok(
NULL != bm,
"Expected bitmap to be initialized\n");
319 ok(
NULL != bm,
"Expected bitmap to be initialized\n");
332 ok(
NULL != bm,
"Expected bitmap to be initialized\n");
345 ok(
NULL != bm,
"Expected bitmap to be initialized\n");
358 ok(
NULL != bm,
"Expected bitmap to be initialized\n");
371 ok(
NULL != bm,
"Expected bitmap to be initialized\n");
396 ok((
GpBitmap*)0xdeadbeef != bm,
"Expected bitmap to not be 0xdeadbeef\n");
397 ok(
NULL != bm,
"Expected bitmap to not be NULL\n");
423 GUID dimension = {0};
430 ok((
GpBitmap*)0xdeadbeef != bm,
"Expected bitmap to not be 0xdeadbeef\n");
431 ok(
NULL != bm,
"Expected bitmap to not be NULL\n");
501 ok(bm == (
GpBitmap *)0xdeadbeef,
"returned %p\n", bm);
506 ok(!bm,
"returned %p\n", bm);
610 static const CHAR filename1A[] =
"1.tif";
611 static const CHAR filename2A[] =
"2.tif";
612 static const WCHAR filename1[] =
L"1.tif";
616 params.Parameter[0].Guid = EncoderSaveFlag;
618 params.Parameter[0].NumberOfValues = 1;
619 params.Parameter[0].Value = ¶mValue;
626 ok(
result,
"getting TIFF encoding clsid failed");
628 if (!bm1 || !bm2 || !
result)
815 for (
i = 0;
i <
n;
i++)
830 ok(
FALSE,
"No BMP codec found.\n");
868 ((
char*)bd.
Scan0)[2] = 0xff;
953 ok(0xc3 != ((
BYTE*)bd.
Scan0)[2 + bd.
Stride * 5],
"original image bits are readable\n");
975 ok(0xc3 != ((
BYTE*)bd.
Scan0)[2 + bd.
Stride * 5],
"original image bits are readable\n");
993 ok(0xff != ((
BYTE*)bd.
Scan0)[2],
"original image bits are readable\n");
994 ok(0xc3 != ((
BYTE*)bd.
Scan0)[2 + bd.
Stride * 5],
"original image bits are readable\n");
1051 ((
char*)bd.
Scan0)[2] = 0xff;
1173 HPALETTE hpal =
NULL;
1181 const REAL WIDTH1 = 5;
1182 const REAL HEIGHT1 = 15;
1183 const REAL WIDTH2 = 10;
1184 const REAL HEIGHT2 = 20;
1229 ok(
hdc !=
NULL,
"CreateCompatibleDC failed\n");
1239 ok(
hbm !=
NULL,
"CreateDIBSection failed\n");
1264 for (
i = 0;
i < 8;
i++)
1266 LogPal->palPalEntry[
i].peRed =
i;
1267 LogPal->palPalEntry[
i].peGreen =
i;
1268 LogPal->palPalEntry[
i].peBlue =
i;
1269 LogPal->palPalEntry[
i].peFlags = 0;
1273 ok(hpal !=
NULL,
"CreatePalette failed\n");
1283 for (
i = 0;
i < 16;
i++)
1287 colors[
i].rgbBlue = clr;
1288 colors[
i].rgbGreen = clr;
1289 colors[
i].rgbRed = clr;
1290 colors[
i].rgbReserved = 0;
1297 ok(
hbm !=
NULL,
"CreateDIBSection failed\n");
1307 for (
i = 0;
i < 16;
i++)
1310 ARGB argb = 0xff000000 | (clr << 16) | (clr << 8) | clr;
1311 ok(
palette->Entries[
i] == argb,
"got %08lx, expected %08lx\n",
palette->Entries[
i], argb);
1325 for (
i = 0;
i < 16;
i++)
1328 ARGB argb = 0xff000000 | (clr << 16) | (clr << 8) | clr;
1329 ok(
palette->Entries[
i] == argb,
"got %08lx, expected %08lx\n",
palette->Entries[
i], argb);
1340 ok(
hbm !=
NULL,
"CreateDIBSection failed\n");
1365 bmi.
bf.masks[0] = 0x7c00;
1366 bmi.
bf.masks[1] = 0x3e0;
1367 bmi.
bf.masks[2] = 0x1f;
1370 ok(
hbm !=
NULL,
"CreateDIBSection failed\n");
1393 bmi.
bf.masks[0] = 0xf800;
1394 bmi.
bf.masks[1] = 0x7e0;
1395 bmi.
bf.masks[2] = 0x1f;
1398 ok(
hbm !=
NULL,
"CreateDIBSection failed\n");
1590 ok(
param != 0,
"Build number expected, got %lu\n",
param);
1595 BYTE bmp_bits[1024], bmp_bits_masked[1024];
1603 for (
i = 0;
i <
sizeof(bmp_bits); ++
i)
1604 bmp_bits[
i] = 111 *
i;
1614 ok(hbmMask != 0,
"CreateBitmap failed\n");
1616 ok(hbmColor != 0,
"CreateBitmap failed\n");
1618 info = iconinfo_base;
1619 info.hbmMask = hbmMask;
1620 info.hbmColor = hbmColor;
1622 ok(
hIcon != 0,
"CreateIconIndirect failed\n");
1627 "Expected Ok, got %.8x\n",
stat);
1639 info.hbmMask = hbmMask;
1640 info.hbmColor = hbmColor;
1642 ok(
hIcon != 0,
"CreateIconIndirect failed\n");
1651 info = iconinfo_base;
1652 info.hbmMask = hbmMask;
1654 ok(
hIcon != 0,
"CreateIconIndirect failed\n");
1665 ok(hbmMask != 0,
"CreateBitmap failed\n");
1667 ok(hbmColor != 0,
"CreateBitmap failed\n");
1669 info = iconinfo_base;
1670 info.hbmMask = hbmMask;
1671 info.hbmColor = hbmColor;
1673 ok(
hIcon != 0,
"CreateIconIndirect failed\n");
1688 ok(hbmMask != 0,
"CreateBitmap failed\n");
1690 ok(hbmColor != 0,
"CreateBitmap failed\n");
1691 info = iconinfo_base;
1692 info.hbmMask = hbmMask;
1693 info.hbmColor = hbmColor;
1695 ok(
hIcon != 0,
"CreateIconIndirect failed\n");
1699 for (
i = 0;
i <
sizeof(bmp_bits_masked)/
sizeof(
ARGB);
i++)
1701 BYTE mask = bmp_bits[
i / 8] & (1 << (7 - (
i % 8)));
1702 ((
ARGB *)bmp_bits_masked)[
i] =
mask ? 0 : ((
ARGB *)bmp_bits)[
i] | 0xff000000;
1717 ok(hbmMask != 0,
"CreateBitmap failed\n");
1719 ok(hbmColor != 0,
"CreateBitmap failed\n");
1720 info = iconinfo_base;
1721 info.hbmMask = hbmMask;
1722 info.hbmColor = hbmColor;
1724 ok(
hIcon != 0,
"CreateIconIndirect failed\n");
17410x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,
17420x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x08,0x02,0x00,0x00,0x00,0x90,0x77,0x53,
17430xde,0x00,0x00,0x00,0x09,0x70,0x48,0x59,0x73,0x00,0x00,0x0b,0x13,0x00,0x00,0x0b,
17440x13,0x01,0x00,0x9a,0x9c,0x18,0x00,0x00,0x00,0x07,0x74,0x49,0x4d,0x45,0x07,0xd5,
17450x06,0x03,0x0f,0x07,0x2d,0x12,0x10,0xf0,0xfd,0x00,0x00,0x00,0x0c,0x49,0x44,0x41,
17460x54,0x08,0xd7,0x63,0xf8,0xff,0xff,0x3f,0x00,0x05,0xfe,0x02,0xfe,0xdc,0xcc,0x59,
17470xe7,0x00,0x00,0x00,0x00,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82
17510x47,0x49,0x46,0x38,0x37,0x61,0x01,0x00,0x01,0x00,0x80,0x00,0x00,0xff,0xff,0xff,
17520xff,0xff,0xff,0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x02,0x02,0x44,
17570x47,0x49,0x46,0x38,0x39,0x61,0x01,0x00,0x01,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
17580x00,0x00,0x00,0x21,0xf9,0x04,0x01,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,
17590x01,0x00,0x01,0x00,0x00,0x02,0x02,0x44,0x01,0x00,0x3b
17630x42,0x4d,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,
17640x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,
17650x00,0x00,0x04,0x00,0x00,0x00,0x12,0x0b,0x00,0x00,0x12,0x0b,0x00,0x00,0x02,0x00,
17660x00,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0x00,0x00,
17710xff,0xd8,0xff,0xe0,0x00,0x10,0x4a,0x46,0x49,0x46,0x00,0x01,0x01,0x01,0x01,0x2c,
17720x01,0x2c,0x00,0x00,0xff,0xdb,0x00,0x43,0x00,0x05,0x03,0x04,0x04,0x04,0x03,0x05,
17730x04,0x04,0x04,0x05,0x05,0x05,0x06,0x07,0x0c,0x08,0x07,0x07,0x07,0x07,0x0f,0x0b,
17740x0b,0x09,0x0c,0x11,0x0f,0x12,0x12,0x11,0x0f,0x11,0x11,0x13,0x16,0x1c,0x17,0x13,
17750x14,0x1a,0x15,0x11,0x11,0x18,0x21,0x18,0x1a,0x1d,0x1d,0x1f,0x1f,0x1f,0x13,0x17,
17760x22,0x24,0x22,0x1e,0x24,0x1c,0x1e,0x1f,0x1e,0xff,0xdb,0x00,0x43,0x01,0x05,0x05,
17770x05,0x07,0x06,0x07,0x0e,0x08,0x08,0x0e,0x1e,0x14,0x11,0x14,0x1e,0x1e,0x1e,0x1e,
17780x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
17790x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
17800x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,0xff,0xc0,
17810x00,0x11,0x08,0x00,0x01,0x00,0x01,0x03,0x01,0x22,0x00,0x02,0x11,0x01,0x03,0x11,
17820x01,0xff,0xc4,0x00,0x15,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
17830x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xff,0xc4,0x00,0x14,0x10,0x01,0x00,0x00,
17840x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xc4,
17850x00,0x14,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
17860x00,0x00,0x00,0x00,0xff,0xc4,0x00,0x14,0x11,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
17870x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xda,0x00,0x0c,0x03,0x01,
17880x00,0x02,0x11,0x03,0x11,0x00,0x3f,0x00,0xb2,0xc0,0x07,0xff,0xd9
17920x49,0x49,0x2a,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0xfe,0x00,
17930x04,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x00,0x01,0x00,
17940x00,0x00,0x01,0x00,0x00,0x00,0x01,0x01,0x03,0x00,0x01,0x00,0x00,0x00,0x01,0x00,
17950x00,0x00,0x02,0x01,0x03,0x00,0x03,0x00,0x00,0x00,0xd2,0x00,0x00,0x00,0x03,0x01,
17960x03,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x01,0x03,0x00,0x01,0x00,
17970x00,0x00,0x02,0x00,0x00,0x00,0x0d,0x01,0x02,0x00,0x1b,0x00,0x00,0x00,0xd8,0x00,
17980x00,0x00,0x11,0x01,0x04,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x12,0x01,
17990x03,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x15,0x01,0x03,0x00,0x01,0x00,
18000x00,0x00,0x03,0x00,0x00,0x00,0x16,0x01,0x03,0x00,0x01,0x00,0x00,0x00,0x40,0x00,
18010x00,0x00,0x17,0x01,0x04,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x1a,0x01,
18020x05,0x00,0x01,0x00,0x00,0x00,0xf4,0x00,0x00,0x00,0x1b,0x01,0x05,0x00,0x01,0x00,
18030x00,0x00,0xfc,0x00,0x00,0x00,0x1c,0x01,0x03,0x00,0x01,0x00,0x00,0x00,0x01,0x00,
18040x00,0x00,0x28,0x01,0x03,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,
18050x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x2f,0x68,0x6f,0x6d,0x65,0x2f,0x6d,0x65,
18060x68,0x2f,0x44,0x65,0x73,0x6b,0x74,0x6f,0x70,0x2f,0x74,0x65,0x73,0x74,0x2e,0x74,
18070x69,0x66,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x48,
18120xd7,0xcd,0xc6,0x9a,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x01,0x40,0x01,0xa0,0x05,
18130x00,0x00,0x00,0x00,0xb1,0x52,0x01,0x00,0x09,0x00,0x00,0x03,0x4f,0x00,0x00,0x00,
18140x0f,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x0b,0x02,0x00,0x00,
18150x00,0x00,0x05,0x00,0x00,0x00,0x0c,0x02,0x40,0x01,0x40,0x01,0x04,0x00,0x00,0x00,
18160x02,0x01,0x01,0x00,0x04,0x00,0x00,0x00,0x04,0x01,0x0d,0x00,0x08,0x00,0x00,0x00,
18170xfa,0x02,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
18180x2d,0x01,0x00,0x00,0x07,0x00,0x00,0x00,0xfc,0x02,0x01,0x00,0x00,0x00,0x00,0x00,
18190x00,0x00,0x04,0x00,0x00,0x00,0x2d,0x01,0x01,0x00,0x07,0x00,0x00,0x00,0xfc,0x02,
18200x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x2d,0x01,0x02,0x00,
18210x07,0x00,0x00,0x00,0x1b,0x04,0x40,0x01,0x40,0x01,0x00,0x00,0x00,0x00,0x04,0x00,
18220x00,0x00,0xf0,0x01,0x00,0x00,0x04,0x00,0x00,0x00,0xf0,0x01,0x01,0x00,0x03,0x00,
1854 ok(
hres ==
S_OK,
"Failed to create a stream\n");
1858 ok(
stat ==
Ok,
"Failed to create a Bitmap\n");
1918 ok(hwmf != 0,
"SetMetaFileBitsEx failed\n");
1972 ok(hwmf != 0,
"SetMetaFileBitsEx failed\n");
1987 int screenxres, screenyres;
2013 screendc =
GetDC(0);
2119 ok(
val == 0xff686868,
"got %lx, expected 0xff686868\n",
val);
2166 ok(
val == 0x682a2a2a,
"got %lx, expected 0x682a2a2a\n",
val);
2168 ok(
val == 0x0,
"got %lx, expected 0x682a2a2a\n",
val);
2208 ok(
val == 0x68c12ac1 ||
broken(
val == 0x682a2ac1),
"got %lx, expected 0x68c12ac1\n",
val);
2210 ok(
val == 0xff00ff ||
broken(
val == 0xff),
"got %lx, expected 0xff00ff\n",
val);
2217 ok(pixel == 0xc12ac1 ||
broken(pixel == 0xc12a2a),
"got %lx, expected 0xc12ac1\n", pixel);
2219 ok(pixel == 0xff00ff ||
broken(pixel == 0xff0000),
"got %lx, expected 0xff00ff\n", pixel);
2221 ok(pixel == 0xb12ac1 ||
broken(pixel == 0xb12a2a),
"got %lx, expected 0xb12ac1\n", pixel);
2248 ok(
val == 0x68c12ac1 ||
broken(
val == 0x682a2ac1),
"got %lx, expected 0x68c12ac1\n",
val);
2250 ok(
val == 0xff00ff ||
broken(
val == 0xff),
"got %lx, expected 0xff00ff\n",
val);
2257 ok(pixel == 0xc12ac1 ||
broken(pixel == 0xc12a2a),
"got %lx, expected 0xc12ac1\n", pixel);
2259 ok(pixel == 0xff00ff ||
broken(pixel == 0xff0000),
"got %lx, expected 0xff00ff\n", pixel);
2261 ok(pixel == 0xb12ac1 ||
broken(pixel == 0xb12a2a),
"got %lx, expected 0xb12ac1\n", pixel);
2276 memset(&lockeddata, 0,
sizeof(lockeddata));
2373 BYTE bits[16] = {0x00,0x00,0x00,0x00, 0x00,0xff,0xff,0x00,
2374 0xff,0x00,0x00,0x00, 0xff,0xff,0xff,0x00};
2399 "Expected InvalidParameter, got %.8x\n",
stat);
2406 "Expected InvalidParameter, got %.8x\n",
stat);
2450 static const BYTE halftone_values[6]={0x00,0x33,0x66,0x99,0xcc,0xff};
2479 expected |= halftone_values[((
i-40)/6)%6] << 8;
2480 expected |= halftone_values[((
i-40)/36)%6] << 16;
2538 expect(0xff000000, entries[0]);
2539 expect(0xffffffff, entries[1]);
2624 entries[1] = 0xffcccccc;
2639 expect(0xffcccccc, entries[1]);
2649 entries[3] = 0xdeadbeef;
2659 expect(0xffcccccc, entries[1]);
2660 expect(0xdeadbeef, entries[3]);
2679 {1.0,0.0,0.0,0.0,0.0},
2680 {0.0,1.0,0.0,0.0,0.0},
2681 {0.0,0.0,1.0,0.0,0.0},
2682 {0.0,0.0,0.0,1.0,0.0},
2683 {0.0,0.0,0.0,0.0,1.0}}};
2685 {2.0,0.0,0.0,0.0,0.0},
2686 {0.0,1.0,0.0,0.0,0.0},
2687 {0.0,0.0,1.0,0.0,0.0},
2688 {0.0,0.0,0.0,1.0,0.0},
2689 {0.0,0.0,0.0,0.0,1.0}}};
2691 {0.0,1.0,0.0,0.0,0.0},
2692 {0.0,0.0,1.0,0.0,0.0},
2693 {0.0,0.0,0.0,1.0,0.0},
2694 {1.0,0.0,0.0,0.0,0.0},
2695 {0.0,0.0,0.0,0.0,1.0}}};
2735 TRUE, &colormatrix, &graymatrix, 3);
2751 colormatrix = double_red;
2768 stat =
GdipDrawImageRectRectI(graphics, (
GpImage*)bitmap1, 0,0,1,1, 0,0,1,1,
2776 colormatrix = asymmetric;
2784 stat =
GdipDrawImageRectRectI(graphics, (
GpImage*)bitmap1, 0,0,1,1, 0,0,1,1,
2796 stat =
GdipDrawImageRectRectI(graphics, (
GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1,
2807 stat =
GdipDrawImageRectRectI(graphics, (
GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1,
2821 stat =
GdipDrawImageRectRectI(graphics, (
GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1,
2829 stat =
GdipDrawImageRectRectI(graphics, (
GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1,
2845 stat =
GdipDrawImageRectRectI(graphics, (
GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1,
2856 stat =
GdipDrawImageRectRectI(graphics, (
GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1,
2872 stat =
GdipDrawImageRectRectI(graphics, (
GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1,
2888 stat =
GdipDrawImageRectRectI(graphics, (
GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1,
2899 stat =
GdipDrawImageRectRectI(graphics, (
GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1,
2913 stat =
GdipDrawImageRectRectI(graphics, (
GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1,
2924 stat =
GdipDrawImageRectRectI(graphics, (
GpImage *)bitmap1, 0, 0, 1, 1, 0, 0, 1, 1,
2986 stat =
GdipDrawImageRectRectI(graphics, (
GpImage*)bitmap1, 0,0,1,1, 0,0,1,1,
2997 stat =
GdipDrawImageRectRectI(graphics, (
GpImage*)bitmap1, 0,0,1,1, 0,0,1,1,
30130x47,0x49,0x46,0x38,0x39,0x61,0x01,0x00,0x01,0x00,0xa1,0x00,0x00,0x00,0x00,0x00,
30140xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0xf9,0x04,0x00,0x0a,0x00,0xff,
30150x00,0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x02,0x02,0x4c,0x01,0x00,
30160x21,0xf9,0x04,0x01,0x0a,0x00,0x01,0x00,0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
30170x00,0x00,0x02,0x02,0x44,0x01,0x00,0x3b
3030 0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x08, 0x00,
3031 0x02, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00,
3032 0x00, 0x00, 0x00, 0x21, 0xf9, 0x04, 0x01, 0x64,
3033 0x00, 0x00, 0x00, 0x21, 0xff, 0x0b, 0x4e, 0x45,
3034 0x54, 0x53, 0x43, 0x41, 0x50, 0x45, 0x32, 0x2e,
3035 0x30, 0x03, 0x01, 0x00, 0x00, 0x00, 0x2c, 0x00,
3036 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00,
3037 0x02, 0x04, 0x84, 0x8f, 0x09, 0x05, 0x00, 0x21,
3038 0xf9, 0x04, 0x04, 0x64, 0x00, 0x00, 0x00, 0x2c,
3039 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00,
3040 0x81, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff,
3041 0x00, 0x00, 0xff, 0x00, 0x00, 0x02, 0x03, 0x44,
3042 0x34, 0x05, 0x00, 0x21, 0xf9, 0x04, 0x08, 0x64,
3043 0x00, 0x00, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x00,
3044 0x02, 0x00, 0x02, 0x00, 0x81, 0x00, 0x00, 0xff,
3045 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00,
3046 0xff, 0x02, 0x03, 0x44, 0x34, 0x05, 0x00, 0x21,
3047 0xf9, 0x04, 0x0c, 0x64, 0x00, 0x00, 0x00, 0x2c,
3048 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00,
3049 0x81, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00,
3050 0x80, 0x00, 0x00, 0x80, 0x00, 0x02, 0x03, 0x44,
3051 0x34, 0x05, 0x00, 0x21, 0xf9, 0x04, 0x00, 0x64,
3052 0x00, 0x00, 0x00, 0x2c, 0x06, 0x00, 0x00, 0x00,
3053 0x02, 0x00, 0x02, 0x00, 0x80, 0x7e, 0x7e, 0x7e,
3054 0x00, 0x00, 0x00, 0x02, 0x02, 0x84, 0x51, 0x00,
3060 {0xffff0000, 0, 0, 0},
3061 {0xffff0000, 0xff0000ff, 0, 0},
3062 {0xffff0000, 0, 0xff008000, 0},
3063 {0xffff0000, 0, 0, 0xff7e7e7e}
3067 0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x08, 0x00,
3068 0x02, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00,
3069 0x00, 0x00, 0x00, 0x21, 0xf9, 0x04, 0x00, 0x64,
3070 0x00, 0x00, 0x00, 0x21, 0xff, 0x0b, 0x4e, 0x45,
3071 0x54, 0x53, 0x43, 0x41, 0x50, 0x45, 0x32, 0x2e,
3072 0x30, 0x03, 0x01, 0x00, 0x00, 0x00, 0x2c, 0x00,
3073 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00,
3074 0x02, 0x04, 0x84, 0x8f, 0x09, 0x05, 0x00, 0x21,
3075 0xf9, 0x04, 0x05, 0x64, 0x00, 0x10, 0x00, 0x2c,
3076 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00,
3077 0x81, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff,
3078 0x00, 0x00, 0xff, 0x00, 0x00, 0x02, 0x03, 0x44,
3079 0x34, 0x05, 0x00, 0x21, 0xf9, 0x04, 0x09, 0x64,
3080 0x00, 0x10, 0x00, 0x2c, 0x02, 0x00, 0x00, 0x00,
3081 0x02, 0x00, 0x02, 0x00, 0x81, 0x00, 0x00, 0xff,
3082 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00,
3083 0xff, 0x02, 0x03, 0x44, 0x34, 0x05, 0x00, 0x21,
3084 0xf9, 0x04, 0x0d, 0x64, 0x00, 0x10, 0x00, 0x2c,
3085 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00,
3086 0x81, 0x00, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00,
3087 0x80, 0x00, 0x00, 0x80, 0x00, 0x02, 0x03, 0x44,
3088 0x34, 0x05, 0x00, 0x21, 0xf9, 0x04, 0x01, 0x64,
3089 0x00, 0x10, 0x00, 0x2c, 0x06, 0x00, 0x00, 0x00,
3090 0x02, 0x00, 0x02, 0x00, 0x80, 0x7e, 0x7e, 0x7e,
3091 0x00, 0x00, 0x00, 0x02, 0x02, 0x84, 0x51, 0x00,
3096 {0xff000000, 0xff000000, 0xff000000, 0xff000000},
3097 {0xffff0000, 0xff000000, 0xff000000, 0xff000000},
3098 {0xffff0000, 0xff0000ff, 0xff000000, 0xff000000},
3099 {0xffff0000, 0xff000000, 0xff008000, 0xff000000},
3100 {0xffff0000, 0xff000000, 0xff000000, 0xff7e7e7e}
3116 char palette_buf[256];
3118 ARGB *palette_entries;
3127 ok(
hres ==
S_OK,
"Failed to create a stream\n");
3131 ok(
stat ==
Ok,
"Failed to create a Bitmap\n");
3228 ok(
hres ==
S_OK,
"Failed to create a stream\n");
3232 ok(
stat ==
Ok,
"Failed to create a Bitmap\n");
3266 ok(
hres ==
S_OK,
"Failed to create a stream\n");
3270 ok(
stat ==
Ok,
"Failed to create a Bitmap\n");
3285 memset(palette_buf, 0xfe,
sizeof(palette_buf));
3289 palette_entries =
palette->Entries;
3293 expect(0, palette_entries[0]);
3294 expect(0xff000000, palette_entries[1]);
3310 ok(
hres ==
S_OK,
"Failed to create a stream\n");
3313 ok(
stat ==
Ok,
"Failed to create a Bitmap\n");
3334 win_skip(
"broken animated gif support\n");
3339 for(
i=0;
i<6;
i++) {
3343 for(
j=0;
j<4;
j++) {
3358 ok(
hres ==
S_OK,
"Failed to create a stream\n");
3361 ok(
stat ==
Ok,
"Failed to create a Bitmap\n");
3364 for(
i=0;
i<6;
i++) {
3368 for(
j=0;
j<4;
j++) {
3383 static const BYTE orig_bits[24] = {
3384 0,0,0xff, 0,0xff,0, 0xff,0,0, 23,23,23,
3385 0xff,0xff,0, 0xff,0,0xff, 0,0xff,0xff, 23,23,23};
3509 map->oldColor.Argb = 0xff00ff00;
3510 map->newColor.Argb = 0xffff00ff;
3548 stat =
GdipDrawImageRectRectI(graphics, (
GpImage*)bitmap1, 0,0,1,1, 0,0,1,1,
3559 stat =
GdipDrawImageRectRectI(graphics, (
GpImage*)bitmap1, 0,0,1,1, 0,0,1,1,
3618 stat =
GdipDrawImageRectRectI(graphics, (
GpImage*)bitmap1, 0,0,2,2, 0,0,2,2,
3641 stat =
GdipDrawImageRectRectI(graphics, (
GpImage*)bitmap1, 0,0,2,2, 0,0,2,2,
3672 char invalid_image[256];
3689 memset(invalid_image, 0, 256);
3709 LONG refcount, old_refcount;
3717 ok(
hr ==
S_OK,
"CreateStreamOnHGlobal error %#lx\n",
hr);
3721 ok(refcount == 1,
"expected stream refcount 1, got %ld\n", refcount);
3727 "GdipLoadImageFromStream error %d\n",
status);
3729 ok(
status !=
Ok,
"GdipLoadImageFromStream should fail\n");
3741 ok(refcount > 1,
"expected stream refcount > 1, got %ld\n", refcount);
3743 ok(refcount == 1,
"expected stream refcount 1, got %ld\n", refcount);
3744 old_refcount = refcount;
3749 ok(refcount == old_refcount,
"expected stream refcount %ld, got %ld\n", old_refcount, refcount);
3753 ok(refcount == old_refcount,
"expected stream refcount %ld, got %ld\n", old_refcount, refcount);
3755 refcount = IStream_Release(
stream);
3757 ok(refcount >= 1,
"expected stream refcount != 0\n");
3759 ok(refcount == 0,
"expected stream refcount 0, got %ld\n", refcount);
3772#ifndef PropertyTagTypeSByte
3773#define PropertyTagTypeSByte 6
3774#define PropertyTagTypeSShort 8
3775#define PropertyTagTypeFloat 11
3776#define PropertyTagTypeDouble 12
3790 default:
return type;
3802 prop_count = 0xdeadbeef;
3805 ok(
count == prop_count ||
broken(count_broken != ~0 && count_broken == prop_count),
3806 "expected property count %u, got %u\n",
count, prop_count);
3807 if (count_broken != ~0 && count_broken == prop_count)
3810 prop_id =
malloc(prop_count *
sizeof(*prop_id));
3818 for (
i = 0;
i < prop_count;
i++)
3829 ok(
size >
sizeof(*prop_item),
"too small item length %u\n",
size);
3836 size -=
sizeof(*prop_item);
3839 ok(prop_item->
value == prop_item + 1,
"expected item->value %p, got %p\n",
3840 prop_item + 1, prop_item->
value);
3843 "expected type %lu, got %u\n", td[
i].
type, prop_item->
type);
3844 ok(td[
i].
id == prop_item->
id,
"expected id %#lx, got %#lx\n", td[
i].
id, prop_item->
id);
3847 "expected length %lu, got %lu\n", td[
i].
length, prop_item->
length);
3849 "expected length %lu, got %u\n", td[
i].
length,
size);
3870 UINT total_count, total_size,
i;
3872 const BYTE *item_data;
3874 total_size = 0xdeadbeef;
3875 total_count = 0xdeadbeef;
3878 ok(prop_size == total_size || prop_size == ~0,
3879 "expected total property size %u, got %u\n", prop_size, total_size);
3880 ok(
count == total_count ||
broken(count_broken != ~0 && count_broken == total_count),
3881 "expected total property count %u, got %u\n",
count, total_count);
3882 if (count_broken != ~0 && count_broken == total_count)
3885 prop_item =
malloc(total_size);
3889 item_data = (
const BYTE *)(prop_item + total_count);
3890 for (
i = 0;
i < total_count &&
i <
count;
i++)
3894 ok(prop_item[
i].
value == item_data,
3895 "expected value %p, got %p\n", item_data, prop_item[
i].
value);
3898 "expected type %lu, got %u\n", td[
i].
type, prop_item[
i].
type);
3899 ok(td[
i].
id == prop_item[
i].
id,
3900 "expected id %#lx, got %#lx\n", td[
i].
id, prop_item[
i].
id);
3902 "expected length %lu, got %lu\n", td[
i].
length, prop_item[
i].
length);
3910 item_data += prop_item[
i].
length;
3922 const BYTE *image_data;
3936 {
pngimage,
sizeof(
pngimage),
ImageTypeBitmap, 4, ~0, 1, 20, 0x5110, 0x132, 12 },
3937 {
jpgimage,
sizeof(
jpgimage),
ImageTypeBitmap, 2, ~0, 128, ~0, 0x5090, 0x5091, 12 },
3938 {
tiffimage,
sizeof(
tiffimage),
ImageTypeBitmap, 16, ~0, 4, ~0, 0xfe, ~0, 12 },
3939 {
bmpimage,
sizeof(
bmpimage),
ImageTypeBitmap, 0, ~0, 0, ~0, 0, ~0, 16 },
3940 {
gifimage,
sizeof(
gifimage),
ImageTypeBitmap, 1, 4, 4, ~0, 0x5100, ~0, 16 },
3946 UINT prop_count, prop_size,
i;
3947 PROPID prop_id[16] = { 0 };
3963 trace(
"failed to load image data\n");
3970 ok(td[
i].image_type == image_type,
"expected image_type %d, got %d\n",
3971 td[
i].image_type, image_type);
3991 ok(td[
i].prop_count == prop_count || (td[
i].prop_count2 != ~0 && td[
i].prop_count2 == prop_count),
3992 "expected property count %u or %u, got %u\n",
3993 td[
i].prop_count, td[
i].prop_count2, prop_count);
4035 else if (prop_count == 0)
4038 else if (td[
i].prop_count == prop_count || (td[
i].prop_count2 != ~0 && td[
i].prop_count2 == prop_count))
4040 ok(td[
i].prop_id == prop_id[0] || (td[
i].prop_id2 != ~0 && td[
i].prop_id2 == prop_id[0]),
4041 "expected property id %#x or %#x, got %#lx\n",
4042 td[
i].prop_id, td[
i].prop_id2, prop_id[0]);
4047 ok(prop_size >
sizeof(
PropertyItem),
"got too small prop_size %u\n",
4050 (td[
i].prop_size2 != ~0 && td[
i].prop_size2 +
sizeof(
PropertyItem) == prop_size),
4051 "expected property size (%u or %u)+%u, got %u\n",
4056 "expected InvalidParameter, got %d\n",
status);
4059 "expected InvalidParameter, got %d\n",
status);
4062 "expected InvalidParameter, got %d\n",
status);
4065 ok(prop_id[0] ==
item.data.id,
4066 "expected property id %#lx, got %#lx\n", prop_id[0],
item.data.id);
4085 prop_item =
malloc(prop_size);
4087 if (prop_count != 1)
4116#define IFD_RATIONAL 5
4118#define IFD_UNDEFINED 7
4121#define IFD_SRATIONAL 10
4123#define IFD_DOUBLE 12
4125#include "pshpack2.h"
4159#ifdef WORDS_BIGENDIAN
4181 { 0xf001,
IFD_BYTE, 1, 0x11223344 },
4182 { 0xf002,
IFD_BYTE, 4, 0x11223344 },
4194 { 0xf00f,
IFD_ASCII, 4,
'a' |
'b' << 8 |
'c' << 16 |
'd' << 24 },
4196 { 0xf011,
IFD_UNDEFINED, 4,
'a' |
'b' << 8 |
'c' << 16 |
'd' << 24 },
4208 1234567890.0987654321,
4209 { 0x1a2b3c4d, 0x5a6b7c8d },
4211 { 0x0101, 0x0202, 0x0303, 0x0404 },
4212 { 0x11223344, 0x55667788 },
4214 { { 0x01020304, 0x05060708 }, { 0x10203040, 0x50607080 }, { 0x11223344, 0x55667788 } },
4215 { 0x11, 0x22, 0x33, 0 }
4243 {
PropertyTagTypeDouble, 0xf008, 8, { 0x2c,0x52,0x86,0xb4,0x80,0x65,0xd2,0x41 } },
4244 {
PropertyTagTypeSRational, 0xf009, 8, { 0x4d, 0x3c, 0x2b, 0x1a, 0x8d, 0x7c, 0x6b, 0x5a } },
4246 {
PropertyTagTypeSShort, 0xf00b, 8, { 0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04 } },
4247 {
PropertyTagTypeSLONG, 0xf00c, 8, { 0x44,0x33,0x22,0x11,0x88,0x77,0x66,0x55 } },
4253 { 0x04,0x03,0x02,0x01,0x08,0x07,0x06,0x05,
4254 0x40,0x30,0x20,0x10,0x80,0x70,0x60,0x50,
4255 0x44,0x33,0x22,0x11,0x88,0x77,0x66,0x55 } },
4257 {
PropertyTagTypeFloat, 0xf017, 8, { 0x2b,0x52,0x9a,0x44,0xba,0xf5,0x08,0x46 } },
4262 UINT dim_count, frame_count;
4267 win_skip(
"Failed to load TIFF image data. Might not be supported. Skipping.\n");
4279 frame_count = 0xdeadbeef;
4307 {
PropertyTagTypeRational, 0x11a, 8, { 0,0,0,72,0,0,0,1 } },
4308 {
PropertyTagTypeRational, 0x11b, 8, { 0,0,0,72,0,0,0,1 } },
4315 UINT dim_count, frame_count, prop_size;
4318 ok(
image != 0,
"Failed to load TIFF image data\n");
4321 dim_count = 0xdeadbeef;
4330 frame_count = 0xdeadbeef;
4360 win_skip(
"Failed to load TIFF image data. Might not be supported. Skipping.\n");
4370 "GdipGetImagePaletteSize error %d\n",
status);
4384 ok(entries[0] == 0xff000000,
"expected 0xff000000, got %#lx\n", entries[0]);
4385 ok(entries[1] == 0xffffffff,
"expected 0xffffffff, got %#lx\n", entries[1]);
4394 static const BYTE pixels_24[48] =
4396 0xff,0xff,0xff, 0,0,0, 0xff,0xff,0xff, 0,0,0,
4397 0xff,0xff,0xff, 0,0,0, 0xff,0xff,0xff, 0,0,0,
4398 0xff,0xff,0xff, 0,0,0, 0xff,0xff,0xff, 0,0,0,
4399 0xff,0xff,0xff, 0,0,0, 0xff,0xff,0xff, 0,0,0
4401 static const BYTE pixels_00[48] =
4403 0,0,0, 0,0,0, 0,0,0, 0,0,0,
4404 0,0,0, 0,0,0, 0,0,0, 0,0,0,
4405 0,0,0, 0,0,0, 0,0,0, 0,0,0,
4406 0,0,0, 0,0,0, 0,0,0, 0,0,0
4408 static const BYTE pixels_24_77[64] =
4410 0xff,0xff,0xff, 0,0,0, 0xff,0xff,0xff, 0,0,0,
4411 0xff,0xff,0xff, 0,0,0, 0xff,0xff,0xff, 0,0,0,
4412 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4413 0xff,0xff,0xff, 0,0,0, 0xff,0xff,0xff, 0,0,0,
4414 0xff,0xff,0xff, 0,0,0, 0xff,0xff,0xff, 0,0,0,
4415 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77
4417 static const BYTE pixels_77[64] =
4419 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4420 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4421 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4422 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4423 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4424 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4425 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4426 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77
4428 static const BYTE pixels_8[16] =
4430 0x01,0,0x01,0,0x01,0,0x01,0,
4431 0x01,0,0x01,0,0x01,0,0x01,0
4433 static const BYTE pixels_8_77[64] =
4435 0x01,0,0x01,0,0x01,0,0x01,0,
4436 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4437 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4438 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4439 0x01,0,0x01,0,0x01,0,0x01,0,
4440 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4441 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4442 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77
4444 static const BYTE pixels_1_77[64] =
4446 0xaa,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4447 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4448 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4449 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4450 0xaa,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4451 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4452 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77,
4453 0x77,0x77,0x77,0x77,0x77,0x77,0x77,0x77
4455 static const BYTE pixels_1[8] = {0xaa,0,0,0,0xaa,0,0,0};
4463 const BYTE *pixels_unlocked;
4515 entries[0] = 0xff000000;
4516 entries[1] = 0xffffffff;
4534 ok(
data.Width == 8,
"%u: expected 8, got %d\n",
i,
data.Width);
4535 ok(
data.Height == 2,
"%u: expected 2, got %d\n",
i,
data.Height);
4536 ok(td[
i].
stride ==
data.Stride,
"%u: expected %d, got %d\n",
i, td[
i].stride,
data.Stride);
4537 ok(td[
i].
format ==
data.PixelFormat,
"%u: expected %d, got %d\n",
i, td[
i].format,
data.PixelFormat);
4540 ok(
data.Scan0 ==
buf,
"%u: got wrong buffer\n",
i);
4546 for (
j = 0;
j <
data.Height;
j++)
4557 "%u: data should match\n",
i);
4559 trace(
"%u: data mismatch for format %#x:%s\n",
i, td[
i].
format,
4563 ok(!
match,
"%u: data shouldn't match\n",
i);
4574 ok(
data.Width == 8,
"%u: expected 8, got %d\n",
i,
data.Width);
4575 ok(
data.Height == 2,
"%u: expected 2, got %d\n",
i,
data.Height);
4576 ok(
data.Stride == 24,
"%u: expected 24, got %d\n",
i,
data.Stride);
4578 ok(
data.Height *
data.Stride == 48,
"%u: expected 48, got %d\n",
i,
data.Height *
data.Stride);
4579 if (
data.Height *
data.Stride == 48)
4582 ok(
match,
"%u: data should match\n",
i);
4597 BYTE black_1x1[4] = { 0,0,0,0 };
4598 BYTE white_2x2[16] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4599 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff };
4600 BYTE black_2x2[16] = { 0,0,0,0,0,0,0xff,0xff,
4601 0,0,0,0,0,0,0xff,0xff };
4628 match =
memcmp(white_2x2, black_2x2,
sizeof(black_2x2)) == 0;
4629 ok(
match,
"data should match\n");
4643 DWORD dst_pixels[4] = { 0xffffffff, 0xffffffff,
4644 0xffffffff, 0xffffffff };
4645 DWORD src_pixels[4] = { 0, 0xffff0000,
4672 expect(0, dst_pixels[0]);
4673 expect(0xffff0000, dst_pixels[1]);
4674 expect(0, dst_pixels[2]);
4675 expect(0, dst_pixels[3]);
4687 BYTE black_1x1[4] = { 0,0,0,0 };
4688 BYTE white_2x2[16] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
4689 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff };
4690 BYTE black_2x2[16] = { 0,0,0,0,0,0,0xff,0xff,
4691 0,0,0,0,0,0,0xff,0xff };
4718 match =
memcmp(white_2x2, black_2x2,
sizeof(black_2x2)) == 0;
4719 ok(
match,
"data should match\n");
4754 "GdipCreateBitmapFromScan0 error %d\n",
status);
4782 "expected OutOfMemory, got %d\n",
status);
4790 "expected PixelFormat32bppPARGB, got %#x\n",
format);
4813 return ptr1 < ptr2 ? -1 : 1;
4815 for (
size_t i = 0;
i <
num;
i++)
4817 INT byte1 = ptr1[
i];
4818 INT byte2 = ptr2[
i];
4821 return byte1 < byte2 ? -1 : 1;
4829 static const BYTE back_8x1[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40,
4830 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4831 static const BYTE image_080[24] = { 0x40,0x40,0x40, 0x80,0x80,0x80, 0x40,0x40,0x40, 0x40,0x40,0x40,
4832 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4833 static const BYTE image_100[24] = { 0x40,0x40,0x40, 0x80,0x80,0x80, 0xcc,0xcc,0xcc, 0x40,0x40,0x40,
4834 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4835 static const BYTE image_120[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0xcc,0xcc,0xcc, 0x40,0x40,0x40,
4836 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4837 static const BYTE image_150[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x80,0x80,0x80, 0xcc,0xcc,0xcc,
4838 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4839 static const BYTE image_180[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x80,0x80,0x80, 0xcc,0xcc,0xcc,
4840 0xcc,0xcc,0xcc, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4841 static const BYTE image_200[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x80,0x80,0x80, 0xcc,0xcc,0xcc,
4842 0xcc,0xcc,0xcc, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4843 static const BYTE image_250[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x80,0x80,0x80,
4844 0xcc,0xcc,0xcc, 0xcc,0xcc,0xcc, 0xcc,0xcc,0xcc, 0x40,0x40,0x40 };
4845 static const BYTE image_120_half[24] = { 0x40,0x40,0x40, 0x80,0x80,0x80, 0xcc,0xcc,0xcc, 0xcc,0xcc,0xcc,
4846 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4847 static const BYTE image_150_half[24] = { 0x40,0x40,0x40, 0x80,0x80,0x80, 0x80,0x80,0x80, 0xcc,0xcc,0xcc,
4848 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4849 static const BYTE image_180_half[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x80,0x80,0x80, 0x80,0x80,0x80,
4850 0xcc,0xcc,0xcc, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4851 static const BYTE image_200_half[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x80,0x80,0x80, 0x80,0x80,0x80,
4852 0xcc,0xcc,0xcc, 0xcc,0xcc,0xcc, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4853 static const BYTE image_250_half[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x80,0x80,0x80, 0x80,0x80,0x80,
4854 0x80,0x80,0x80, 0xcc,0xcc,0xcc, 0xcc,0xcc,0xcc, 0x40,0x40,0x40 };
4856 static const BYTE image_bil_080[24] = { 0x40,0x40,0x40, 0x93,0x93,0x93, 0x86,0x86,0x86, 0x40,0x40,0x40,
4857 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4858 static const BYTE image_bil_120[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0xb2,0xb2,0xb2, 0x87,0x87,0x87,
4859 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4860 static const BYTE image_bil_150[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x99,0x99,0x99, 0xcc,0xcc,0xcc,
4861 0x6f,0x6f,0x6f, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4862 static const BYTE image_bil_180[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x88,0x88,0x88, 0xb2,0xb2,0xb2,
4863 0xad,0xad,0xad, 0x5f,0x5f,0x5f, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4864 static const BYTE image_bil_200[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x80,0x80,0x80, 0xa6,0xa6,0xa6,
4865 0xcc,0xcc,0xcc, 0x86,0x86,0x86, 0x40,0x40,0x40, 0x40,0x40,0x40 };
4866 static const BYTE image_bil_250[24] = { 0x40,0x40,0x40, 0x40,0x40,0x40, 0x40,0x40,0x40, 0x8f,0x8f,0x8f,
4867 0xad,0xad,0xad, 0xcc,0xcc,0xcc, 0x95,0x95,0x95, 0x5c,0x5c,0x5c };
4921 BYTE src_2x1[6] = { 0x80,0x80,0x80, 0xcc,0xcc,0xcc };
4959 memcpy(dst_8x1, back_8x1,
sizeof(dst_8x1));
4965 ok(
match,
"%d: data should match\n",
i);
4982'G',
'I',
'F',
'8',
'9',
'a',0x01,0x00,0x01,0x00,0xA1,0x02,0x00,
49830x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,
49850x21,0xFF,0x0B,
'N',
'E',
'T',
'S',
'C',
'A',
'P',
'E',
'2',
'.',
'0',
49860x03,0x01,0x05,0x00,0x00,
49870x21,0xFE,0x0C,
'H',
'e',
'l',
'l',
'o',
' ',
'W',
'o',
'r',
'l',
'd',
'!',0x00,
49880x21,0x01,0x0D,
'a',
'n',
'i',
'm',
'a',
't',
'i',
'o',
'n',
'.',
'g',
'i',
'f',0x00,
49890x21,0xF9,0x04,0xff,0x0A,0x00,0x08,0x00,
49900x2C,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x81,
49910xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,
49920x02,0x02,0x4C,0x01,0x00,
49930x21,0xFE,0x08,
'i',
'm',
'a',
'g',
'e',
' ',
'#',
'1',0x00,
49940x21,0x01,0x0C,
'p',
'l',
'a',
'i',
'n',
't',
'e',
'x',
't',
' ',
'#',
'1',0x00,
49950x21,0xF9,0x04,0x00,0x14,0x00,0x01,0x00,
49960x2C,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x81,
49970xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,
49980x02,0x02,0x44,0x01,0x00,
49990x21,0xFE,0x08,
'i',
'm',
'a',
'g',
'e',
' ',
'#',
'2',0x00,
50000x21,0x01,0x0C,
'p',
'l',
'a',
'i',
'n',
't',
'e',
'x',
't',
' ',
'#',
'2',0x00,0x3B
5004'G',
'I',
'F',
'8',
'7',
'a', 0x01,0x00, 0x01,0x00, 0xa1, 0x02, 0x00,
50050x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,
50060x21,0xF9,0x04, 0x00,0x0A,0x00,0x08, 0x00,
50070x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
50080x02,0x02,0x44,0x01,0x00,
50090x21,0xF9,0x04, 0x00,0x14,0x00,0x08, 0x00,
50100x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
50110x02,0x02,0x44,0x01,0x00, 0x3b
5015'G',
'I',
'F',
'8',
'7',
'a', 0x01,0x00, 0x01,0x00, 0x21, 0x02, 0x00,
50160x21,0xF9,0x04, 0x00,0x0A,0x00,0x08, 0x00,
50170x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
50180x02,0x02,0x44,0x01,0x00,
50190x21,0xF9,0x04, 0x00,0x14,0x00,0x08, 0x00,
50200x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
50210x02,0x02,0x44,0x01,0x00, 0x3b
5025'G',
'I',
'F',
'8',
'7',
'a', 0x01,0x00, 0x01,0x00, 0x21, 0x02, 0x00,
50260x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
50270x02,0x02,0x44,0x01,0x00,
50280x21,0xF9,0x04, 0x00,0x14,0x00,0x08, 0x00,
50290x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
50300x02,0x02,0x44,0x01,0x00, 0x3b
5034'G',
'I',
'F',
'8',
'7',
'a', 0x01,0x00, 0x01,0x00, 0x21, 0x02, 0x00,
50350x21,0xF9,0x04, 0x00,0x0A,0x00,0x08, 0x00,
50360x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
50370x02,0x02,0x44,0x01,0x00,
50380x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
50390x02,0x02,0x44,0x01,0x00, 0x3b
5043'G',
'I',
'F',
'8',
'7',
'a', 0x01,0x00, 0x01,0x00, 0x27, 0x02, 0x00,
50440x2c, 0x00,0x00, 0x00,0x00, 0x01,0x00, 0x01,0x00, 0x01,
50450x02,0x02,0x44,0x01,0x00, 0x3b
5052 {
PropertyTagTypeLong,
PropertyTagFrameDelay, 8, { 10,0,0,0,20,0,0,0 } },
5055 {
PropertyTagTypeByte,
PropertyTagGlobalPalette, 12, { 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c } },
5061 {
PropertyTagTypeLong,
PropertyTagFrameDelay, 8, { 10,0,0,0,20,0,0,0 } },
5063 {
PropertyTagTypeByte,
PropertyTagGlobalPalette, 12, { 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c } },
5068 {
PropertyTagTypeLong,
PropertyTagFrameDelay, 8, { 10,0,0,0,20,0,0,0 } },
5073 {
PropertyTagTypeLong,
PropertyTagFrameDelay, 8, { 0,0,0,0,20,0,0,0 } },
5078 {
PropertyTagTypeLong,
PropertyTagFrameDelay, 8, { 10,0,0,0,10,0,0,0 } },
5088 const BYTE *image_data;
5095#define giftest(img, prop, frames) { img, sizeof(img), prop, ARRAY_SIZE(prop), frames }
5108 UINT dim_count, frame_count, prop_size,
i;
5117 trace(
"Failed to load GIF image data\n");
5132 expect(td[
i].frame_count, frame_count);
5150 BYTE argb[8] = { 0x11,0x22,0x33,0x80, 0xff,0xff,0xff,0 };
5151 BYTE pargb[8] = { 0x09,0x11,0x1a,0x80, 0,0,0,0 };
5152 BYTE rgb32_xp[8] = { 0x11,0x22,0x33,0xff, 0xff,0xff,0xff,0xff };
5153 BYTE rgb24[6] = { 0x11,0x22,0x33, 0xff,0xff,0xff };
5165 ok(
data.Width == 2,
"expected 2, got %d\n",
data.Width);
5166 ok(
data.Height == 1,
"expected 1, got %d\n",
data.Height);
5167 ok(
data.Stride == 8,
"expected 8, got %d\n",
data.Stride);
5170 ok(
match,
"bits don't match\n");
5182 ok(
data.Width == 2,
"expected 2, got %d\n",
data.Width);
5183 ok(
data.Height == 1,
"expected 1, got %d\n",
data.Height);
5184 ok(
data.Stride == 8,
"expected 8, got %d\n",
data.Stride);
5187 !
memcmp(
data.Scan0, rgb32_xp,
sizeof(rgb32_xp));
5188 ok(
match,
"bits don't match\n");
5200 ok(
data.Width == 2,
"expected 2, got %d\n",
data.Width);
5201 ok(
data.Height == 1,
"expected 1, got %d\n",
data.Height);
5202 ok(
data.Stride == 8,
"expected 8, got %d\n",
data.Stride);
5205 ok(
match,
"bits don't match\n");
5220 BYTE pargb[8] = { 0x62,0x77,0x99,0x77, 0x62,0x77,0x99,0 };
5221 BYTE argb[8] = { 0xd1,0xfe,0xff,0x77, 0x62,0x77,0x99,0 };
5222 BYTE pargb2[8] = { 0x01,0x01,0x00,0x01, 0xfe,0x7f,0x7f,0xfe };
5234 ok(
data.Width == 2,
"expected 2, got %d\n",
data.Width);
5235 ok(
data.Height == 1,
"expected 1, got %d\n",
data.Height);
5236 ok(
data.Stride == 8,
"expected 8, got %d\n",
data.Stride);
5239 ok(
match,
"bits don't match\n");
5256 ok(
data.Width == 2,
"expected 2, got %d\n",
data.Width);
5257 ok(
data.Height == 1,
"expected 1, got %d\n",
data.Height);
5258 ok(
data.Stride == 8,
"expected 8, got %d\n",
data.Stride);
5261 ok(
match,
"bits don't match\n");
5278 static BYTE bmp_3x3_data_32bpp_argb[] = {
5279 0xff,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, 0x00,0x00,0xff,0xff,
5280 0xff,0xff,0x00,0xff, 0x00,0xff,0xff,0xff, 0xff,0x00,0xff,0xff,
5281 0xff,0xff,0xff,0xff, 0x80,0x80,0x80,0xff, 0x00,0x00,0x00,0xff
5283 static BYTE bmp_3x3_data_32bpp_rgb[] = {
5284 0xff,0x00,0x00,0x00, 0x00,0xff,0x00,0x00, 0x00,0x00,0xff,0x00,
5285 0xff,0xff,0x00,0x00, 0x00,0xff,0xff,0x00, 0xff,0x00,0xff,0x00,
5286 0xff,0xff,0xff,0x00, 0x80,0x80,0x80,0x00, 0x00,0x00,0x00,0x00
5288 static BYTE bmp_3x3_data_24bpp_rgb[] = {
5289 0xff,0x00,0x00, 0x00,0xff,0x00, 0x00,0x00,0xff,
5290 0xff,0xff,0x00, 0x00,0xff,0xff, 0xff,0x00,0xff,
5291 0xff,0xff,0xff, 0x80,0x80,0x80, 0x00,0x00,0x00
5295 BYTE *src_pixeldata;
5337 trace(
"Skipping test cases pre Win 7, because they fail.\n");
5363 color_orig = (color_orig >> 16 & 0xff) + (color_orig >> 8 & 0xff) + (color_orig & 0xff)
5364 > 0x17d ? 0xffffffff : 0xff000000;
5367 ok(
match ==
TRUE,
"Colors 0x%08lx and 0x%08lx do not match! (Conversion from %x to %x)\n",
5368 color_orig, color_copy, td[
i].src_format, td[
i].
dst_format);
5384 {
L"image/bmp", &ImageFormatBMP },
5385 {
L"image/jpeg", &ImageFormatJPEG },
5386 {
L"image/gif", &ImageFormatGIF },
5387 {
L"image/tiff", &ImageFormatTIFF },
5388 {
L"image/png", &ImageFormatPNG }
5411 ok(
hr ==
S_OK,
"CreateStreamOnHGlobal error %#lx\n",
hr);
5424 static const GUID noneffect = { 0xcd0c3d4b, 0xe15e, 0x4cf2, { 0x9e, 0xa8, 0x6e, 0x1d, 0x65, 0x48, 0xc5, 0xa5 } };
5437 const UINT parameters_number;
5440 { &BlurEffectGuid, 8 },
5441 { &BrightnessContrastEffectGuid, 8 },
5442 { &ColorBalanceEffectGuid, 12 },
5443 { &ColorCurveEffectGuid, 12 },
5444 { &ColorLUTEffectGuid, 1024 },
5445 { &ColorMatrixEffectGuid, 100 },
5446 { &HueSaturationLightnessEffectGuid, 12 },
5447 { &LevelsEffectGuid, 12 },
5450 { &RedEyeCorrectionEffectGuid, 16 },
5452 { &RedEyeCorrectionEffectGuid, 8 },
5454 { &SharpenEffectGuid, 8 },
5455 { &TintEffectGuid, 8 },
5460 pGdipGetEffectParameterSize = (
void*)
GetProcAddress(
mod,
"GdipGetEffectParameterSize");
5461 pGdipGetEffectParameters = (
void*)
GetProcAddress(
mod,
"GdipGetEffectParameters");
5462 if (!pGdipCreateEffect || !pGdipDeleteEffect || !pGdipGetEffectParameterSize || !pGdipGetEffectParameters)
5465 win_skip(
"GDIPlus version 1.1 not available\n");
5469 stat = pGdipCreateEffect(BlurEffectGuid,
NULL);
5472 stat = pGdipCreateEffect(noneffect, &effect);
5474 ok( !effect,
"expected null effect\n");
5477 stat = pGdipGetEffectParameterSize(
NULL, ¶m_size);
5483 stat = pGdipCreateEffect(*(td[
i].effect), &effect);
5488 stat = pGdipGetEffectParameterSize(effect, ¶m_size);
5490 expect(td[
i].parameters_number, param_size);
5491 stat = pGdipDeleteEffect(effect);
5513 TRUE, 1, &colormap);
5519 TRUE, 1, &colormap);
5529 palette->Entries[0] = 0xffffff00;
5530 palette->Entries[1] = 0xffffff80;
5531 palette->Entries[2] = 0xffffffff;
5539 palette->Entries[0] = 0xffffff00;
5540 palette->Entries[1] = 0xffffff80;
5541 palette->Entries[2] = 0xffffffff;
5567 UINT ch0[256], ch1[256], ch2[256], ch3[256];
5584 if (!pGdipBitmapGetHistogramSize)
5586 win_skip(
"GdipBitmapGetHistogramSize is not supported\n");
5593 stat = pGdipBitmapGetHistogramSize(0xff,
NULL);
5597 stat = pGdipBitmapGetHistogramSize(10, &
num);
5628 stat = pGdipBitmapGetHistogram(bm, 123, 256, ch0, ch1, ch2, ch3);
5631 stat = pGdipBitmapGetHistogram(bm, 123, 256, ch0, ch1, ch2,
NULL);
5634 stat = pGdipBitmapGetHistogram(bm, 123, 256, ch0, ch1,
NULL,
NULL);
5654 ok(ch0[0xff] ==
WIDTH,
"Got red (0xff) %u\n", ch0[0xff]);
5655 ok(ch1[0xff] ==
WIDTH,
"Got green (0xff) %u\n", ch1[0xff]);
5656 ok(ch2[0xff] ==
WIDTH,
"Got blue (0xff) %u\n", ch1[0xff]);
5657 ok(ch0[0x01] ==
WIDTH,
"Got red (0x01) %u\n", ch0[0x01]);
5658 ok(ch1[0x3f] ==
WIDTH,
"Got green (0x3f) %u\n", ch1[0x3f]);
5659 ok(ch2[0x20] ==
WIDTH,
"Got blue (0x20) %u\n", ch1[0x20]);
5668 ok(ch1[0xff] ==
WIDTH,
"Got red (0xff) %u\n", ch1[0xff]);
5669 ok(ch2[0xff] ==
WIDTH,
"Got green (0xff) %u\n", ch2[0xff]);
5670 ok(ch3[0xff] ==
WIDTH,
"Got blue (0xff) %u\n", ch3[0xff]);
5671 ok(ch1[0x01] ==
WIDTH,
"Got red (0x01) %u\n", ch1[0x01]);
5672 ok(ch2[0x3f] ==
WIDTH,
"Got green (0x3f) %u\n", ch2[0x3f]);
5673 ok(ch3[0x20] ==
WIDTH,
"Got blue (0x20) %u\n", ch3[0x20]);
5675 ok(ch0[0xff] ==
WIDTH *
HEIGHT,
"Got alpha (0xff) %u\n", ch0[0xff]);
5698 if (!pGdipImageSetAbort)
5700 win_skip(
"GdipImageSetAbort() is not supported.\n");
5719 0x89,
'P',
'N',
'G',0x0d,0x0a,0x1a,0x0a,
5720 0x00,0x00,0x00,0x0d,
'I',
'H',
'D',
'R',0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x08,0x02,0x00,0x00,0x00,0x90,0x77,0x53,0xde,
5721 0x00,0x00,0x03,0x00,
'P',
'L',
'T',
'E',
5722 0x01,0x01,0x01,0x02,0x02,0x02,0x03,0x03,0x03,0x04,0x04,0x04,0x05,0x05,0x05,0x06,0x06,0x06,0x07,0x07,0x07,0x08,0x08,0x08,
5723 0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x10,0x10,0x10,
5724 0x11,0x11,0x11,0x12,0x12,0x12,0x13,0x13,0x13,0x14,0x14,0x14,0x15,0x15,0x15,0x16,0x16,0x16,0x17,0x17,0x17,0x18,0x18,0x18,
5725 0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x20,0x20,0x20,
5726 0x21,0x21,0x21,0x22,0x22,0x22,0x23,0x23,0x23,0x24,0x24,0x24,0x25,0x25,0x25,0x26,0x26,0x26,0x27,0x27,0x27,0x28,0x28,0x28,
5727 0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x30,0x30,0x30,
5728 0x31,0x31,0x31,0x32,0x32,0x32,0x33,0x33,0x33,0x34,0x34,0x34,0x35,0x35,0x35,0x36,0x36,0x36,0x37,0x37,0x37,0x38,0x38,0x38,
5729 0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x40,0x40,0x40,
5730 0x41,0x41,0x41,0x42,0x42,0x42,0x43,0x43,0x43,0x44,0x44,0x44,0x45,0x45,0x45,0x46,0x46,0x46,0x47,0x47,0x47,0x48,0x48,0x48,
5731 0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x50,0x50,0x50,
5732 0x51,0x51,0x51,0x52,0x52,0x52,0x53,0x53,0x53,0x54,0x54,0x54,0x55,0x55,0x55,0x56,0x56,0x56,0x57,0x57,0x57,0x58,0x58,0x58,
5733 0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x60,0x60,0x60,
5734 0x61,0x61,0x61,0x62,0x62,0x62,0x63,0x63,0x63,0x64,0x64,0x64,0x65,0x65,0x65,0x66,0x66,0x66,0x67,0x67,0x67,0x68,0x68,0x68,
5735 0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x70,0x70,0x70,
5736 0x71,0x71,0x71,0x72,0x72,0x72,0x73,0x73,0x73,0x74,0x74,0x74,0x75,0x75,0x75,0x76,0x76,0x76,0x77,0x77,0x77,0x78,0x78,0x78,
5737 0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x80,
5738 0x01,0x01,0x01,0x02,0x02,0x02,0x03,0x03,0x03,0x04,0x04,0x04,0x05,0x05,0x05,0x06,0x06,0x06,0x07,0x07,0x07,0x08,0x08,0x08,
5739 0x09,0x09,0x09,0x0a,0x0a,0x0a,0x0b,0x0b,0x0b,0x0c,0x0c,0x0c,0x0d,0x0d,0x0d,0x0e,0x0e,0x0e,0x0f,0x0f,0x0f,0x10,0x10,0x10,
5740 0x11,0x11,0x11,0x12,0x12,0x12,0x13,0x13,0x13,0x14,0x14,0x14,0x15,0x15,0x15,0x16,0x16,0x16,0x17,0x17,0x17,0x18,0x18,0x18,
5741 0x19,0x19,0x19,0x1a,0x1a,0x1a,0x1b,0x1b,0x1b,0x1c,0x1c,0x1c,0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1f,0x1f,0x1f,0x20,0x20,0x20,
5742 0x21,0x21,0x21,0x22,0x22,0x22,0x23,0x23,0x23,0x24,0x24,0x24,0x25,0x25,0x25,0x26,0x26,0x26,0x27,0x27,0x27,0x28,0x28,0x28,
5743 0x29,0x29,0x29,0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2c,0x2c,0x2c,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,0x2f,0x2f,0x2f,0x30,0x30,0x30,
5744 0x31,0x31,0x31,0x32,0x32,0x32,0x33,0x33,0x33,0x34,0x34,0x34,0x35,0x35,0x35,0x36,0x36,0x36,0x37,0x37,0x37,0x38,0x38,0x38,
5745 0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3b,0x3b,0x3b,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3e,0x3e,0x3e,0x3f,0x3f,0x3f,0x40,0x40,0x40,
5746 0x41,0x41,0x41,0x42,0x42,0x42,0x43,0x43,0x43,0x44,0x44,0x44,0x45,0x45,0x45,0x46,0x46,0x46,0x47,0x47,0x47,0x48,0x48,0x48,
5747 0x49,0x49,0x49,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,0x4c,0x4c,0x4c,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,0x4f,0x4f,0x4f,0x50,0x50,0x50,
5748 0x51,0x51,0x51,0x52,0x52,0x52,0x53,0x53,0x53,0x54,0x54,0x54,0x55,0x55,0x55,0x56,0x56,0x56,0x57,0x57,0x57,0x58,0x58,0x58,
5749 0x59,0x59,0x59,0x5a,0x5a,0x5a,0x5b,0x5b,0x5b,0x5c,0x5c,0x5c,0x5d,0x5d,0x5d,0x5e,0x5e,0x5e,0x5f,0x5f,0x5f,0x60,0x60,0x60,
5750 0x61,0x61,0x61,0x62,0x62,0x62,0x63,0x63,0x63,0x64,0x64,0x64,0x65,0x65,0x65,0x66,0x66,0x66,0x67,0x67,0x67,0x68,0x68,0x68,
5751 0x69,0x69,0x69,0x6a,0x6a,0x6a,0x6b,0x6b,0x6b,0x6c,0x6c,0x6c,0x6d,0x6d,0x6d,0x6e,0x6e,0x6e,0x6f,0x6f,0x6f,0x70,0x70,0x70,
5752 0x71,0x71,0x71,0x72,0x72,0x72,0x73,0x73,0x73,0x74,0x74,0x74,0x75,0x75,0x75,0x76,0x76,0x76,0x77,0x77,0x77,0x78,0x78,0x78,
5753 0x79,0x79,0x79,0x7a,0x7a,0x7a,0x7b,0x7b,0x7b,0x7c,0x7c,0x7c,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x80,
5754 0x76,0xb6,0x24,0x31,
5755 0x00,0x00,0x00,0x02,
't',
'R',
'N',
'S',0xff,0x00,0xe5,0xb7,0x30,0x4a,
5756 0x00,0x00,0x00,0x0c,
'I',
'D',
'A',
'T',0x08,0xd7,0x63,0xf8,0xff,0xff,0x3f,0x00,0x05,0xfe,0x02,0xfe,0xdc,0xcc,0x59,0xe7,
5757 0x00,0x00,0x00,0x00,
'I',
'E',
'N',
'D',0xae,0x42,0x60,0x82
5760#define PNG_COLOR_TYPE_GRAY 0
5761#define PNG_COLOR_TYPE_RGB 2
5762#define PNG_COLOR_TYPE_PALETTE 3
5763#define PNG_COLOR_TYPE_GRAY_ALPHA 4
5764#define PNG_COLOR_TYPE_RGB_ALPHA 6
5770 char bit_depth, color_type;
5844 int i,
j, PLTE_off = 0, tRNS_off = 0;
5854 "flags = %#x\n",
flags);
5857 win_skip(
"broken PNG color space support\n");
5870 ok(PLTE_off && tRNS_off,
"PLTE offset %d, tRNS offset %d\n", PLTE_off, tRNS_off);
5871 if (!PLTE_off || !tRNS_off)
return;
5879 for (
j = 0;
j < 3;
j++)
5882 buf[24] = td[
i].bit_depth;
5883 buf[25] = td[
i].color_type;
5884 if (
j >=1)
memcpy(
buf + tRNS_off,
"tEST", 4);
5885 if (
j >=2)
memcpy(
buf + PLTE_off,
"tEST", 4);
5891 ok(
image !=
NULL,
"%d %d: failed to load image data\n",
i,
j);
5894 ok(
image ==
NULL,
"%d %d: succeed to load image data\n",
i,
j);
5898 if (!
image)
continue;
5918#undef PNG_COLOR_TYPE_GRAY
5919#undef PNG_COLOR_TYPE_RGB
5920#undef PNG_COLOR_TYPE_PALETTE
5921#undef PNG_COLOR_TYPE_GRAY_ALPHA
5922#undef PNG_COLOR_TYPE_RGB_ALPHA
5952 ok(
result,
"getting PNG encoding clsid failed");
5968 "Unexpected return value %d saving image for PixelFormat %#x\n",
status,
formats[
i]);
5982 ok(
ptr <
pos.QuadPart - 4,
"Expected palette not found for PixelFormat %#x\n",
formats[
i]);
5984 ok(
ptr >=
pos.QuadPart - 4,
"Unexpected palette found for PixelFormat %#x\n",
formats[
i]);
5994 0x89,
'P',
'N',
'G',0x0d,0x0a,0x1a,0x0a,
5995 0x00,0x00,0x00,0x0d,
'I',
'H',
'D',
'R',0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x08,0x02,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
5996 0x00,0x00,0x00,0x0c,
'I',
'D',
'A',
'T',0x08,0xd7,0x63,0xf8,0xff,0xff,0x3f,0x00,0x05,0xfe,0x02,0xfe,0xdc,0xcc,0x59,0xe7,
5997 0x00,0x00,0x00,0x00,
'I',
'E',
'N',
'D',0xae,0x42,0x60,0x82
6001 0x89,
'P',
'N',
'G',0x0d,0x0a,0x1a,0x0a,
6002 0x00,0x00,0x00,0x0d,
'I',
'H',
'D',
'R',0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x08,0x02,0x00,0x00,0x00,0x90,0x77,0x53,0xde,
6003 0x00,0x00,0x00,0x09,
'p',
'H',
'Y',
's',0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
6004 0x00,0x00,0x00,0x0c,
'I',
'D',
'A',
'T',0x08,0xd7,0x63,0xf8,0xff,0xff,0x3f,0x00,0x05,0xfe,0x02,0xfe,0xdc,0xcc,0x59,0xe7,
6005 0x00,0x00,0x00,0x00,
'I',
'E',
'N',
'D',0xae,0x42,0x60,0x82
6009 0x89,
'P',
'N',
'G',0x0d,0x0a,0x1a,0x0a,
6010 0x00,0x00,0x00,0x0d,
'I',
'H',
'D',
'R',0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x08,0x02,0x00,0x00,0x00,0x90,0x77,0x53,0xde,
6011 0x00,0x00,0x00,0x07,
't',
'I',
'M',
'E',0x07,0xb2,0x01,0x01,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
6012 0x00,0x00,0x00,0x0c,
'I',
'D',
'A',
'T',0x08,0xd7,0x63,0xf8,0xff,0xff,0x3f,0x00,0x05,0xfe,0x02,0xfe,0xdc,0xcc,0x59,0xe7,
6013 0x00,0x00,0x00,0x00,
'I',
'E',
'N',
'D',0xae,0x42,0x60,0x82
6017 0x89,
'P',
'N',
'G',0x0d,0x0a,0x1a,0x0a,
6018 0x00,0x00,0x00,0x0d,
'I',
'H',
'D',
'R',0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x08,0x02,0x00,0x00,0x00,0x90,0x77,0x53,0xde,
6019 0x00,0x00,0x00,0x08,
'h',
'I',
'S',
'T',0x00,0x01,0x00,0x02,0x00,0x03,0x00,0x04,0xff,0xff,0xff,0xff,
6020 0x00,0x00,0x00,0x0c,
'I',
'D',
'A',
'T',0x08,0xd7,0x63,0xf8,0xff,0xff,0x3f,0x00,0x05,0xfe,0x02,0xfe,0xdc,0xcc,0x59,0xe7,
6021 0x00,0x00,0x00,0x00,
'I',
'E',
'N',
'D',0xae,0x42,0x60,0x82
6027 UINT pHYs_off = 0,
i;
6028 static const struct {
6067 ok(pHYs_off,
"pHYs offset %d\n", pHYs_off);
6078 buf[pHYs_off + 4] = (td[
i].unitX >> 24) & 0xff;
6079 buf[pHYs_off + 5] = (td[
i].unitX >> 16) & 0xff;
6080 buf[pHYs_off + 6] = (td[
i].unitX >> 8) & 0xff;
6081 buf[pHYs_off + 7] = td[
i].unitX & 0xff;
6082 buf[pHYs_off + 8] = (td[
i].unitY >> 24) & 0xff;
6083 buf[pHYs_off + 9] = (td[
i].unitY >> 16) & 0xff;
6084 buf[pHYs_off + 10] = (td[
i].unitY >> 8) & 0xff;
6085 buf[pHYs_off + 11] = td[
i].unitY & 0xff;
6086 buf[pHYs_off + 12] = td[
i].unit;
6090 ok(
image !=
NULL,
"%u: Failed to load PNG image data\n",
i);
6113 ok(
image !=
NULL,
"Failed to load PNG image data\n");
6128 {
PropertyTagTypeShort,
PropertyTagPaletteHistogram, 8, { 1,0,2,0,3,0,4,0 } },
6137 win_skip(
"broken PNG histogram support\n");
6160 image = (
void *)0xdeadbeef;
6163 ok(
image == (
void *)0xdeadbeef,
"Unexpected image pointer.\n");
6171 ok(
hr ==
S_OK,
"Failed to create a stream.\n");
6216 if (!pGdipInitializePalette)
6218 win_skip(
"GdipInitializePalette is not supported on this platform\n");
6325 BYTE argb[8] = { 0x11,0x22,0x33,0x80, 0xff,0xff,0xff,0 };
6326 BYTE cleared[8] = { 0,0,0,0, 0,0,0,0 };
6345 ok(
data.Width == 2,
"expected 2, got %d\n",
data.Width);
6346 ok(
data.Height == 1,
"expected 1, got %d\n",
data.Height);
6347 ok(
data.Stride == 8,
"expected 8, got %d\n",
data.Stride);
6350 ok(
match,
"bits don't match\n");
6385 pGdipBitmapGetHistogramSize = (
void*)
GetProcAddress(
mod,
"GdipBitmapGetHistogramSize");
std::map< E_MODULE, HMODULE > mod
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
static const struct pixel_format_desc formats[]
static unsigned int palette_size(DWORD flags)
INT WINAPI StringFromGUID2(REFGUID guid, LPOLESTR str, INT cmax)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL delete_on_release, IStream **stream)
#define GetProcAddress(x, y)
#define WideCharToMultiByte
GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL *dpi)
GpStatus WINGDIPAPI GdipDrawImageI(GpGraphics *graphics, GpImage *image, INT x, INT y)
GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL *dpi)
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
GpStatus WINGDIPAPI GdipSetCompositingMode(GpGraphics *graphics, CompositingMode mode)
GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics *graphics, ARGB color)
GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics *graphics, GpMatrix *matrix)
GpStatus WINGDIPAPI GdipDrawImageRectRectI(GpGraphics *graphics, GpImage *image, INT dstx, INT dsty, INT dstwidth, INT dstheight, INT srcx, INT srcy, INT srcwidth, INT srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageAttributes, DrawImageAbort callback, VOID *callbackData)
GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics *graphics, InterpolationMode mode)
GpStatus WINGDIPAPI GdipDrawImagePointRectI(GpGraphics *graphics, GpImage *image, INT x, INT y, INT srcx, INT srcy, INT srcwidth, INT srcheight, GpUnit srcUnit)
GpStatus WINGDIPAPI GdipSetPixelOffsetMode(GpGraphics *graphics, PixelOffsetMode mode)
GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR *filename, GpBitmap **bitmap)
GpStatus WINGDIPAPI GdipGetPropertySize(GpImage *image, UINT *size, UINT *count)
GpStatus WINGDIPAPI GdipSaveAddImage(GpImage *image, GpImage *additional_image, GDIPCONST EncoderParameters *params)
GpStatus WINGDIPAPI GdipGetImageVerticalResolution(GpImage *image, REAL *res)
GpStatus WINGDIPAPI GdipGetImageRawFormat(GpImage *image, GUID *format)
GpStatus WINGDIPAPI GdipGetImagePalette(GpImage *image, ColorPalette *palette, INT size)
GpStatus WINGDIPAPI GdipGetImageEncodersSize(UINT *numEncoders, UINT *size)
GpStatus WINGDIPAPI GdipGetImageFlags(GpImage *image, UINT *flags)
GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage *image, IStream *stream, GDIPCONST CLSID *clsid, GDIPCONST EncoderParameters *params)
GpStatus WINGDIPAPI GdipCloneBitmapAreaI(INT x, INT y, INT width, INT height, PixelFormat format, GpBitmap *srcBitmap, GpBitmap **dstBitmap)
GpStatus WINGDIPAPI GdipGetAllPropertyItems(GpImage *image, UINT size, UINT count, PropertyItem *buf)
GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width)
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
GpStatus WINGDIPAPI GdipGetImageDimension(GpImage *image, REAL *width, REAL *height)
GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE *scan0, GpBitmap **bitmap)
#define PropertyTagTypeSShort
GpStatus WINGDIPAPI GdipSetImagePalette(GpImage *image, GDIPCONST ColorPalette *palette)
GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image, GDIPCONST GUID *dimensionID, UINT *count)
static const WCHAR bmp_format[]
#define PropertyTagTypeFloat
GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image, GpGraphics **graphics)
#define PropertyTagTypeDouble
GpStatus WINGDIPAPI GdipSaveImageToFile(GpImage *image, GDIPCONST WCHAR *filename, GDIPCONST CLSID *clsidEncoder, GDIPCONST EncoderParameters *encoderParams)
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsCount(GpImage *image, UINT *count)
GpStatus WINGDIPAPI GdipBitmapSetResolution(GpBitmap *bitmap, REAL xdpi, REAL ydpi)
GpStatus WINGDIPAPI GdipCreateBitmapFromGdiDib(GDIPCONST BITMAPINFO *info, VOID *bits, GpBitmap **bitmap)
GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap *bitmap, GDIPCONST GpRect *rect, UINT flags, PixelFormat format, BitmapData *lockeddata)
GpStatus WINGDIPAPI GdipGetPropertyCount(GpImage *image, UINT *num)
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
GpStatus WINGDIPAPI GdipGetImagePixelFormat(GpImage *image, PixelFormat *format)
GpStatus WINGDIPAPI GdipLoadImageFromFile(GDIPCONST WCHAR *filename, GpImage **image)
GpStatus WINGDIPAPI GdipGetImageThumbnail(GpImage *image, UINT width, UINT height, GpImage **ret_image, GetThumbnailImageAbort cb, VOID *cb_data)
GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap *bitmap, INT x, INT y, ARGB *color)
GpStatus WINGDIPAPI GdipBitmapSetPixel(GpBitmap *bitmap, INT x, INT y, ARGB color)
#define PropertyTagTypeSByte
GpStatus WINGDIPAPI GdipGetImagePaletteSize(GpImage *image, INT *size)
GpStatus WINGDIPAPI GdipImageSelectActiveFrame(GpImage *image, GDIPCONST GUID *dimensionID, UINT frame)
GpStatus WINGDIPAPI GdipGetPropertyIdList(GpImage *image, UINT num, PROPID *list)
GpStatus WINGDIPAPI GdipGetImageType(GpImage *image, ImageType *type)
GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream *stream, GpImage **image)
GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream *stream, GpBitmap **bitmap)
GpStatus WINGDIPAPI GdipImageRotateFlip(GpImage *image, RotateFlipType type)
GpStatus WINGDIPAPI GdipGetImageEncoders(UINT numEncoders, UINT size, ImageCodecInfo *encoders)
GpStatus WINGDIPAPI GdipGetPropertyItem(GpImage *image, PROPID propid, UINT size, PropertyItem *buffer)
GpStatus WINGDIPAPI GdipLoadImageFromFileICM(GDIPCONST WCHAR *filename, GpImage **image)
GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap *bitmap, HBITMAP *hbmReturn, ARGB background)
GpStatus WINGDIPAPI GdipTestControl(GpTestControlEnum control, void *param)
GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect, GpUnit *srcUnit)
static const struct image_codec codecs[NUM_CODECS]
GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap **bitmap)
GpStatus WINGDIPAPI GdipGetImageHorizontalResolution(GpImage *image, REAL *res)
GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage *image, PROPID propid, UINT *size)
GpStatus WINGDIPAPI GdipImageGetFrameDimensionsList(GpImage *image, GUID *dimensionIDs, UINT count)
GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap *bitmap, BitmapData *lockeddata)
GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBitmap **bitmap)
GpStatus WINGDIPAPI GdipSaveAdd(GpImage *image, GDIPCONST EncoderParameters *params)
GpStatus WINGDIPAPI GdipCreateMatrix2(REAL m11, REAL m12, REAL m21, REAL m22, REAL dx, REAL dy, GpMatrix **matrix)
GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix)
static void cleanup(void)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
INT WINAPI CompareStringA(LCID lcid, DWORD flags, LPCSTR str1, INT len1, LPCSTR str2, INT len2)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP errno_t __cdecl _controlfp_s(unsigned int *, unsigned int, unsigned int)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static unsigned char buff[32768]
void WINGDIPAPI GdipFree(void *ptr)
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
void *WINGDIPAPI GdipAlloc(SIZE_T size)
@ ColorMatrixFlagsSkipGrays
@ ColorMatrixFlagsAltGray
@ ColorMatrixFlagsDefault
@ EncoderValueFrameDimensionPage
@ CompositingModeSourceCopy
@ ImageFlagsColorSpaceCMYK
@ ImageFlagsColorSpaceYCBCR
@ ImageFlagsColorSpaceYCCK
@ ImageFlagsColorSpaceRGB
@ ImageFlagsColorSpaceGRAY
@ PixelOffsetModeHighSpeed
@ PixelOffsetModeHighQuality
@ EncoderParameterValueTypeLong
@ TestControlGetBuildNumber
@ MetafileTypeWmfPlaceable
@ InterpolationModeBilinear
@ InterpolationModeNearestNeighbor
#define PropertyTagIndexTransparent
#define PropertyTagFrameDelay
#define PropertyTagTypeShort
#define PropertyTagIndexBackground
@ ImageLockModeUserInputBuf
#define PropertyTagTypeLong
#define PropertyTagGlobalPalette
#define PropertyTagTypeUndefined
#define PropertyTagPixelUnit
#define PropertyTagTypeSLONG
#define PropertyTagTypeRational
#define PropertyTagPaletteHistogram
#define PropertyTagTypeByte
#define PropertyTagPixelPerUnitX
#define PropertyTagDateTime
#define PropertyTagPixelPerUnitY
#define PropertyTagTypeSRational
#define PropertyTagLoopCount
#define PropertyTagTypeASCII
#define PropertyTagExifUserComment
void WINAPI GdiplusShutdown(ULONG_PTR)
struct GdiplusAbort GdiplusAbort
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLenum GLenum GLenum GLenum GLenum scale
GLenum const GLfloat * params
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLuint GLsizei GLsizei * length
GLenum GLint GLint * precision
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
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 const GLfloat const GLdouble const GLfloat GLint GLint GLint j
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
GpStatus WINGDIPAPI GdipGetImageAttributesAdjustedPalette(GpImageAttributes *imageattr, ColorPalette *palette, ColorAdjustType type)
GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, GDIPCONST ColorMatrix *colorMatrix, GDIPCONST ColorMatrix *grayMatrix, ColorMatrixFlags flags)
GpStatus WINGDIPAPI GdipSetImageAttributesGamma(GpImageAttributes *imageAttr, ColorAdjustType type, BOOL enableFlag, REAL gamma)
GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes **imageattr)
GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys(GpImageAttributes *imageattr, ColorAdjustType type, BOOL enableFlag, ARGB colorLow, ARGB colorHigh)
GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes *imageattr)
GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(GpImageAttributes *imageAttr, ColorAdjustType type, BOOL enableFlag, UINT mapSize, GDIPCONST ColorMap *map)
GpStatus WINGDIPAPI GdipSetImageAttributesNoOp(GpImageAttributes *imageAttr, ColorAdjustType type, BOOL enableFlag)
GpStatus WINGDIPAPI GdipResetImageAttributes(GpImageAttributes *imageAttr, ColorAdjustType type)
static ERESOURCE GlobalLock
#define todo_wine_if(is_todo)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
static GLint image_size(GLint width, GLint height, GLenum format, GLenum type)
#define memcpy(s1, s2, n)
D3D11_SHADER_VARIABLE_DESC desc
static const char * dst_format
static UINT documented_type(UINT type)
static void test_GdipCreateBitmapFromHBITMAP(void)
static void test_multiframegif(void)
static void test_testcontrol(void)
static void test_tiff_palette(void)
static UINT *static UINT UINT UINT UINT *static GdiplusAbort *static BOOL
static UINT *static UINT UINT UINT UINT *static GdiplusAbort *static INT
static const BYTE gif_2frame_missing_gce1[]
#define giftest(img, prop, frames)
static void test_getsetpixel(void)
static void test_createhbitmap(void)
static void test_PARGB_conversion(void)
static void test_GetImageDimension(void)
static void test_bufferrawformat(void *buff, int size, REFGUID expected, int line, BOOL todo)
static BYTE * init_bitmap(UINT *width, UINT *height, UINT *stride)
static ARGB gifanimation3_pixels[5][4]
static void test_remaptable(void)
static void test_GdipLoadImageFromStream(void)
static void test_createfromwmf_noplaceable(void)
static void check_properties_get_all(GpImage *image, const struct property_test_data *td, UINT count, const struct property_test_data *td_broken, UINT count_broken, UINT prop_size)
#define PNG_COLOR_TYPE_RGB
static void test_encoders(void)
BOOL color_match(ARGB c1, ARGB c2, BYTE max_diff)
static void test_DrawImage_SourceCopy(void)
static void test_colorkey(void)
static const BYTE png_hist[]
static void test_graphics_clear(void)
static void test_GdipCloneImage(void)
static void test_imageabort(void)
static void test_png_unit_properties(void)
static void test_dispose(void)
static const unsigned char transparentgif[]
static void test_GdipInitializePalette(void)
static const char png_1x1_data[]
static const BYTE gif_2frame_missing_gce2[]
static const BYTE png_phys[]
static void test_gif_properties(void)
static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff)
static void test_histogram(void)
static void test_getthumbnail(void)
static void test_FromGdiDib(void)
static void test_getrawformat(void)
static void test_png_histogram_property(void)
static void test_LockBits_UserBuf(void)
static BOOL get_encoder_clsid(LPCWSTR mime, GUID *format, CLSID *clsid)
static void test_colormatrix(void)
static const unsigned char gifimage[35]
static void test_getadjustedpalette(void)
static void test_LockBits(void)
static void test_GdipDrawImagePointRect(void)
static const BYTE png_minimal[]
static const char * dbgstr_hexdata(const BYTE *data, UINT len)
static void test_GdipGetImageFlags(void)
static void test_SavingImages(void)
static UINT *static HistogramFormat
static void test_DrawImage(void)
static const unsigned char bmpimage[66]
static void expect_image_properties(GpImage *image, UINT width, UINT height, int line)
static void test_GdipGetAllPropertyItems(void)
static void check_halftone_palette(ColorPalette *palette)
INT compare_with_precision(const BYTE *ptr1, const BYTE *ptr2, size_t num, INT precision)
static void test_rotateflip(void)
static void test_LoadingImages(void)
static GpImage * load_image(const BYTE *image_data, UINT image_size, BOOL valid_data, BOOL todo_load)
static const struct tiff_data TIFF_data
static void test_ARGB_conversion(void)
#define expect(expected, got)
static void test_png_save_palette(void)
static const BYTE animatedgif[]
static void expect_rawformat(REFGUID expected, GpImage *img, int line, BOOL todo)
static void test_png_datetime_property(void)
static void test_createfromwmf(void)
static const BYTE gif_no_pal[]
static void test_GdipImageGetFrameDimensionsCount(void)
static UINT *static UINT UINT UINT UINT *static GdiplusAbort *static PaletteType
static const unsigned char wmfimage[180]
static void test_fromhicon(void)
static void test_createeffect(void)
#define expectf(expected, got)
static void test_CloneBitmapArea(void)
#define PNG_COLOR_TYPE_GRAY
static const unsigned char gifanimation[72]
static void expect_bitmap_locked_data(GpBitmap *bitmap, const BYTE *expect_bits, UINT width, UINT height, UINT stride, int line)
static const unsigned char gifanimation2[]
static void test_DrawImage_scale(void)
static void test_SavingMultiPageTiff(void)
static void test_png_color_formats(void)
static ARGB gifanimation2_pixels[5][4]
static const unsigned char tiffimage[]
static const unsigned char pngimage[285]
#define PNG_COLOR_TYPE_PALETTE
static const BYTE gif_2frame_no_pal[]
static void test_resolution(void)
static void test_image_properties(void)
static const unsigned char jpgimage[285]
static void test_tiff_properties(void)
static void check_properties_id_list(GpImage *image, const struct property_test_data *td, UINT count, const struct property_test_data *td_broken, UINT count_broken, UINT *prop_size)
static void test_gamma(void)
static void test_Scan0(void)
static void test_bitmapbits(void)
static void test_supported_encoders(void)
static void test_loadwmf(void)
static void test_palette(void)
static const unsigned char gifanimation3[]
static const BYTE gif_2frame_global_pal[]
static void test_image_format(void)
static LONG obj_refcount(void *obj)
static void test_formats(AUDCLNT_SHAREMODE mode)
static CHAR filenameA[MAX_PATH]
#define expect_guid(expected, guid)
static const CLSID IPropertyStorage UINT *static const PROPSPEC PROPVARIANT *static UINT const PROPSPEC PROPVARIANT PROPID
#define LOCALE_SYSTEM_DEFAULT
interface IStream * LPSTREAM
png_const_structrp png_const_inforp int * unit
#define IsEqualGUID(rguid1, rguid2)
int seek(void *fd, ulong off, int mode)
BITMAPINFOHEADER bmiHeader
BITMAPINFOHEADER bmiHeader
struct IFD_rational srational_val
struct IFD_rational rational[3]
struct IFD_entry entry[40]
#define FIELD_OFFSET(t, f)
struct BITMAPINFOWITHBITFIELDS bf
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HPALETTE WINAPI CreatePalette(_In_reads_(_Inexpressible_(2 *sizeof(WORD)+plpal->palNumEntries *sizeof(PALETTEENTRY))) const LOGPALETTE *)
struct tagLOGPALETTE LOGPALETTE
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HMETAFILE WINAPI SetMetaFileBitsEx(_In_ UINT cbBuffer, _In_reads_bytes_(cbBuffer) CONST BYTE *lpData)
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI DestroyIcon(_In_ HICON)