From: Robert Gerigk <Robert-Gerigk@online.de> Add test data for 2bppGray and 16bppGray expected conversion results. Add test_conversion() calls for 8bppGray -> 2bppGray, 8bppGray -> 4bppGray, and 8bppGray -> 16bppGray conversions. Update dst_todo_count values for BlackWhite, 2bppGray, 4bppGray and 16bppGray from 35 to 12 to match the actual number of missing CanConvert source formats after implementing copypixels handlers. Signed-off-by: Robert Gerigk <Robert-Gerigk@online.de> --- dlls/windowscodecs/tests/converter.c | 29 ++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c index d85ae579d3b..166e964e8b6 100644 --- a/dlls/windowscodecs/tests/converter.c +++ b/dlls/windowscodecs/tests/converter.c @@ -596,6 +596,12 @@ static const float bits_32bppGrayFloat[] = { static const struct bitmap_data testdata_32bppGrayFloat = { &GUID_WICPixelFormat32bppGrayFloat, 32, (const BYTE *)bits_32bppGrayFloat, 32, 2, 96.0, 96.0, &testdata_32bppGrayFloat_xp}; +static const BYTE bits_2bppGray[] = { + 0x74,0x74,0x74,0x74,0x74,0x74,0x74,0x74, + 0xef,0xef,0xef,0xef,0xef,0xef,0xef,0xef}; +static const struct bitmap_data testdata_2bppGray = { + &GUID_WICPixelFormat2bppGray, 2, bits_2bppGray, 32, 2, 96.0, 96.0}; + static const BYTE bits_4bppGray_xp[] = { 77,112,77,112,77,112,77,112,77,112,77,112,77,112,77,112,249, 239,249,239,249,239,249,239,249,239,249,239,249,239,249,239}; @@ -624,6 +630,18 @@ static const BYTE bits_8bppGray[] = { static const struct bitmap_data testdata_8bppGray = { &GUID_WICPixelFormat8bppGray, 8, bits_8bppGray, 32, 2, 96.0, 96.0, &testdata_8bppGray_xp}; +static const BYTE bits_16bppGray[] = { + 0x4c,0x4c, 0xdc,0xdc, 0x7f,0x7f, 0x00,0x00, 0x4c,0x4c, 0xdc,0xdc, 0x7f,0x7f, 0x00,0x00, + 0x4c,0x4c, 0xdc,0xdc, 0x7f,0x7f, 0x00,0x00, 0x4c,0x4c, 0xdc,0xdc, 0x7f,0x7f, 0x00,0x00, + 0x4c,0x4c, 0xdc,0xdc, 0x7f,0x7f, 0x00,0x00, 0x4c,0x4c, 0xdc,0xdc, 0x7f,0x7f, 0x00,0x00, + 0x4c,0x4c, 0xdc,0xdc, 0x7f,0x7f, 0x00,0x00, 0x4c,0x4c, 0xdc,0xdc, 0x7f,0x7f, 0x00,0x00, + 0xf7,0xf7, 0x91,0x91, 0xe6,0xe6, 0xff,0xff, 0xf7,0xf7, 0x91,0x91, 0xe6,0xe6, 0xff,0xff, + 0xf7,0xf7, 0x91,0x91, 0xe6,0xe6, 0xff,0xff, 0xf7,0xf7, 0x91,0x91, 0xe6,0xe6, 0xff,0xff, + 0xf7,0xf7, 0x91,0x91, 0xe6,0xe6, 0xff,0xff, 0xf7,0xf7, 0x91,0x91, 0xe6,0xe6, 0xff,0xff, + 0xf7,0xf7, 0x91,0x91, 0xe6,0xe6, 0xff,0xff, 0xf7,0xf7, 0x91,0x91, 0xe6,0xe6, 0xff,0xff}; +static const struct bitmap_data testdata_16bppGray = { + &GUID_WICPixelFormat16bppGray, 16, bits_16bppGray, 32, 2, 96.0, 96.0}; + static const BYTE bits_24bppBGR_gray[] = { 76,76,76, 220,220,220, 127,127,127, 0,0,0, 76,76,76, 220,220,220, 127,127,127, 0,0,0, 76,76,76, 220,220,220, 127,127,127, 0,0,0, 76,76,76, 220,220,220, 127,127,127, 0,0,0, @@ -858,11 +876,11 @@ static void test_can_convert(void) {WIC_PIXEL_FORMAT(2bppIndexed), TRUE, TRUE, 35}, {WIC_PIXEL_FORMAT(4bppIndexed), TRUE, TRUE, 35}, {WIC_PIXEL_FORMAT(8bppIndexed), TRUE, TRUE, 12}, - {WIC_PIXEL_FORMAT(BlackWhite), TRUE, TRUE, 35}, - {WIC_PIXEL_FORMAT(2bppGray), TRUE, TRUE, 35}, - {WIC_PIXEL_FORMAT(4bppGray), TRUE, TRUE, 35}, + {WIC_PIXEL_FORMAT(BlackWhite), TRUE, TRUE, 12}, + {WIC_PIXEL_FORMAT(2bppGray), TRUE, TRUE, 12}, + {WIC_PIXEL_FORMAT(4bppGray), TRUE, TRUE, 12}, {WIC_PIXEL_FORMAT(8bppGray), TRUE, TRUE, 12}, - {WIC_PIXEL_FORMAT(16bppGray), TRUE, TRUE, 35}, + {WIC_PIXEL_FORMAT(16bppGray), TRUE, TRUE, 12}, {WIC_PIXEL_FORMAT(8bppAlpha), TRUE, TRUE, 35, TRUE}, @@ -2391,6 +2409,9 @@ START_TEST(converter) test_conversion(&testdata_24bppBGR, &testdata_8bppGray, "24bppBGR -> 8bppGray", FALSE); test_conversion(&testdata_32bppBGR, &testdata_8bppGray, "32bppBGR -> 8bppGray", FALSE); + test_conversion(&testdata_8bppGray, &testdata_2bppGray, "8bppGray -> 2bppGray", FALSE); + test_conversion(&testdata_8bppGray, &testdata_4bppGray, "8bppGray -> 4bppGray", FALSE); + test_conversion(&testdata_8bppGray, &testdata_16bppGray, "8bppGray -> 16bppGray", FALSE); test_conversion(&testdata_32bppGrayFloat, &testdata_24bppBGR_gray, "32bppGrayFloat -> 24bppBGR gray", FALSE); test_conversion(&testdata_32bppGrayFloat, &testdata_8bppGray, "32bppGrayFloat -> 8bppGray", FALSE); test_conversion(&testdata_32bppBGRA, &testdata_16bppBGRA5551, "32bppBGRA -> 16bppBGRA5551", FALSE); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10412