From: yaoyongjie <yaoyongjie@uniontech.com> Change-Id: I9a1a2499e6998c428ecdcf399de19a7e55d2ace6 --- dlls/gdiplus/tests/image.c | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index a1b81c8eda7..7bbfeb3f986 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -5481,6 +5481,44 @@ static void test_PARGB_conversion(void) GdipDisposeImage((GpImage *)bitmap); } +static void test_CMYK_conversion(void) +{ + static const BYTE cmyk_bits[16] = + { + /* pixel 0: C=0,M=0,Y=0,K=0 -> white */ + 0x00,0x00,0x00,0x00, + /* pixel 1: C=0,M=0,Y=0,K=255 -> black */ + 0x00,0x00,0x00,0xff, + /* pixel 2: C=128,M=64,Y=32,K=16 -> R=119,G=179,B=209 */ + 0x80,0x40,0x20,0x10, + /* pixel 3: C=255,M=255,Y=255,K=0 -> black */ + 0xff,0xff,0xff,0x00 + }; + GpBitmap *bitmap; + BitmapData data; + GpStatus status; + + status = GdipCreateBitmapFromScan0(4, 1, 16, PixelFormat32bppCMYK, + (BYTE*)cmyk_bits, &bitmap); + ok(status == Ok, "GdipCreateBitmapFromScan0(CMYK) failed, status=%d\n", status); + if (status != Ok) return; + + memset(&data, 0, sizeof(data)); + status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, + PixelFormat32bppARGB, &data); + todo_wine ok(status == InvalidParameter, "gdiplus rejectes PixelFormat32bppCMYK -> PixelFormat32bppARGB\n"); + + status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, + PixelFormat8bppIndexed, &data); + todo_wine ok(status == InvalidParameter, "gdiplus rejectes PixelFormat32bppCMYK -> PixelFormat8bppIndexed\n"); + + status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, + PixelFormat16bppGrayScale, &data); + todo_wine ok(status == InvalidParameter, "gdiplus rejectes PixelFormat32bppCMYK -> PixelFormat16bppGrayScale\n"); + + GdipDisposeImage((GpImage *)bitmap); +} + static void test_CloneBitmapArea(void) { @@ -6863,6 +6901,7 @@ START_TEST(image) test_CloneBitmapArea(); test_ARGB_conversion(); test_PARGB_conversion(); + test_CMYK_conversion(); test_DrawImage_scale(); test_image_format(); test_DrawImage(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10835