Implement few effect related functions in Gdiplus.
-- v21: gdiplus: Add GdipSetEffectsParameters implementation.
From: Vijay Kiran Kamuju infyquest@gmail.com
--- include/gdipluscolormatrix.h | 1 + include/gdipluseffects.h | 74 ++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+)
diff --git a/include/gdipluscolormatrix.h b/include/gdipluscolormatrix.h index 44016ff3451..391095ed8fb 100644 --- a/include/gdipluscolormatrix.h +++ b/include/gdipluscolormatrix.h @@ -62,6 +62,7 @@ enum HistogramFormat
#ifndef __cplusplus
+typedef BYTE ColorChannelLUT[256]; typedef enum ColorAdjustType ColorAdjustType; typedef enum ColorMatrixFlags ColorMatrixFlags; typedef enum HistogramFormat HistogramFormat; diff --git a/include/gdipluseffects.h b/include/gdipluseffects.h index d2d6a0500da..4100647f7a1 100644 --- a/include/gdipluseffects.h +++ b/include/gdipluseffects.h @@ -31,6 +31,80 @@ DEFINE_GUID(ColorBalanceEffectGuid, 0x537e597d, 0x251e, 0x48da, 0x96, DEFINE_GUID(RedEyeCorrectionEffectGuid, 0x74d29d05, 0x69a4, 0x4266, 0x95, 0x49, 0x3c, 0xc5, 0x28, 0x36, 0xb6, 0x32); DEFINE_GUID(ColorCurveEffectGuid, 0xdd6a0022, 0x58e4, 0x4a67, 0x9d, 0x9b, 0xd4, 0x8e, 0xb8, 0x81, 0xa5, 0x3d);
+struct BlurParams { + float radius; + BOOL expandEdge; +}; + +struct SharpenParams { + float radius; + float amount; +}; + +struct TintParams { + INT hue; + INT amount; +}; + +struct RedEyeCorrectionParams { + UINT numberOfAreas; + RECT *areas; +}; + +struct ColorLUTParams { + ColorChannelLUT lutB; + ColorChannelLUT lutG; + ColorChannelLUT lutR; + ColorChannelLUT lutA; +}; + +struct BrightnessContrastParams { + INT brightnessLevel; + INT contrastLevel; +}; + +struct HueSaturationLightnessParams { + INT hueLevel; + INT saturationLevel; + INT lightnessLevel; +}; + +struct ColorBalanceParams { + INT cyanRed; + INT magentaGreen; + INT yellowBlue; +}; + +struct LevelsParams { + INT highlight; + INT midtone; + INT shadow; +}; + +typedef enum CurveAdjustments { + AdjustExposure, + AdjustDensity, + AdjustContrast, + AdjustHighlight, + AdjustShadow, + AdjustMidtone, + AdjustWhiteSaturation, + AdjustBlackSaturation +} CurveAdjustments; + +typedef enum CurveChannel { + CurveChannelAll, + CurveChannelRed, + CurveChannelGreen, + CurveChannelBlue +} CurveChannel; + +struct ColorCurveParams { + CurveAdjustments adjustment; + CurveChannel channel; + INT adjustValue; +}; + #ifdef __cplusplus extern "C" { #endif
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/gdiplus/gdiplus_private.h | 21 ++++++++++ dlls/gdiplus/image.c | 73 ++++++++++++++++++++++++++++++---- dlls/gdiplus/tests/image.c | 7 ++-- 3 files changed, 90 insertions(+), 11 deletions(-)
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 6f7e72124c2..44d3e6d1000 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -368,6 +368,27 @@ struct GpAdjustableArrowCap{ REAL width; };
+typedef enum EffectType { + NoneEffect, + BlurEffect, + SharpenEffect, + TintEffect, + RedEyeCorrectionEffect, + ColorMatrixEffect, + ColorLUTEffect, + BrightnessContrastEffect, + HueSaturationLightnessEffect, + ColorBalanceEffect, + LevelsEffect, + ColorCurveEffect, +} EffectType; + +typedef struct CGpEffect{ + INT datasize; + void *data; + EffectType type; +} CGpEffect; + struct GpImage{ IWICBitmapDecoder *decoder; IWICBitmapEncoder *encoder; diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 806da0cb696..c89360ac52a 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -5576,14 +5576,71 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi */ GpStatus WINGDIPAPI GdipCreateEffect(const GUID guid, CGpEffect **effect) { - FIXME("(%s, %p): stub\n", debugstr_guid(&guid), effect); + CGpEffect *ef = NULL; + EffectType type;
- if(!effect) + TRACE("(%s, %p)\n", debugstr_guid(&guid), effect); + + if (!effect) return InvalidParameter;
- *effect = NULL; + if (IsEqualGUID(&guid, &BlurEffectGuid)) + { + type = BlurEffect; + } + else if (IsEqualGUID(&guid, &SharpenEffectGuid)) + { + type = SharpenEffect; + } + else if (IsEqualGUID(&guid, &TintEffectGuid)) + { + type = TintEffect; + } + else if (IsEqualGUID(&guid, &RedEyeCorrectionEffectGuid)) + { + type = RedEyeCorrectionEffect; + } + else if (IsEqualGUID(&guid, &ColorMatrixEffectGuid)) + { + type = ColorMatrixEffect; + } + else if (IsEqualGUID(&guid, &ColorLUTEffectGuid)) + { + type = ColorLUTEffect; + } + else if (IsEqualGUID(&guid, &BrightnessContrastEffectGuid)) + { + type = BrightnessContrastEffect; + } + else if (IsEqualGUID(&guid, &HueSaturationLightnessEffectGuid)) + { + type = HueSaturationLightnessEffect; + } + else if (IsEqualGUID(&guid, &ColorBalanceEffectGuid)) + { + type = ColorBalanceEffect; + } + else if (IsEqualGUID(&guid, &LevelsEffectGuid)) + { + type = LevelsEffect; + } + else if (IsEqualGUID(&guid, &ColorCurveEffectGuid)) + { + type = ColorCurveEffect; + } + else + { + *effect = NULL; + return Win32Error; + }
- return NotImplemented; + ef = malloc(sizeof(CGpEffect)); + ef->datasize = 0; + ef->data = NULL; + ef->type = type; + *effect = ef; + + return Ok; }
/***************************************************************************** @@ -5591,10 +5648,10 @@ GpStatus WINGDIPAPI GdipCreateEffect(const GUID guid, CGpEffect **effect) */ GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect) { - FIXME("(%p): stub\n", effect); - /* note: According to Jose Roca's GDI+ Docs, this is not implemented - * in Windows's gdiplus */ - return NotImplemented; + TRACE("(%p)\n", effect); + + free(effect); + return Ok; }
/***************************************************************************** diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 8fc9aa78225..d0ca8f2e409 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -5408,7 +5408,7 @@ static void test_createeffect(void) GpStatus (WINAPI *pGdipCreateEffect)( const GUID guid, CGpEffect **effect); GpStatus (WINAPI *pGdipDeleteEffect)( CGpEffect *effect); GpStatus stat; - CGpEffect *effect; + CGpEffect *effect = NULL; HMODULE mod = GetModuleHandleA("gdiplus.dll"); int i; const GUID * const effectlist[] = @@ -5429,12 +5429,13 @@ static void test_createeffect(void) expect(InvalidParameter, stat);
stat = pGdipCreateEffect(noneffect, &effect); - todo_wine expect(Win32Error, stat); + expect(Win32Error, stat); + ok(effect == NULL, "Expected effect to be NULL\n");
for(i=0; i < ARRAY_SIZE(effectlist); i++) { stat = pGdipCreateEffect(*effectlist[i], &effect); - todo_wine expect(Ok, stat); + expect(Ok, stat); if(stat == Ok) { stat = pGdipDeleteEffect(effect);
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/image.c | 57 ++++++++++++++++++++++++++++++++++++++ dlls/gdiplus/tests/image.c | 46 ++++++++++++++++++++++++++---- include/gdipluseffects.h | 1 + 4 files changed, 99 insertions(+), 7 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 178592e35d9..0f17bb02d4d 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -612,7 +612,7 @@ 612 stdcall GdipGetImageItemData(ptr ptr) 613 stdcall GdipCreateEffect(int128 ptr) 614 stdcall GdipDeleteEffect(ptr) -615 stub GdipGetEffectParameterSize +615 stdcall GdipGetEffectParameterSize(ptr ptr) 616 stub GdipGetEffectParameters 617 stdcall GdipSetEffectParameters(ptr ptr long) 618 stdcall GdipInitializePalette(ptr long long long ptr) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index c89360ac52a..b3a33cdc702 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -5654,6 +5654,63 @@ GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect) return Ok; }
+/***************************************************************************** + * GdipGetEffectParameterSize [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipGetEffectParameterSize(CGpEffect *effect, UINT *size) +{ + UINT sz = 0; + GpStatus status = Ok; + + TRACE("(%p %p)\n", effect, size); + + if (!effect || !size) + return InvalidParameter; + + switch (effect->type) + { + case BlurEffect: + sz = sizeof(struct BlurParams); + break; + case SharpenEffect: + sz = sizeof(struct SharpenParams); + break; + case TintEffect: + sz = sizeof(struct TintParams); + break; + case RedEyeCorrectionEffect: + sz = sizeof(struct RedEyeCorrectionParams); + break; + case ColorMatrixEffect: + sz = sizeof(ColorMatrix); + break; + case ColorLUTEffect: + sz = sizeof(struct ColorLUTParams); + break; + case BrightnessContrastEffect: + sz = sizeof(struct BrightnessContrastParams); + break; + case HueSaturationLightnessEffect: + sz = sizeof(struct HueSaturationLightnessParams); + break; + case ColorBalanceEffect: + sz = sizeof(struct ColorBalanceParams); + break; + case LevelsEffect: + sz = sizeof(struct LevelsParams); + break; + case ColorCurveEffect: + sz = sizeof(struct ColorCurveParams); + break; + default: + status = InvalidParameter; + break; + } + + *size = sz; + return status; +} + /***************************************************************************** * GdipSetEffectParameters [GDIPLUS.@] */ diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index d0ca8f2e409..471f9909c80 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -5407,17 +5407,38 @@ static void test_createeffect(void) static const GUID noneffect = { 0xcd0c3d4b, 0xe15e, 0x4cf2, { 0x9e, 0xa8, 0x6e, 0x1d, 0x65, 0x48, 0xc5, 0xa5 } }; GpStatus (WINAPI *pGdipCreateEffect)( const GUID guid, CGpEffect **effect); GpStatus (WINAPI *pGdipDeleteEffect)( CGpEffect *effect); + GpStatus (WINAPI *pGdipGetEffectParameterSize)( CGpEffect *effect, UINT *size); GpStatus stat; CGpEffect *effect = NULL; + UINT size; HMODULE mod = GetModuleHandleA("gdiplus.dll"); int i; - const GUID * const effectlist[] = - {&BlurEffectGuid, &SharpenEffectGuid, &ColorMatrixEffectGuid, &ColorLUTEffectGuid, - &BrightnessContrastEffectGuid, &HueSaturationLightnessEffectGuid, &LevelsEffectGuid, - &TintEffectGuid, &ColorBalanceEffectGuid, &RedEyeCorrectionEffectGuid, &ColorCurveEffectGuid}; + + static const struct test_data { + const GUID *guid; + UINT size; + } td[] = + { + { &BlurEffectGuid, 8 }, + { &SharpenEffectGuid, 8 }, + { &ColorMatrixEffectGuid, 100 }, + { &ColorLUTEffectGuid, 1024 }, + { &BrightnessContrastEffectGuid, 8 }, + { &HueSaturationLightnessEffectGuid, 12 }, + { &LevelsEffectGuid, 12 }, + { &TintEffectGuid, 8 }, + { &ColorBalanceEffectGuid, 12 }, +#ifdef _WIN64 + { &RedEyeCorrectionEffectGuid, 16 }, +#else + { &RedEyeCorrectionEffectGuid, 8 }, +#endif + { &ColorCurveEffectGuid, 12 } + };
pGdipCreateEffect = (void*)GetProcAddress( mod, "GdipCreateEffect"); pGdipDeleteEffect = (void*)GetProcAddress( mod, "GdipDeleteEffect"); + pGdipGetEffectParameterSize = (void*)GetProcAddress( mod, "GdipGetEffectParameterSize"); if(!pGdipCreateEffect || !pGdipDeleteEffect) { /* GdipCreateEffect/GdipDeleteEffect was introduced in Windows Vista. */ @@ -5428,16 +5449,29 @@ static void test_createeffect(void) stat = pGdipCreateEffect(BlurEffectGuid, NULL); expect(InvalidParameter, stat);
+ stat = pGdipGetEffectParameterSize(NULL, NULL); + expect(InvalidParameter, stat); + + stat = pGdipGetEffectParameterSize(effect, NULL); + expect(InvalidParameter, stat); + + effect = (CGpEffect *)0xdeadbeef; stat = pGdipCreateEffect(noneffect, &effect); expect(Win32Error, stat); ok(effect == NULL, "Expected effect to be NULL\n");
- for(i=0; i < ARRAY_SIZE(effectlist); i++) + for(i=0; i < ARRAY_SIZE(td); i++) { - stat = pGdipCreateEffect(*effectlist[i], &effect); + stat = pGdipCreateEffect(*td[i].guid, &effect); expect(Ok, stat); + if(stat == Ok) { + size = 0; + stat = pGdipGetEffectParameterSize(effect, &size); + expect(Ok, stat); + expect(td[i].size, size); + stat = pGdipDeleteEffect(effect); expect(Ok, stat); } diff --git a/include/gdipluseffects.h b/include/gdipluseffects.h index 4100647f7a1..a58d25cb0e3 100644 --- a/include/gdipluseffects.h +++ b/include/gdipluseffects.h @@ -111,6 +111,7 @@ extern "C" {
GpStatus WINGDIPAPI GdipCreateEffect(const GUID guid, CGpEffect **effect); GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect); +GpStatus WINGDIPAPI GdipGetEffectParameterSize(CGpEffect *effect, UINT *size);
#ifdef __cplusplus }
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/image.c | 42 ++++++++++++-- dlls/gdiplus/tests/image.c | 101 ++++++++++++++++++++++++++++----- include/gdipluseffects.h | 1 + 4 files changed, 126 insertions(+), 19 deletions(-)
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 44d3e6d1000..a4e34ab9fa1 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -386,6 +386,7 @@ typedef enum EffectType { typedef struct CGpEffect{ INT datasize; void *data; + void *params; EffectType type; } CGpEffect;
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index b3a33cdc702..374c4ce51f4 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -5637,6 +5637,7 @@ GpStatus WINGDIPAPI GdipCreateEffect(const GUID guid, CGpEffect **effect) ef = malloc(sizeof(CGpEffect)); ef->datasize = 0; ef->data = NULL; + ef->params = NULL; ef->type = type; *effect = ef;
@@ -5650,6 +5651,7 @@ GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect) { TRACE("(%p)\n", effect);
+ free(effect->params); free(effect); return Ok; } @@ -5680,6 +5682,8 @@ GpStatus WINGDIPAPI GdipGetEffectParameterSize(CGpEffect *effect, UINT *size) break; case RedEyeCorrectionEffect: sz = sizeof(struct RedEyeCorrectionParams); + if (effect->params) + sz += (((struct RedEyeCorrectionParams *)effect->params)->numberOfAreas)*sizeof(RECT); break; case ColorMatrixEffect: sz = sizeof(ColorMatrix); @@ -5706,8 +5710,8 @@ GpStatus WINGDIPAPI GdipGetEffectParameterSize(CGpEffect *effect, UINT *size) status = InvalidParameter; break; } - *size = sz; + return status; }
@@ -5717,14 +5721,42 @@ GpStatus WINGDIPAPI GdipGetEffectParameterSize(CGpEffect *effect, UINT *size) GpStatus WINGDIPAPI GdipSetEffectParameters(CGpEffect *effect, const VOID *params, const UINT size) { - static int calls; + UINT paramsize = 0, num = 0;
TRACE("(%p,%p,%u)\n", effect, params, size);
- if(!(calls++)) - FIXME("not implemented\n"); + if (!effect || !params || !size) + return InvalidParameter;
- return NotImplemented; + if (GdipGetEffectParameterSize(effect, ¶msize) != Ok) + return InvalidParameter; + + if (effect->type == RedEyeCorrectionEffect) + { + if ((paramsize-size > 0) || (((size-paramsize)%sizeof(RECT)) != 0)) + return InvalidParameter; + } + else + { + if (paramsize != size) + return InvalidParameter; + } + + if (!effect->params) + effect->params = malloc(size); + else + effect->params = realloc(effect->params, size); + + if (effect->type == RedEyeCorrectionEffect) + { + num = (size-paramsize)/sizeof(RECT); + ((struct RedEyeCorrectionParams *)effect->params)->numberOfAreas = num; + memcpy(((struct RedEyeCorrectionParams *)params)->areas, ((struct RedEyeCorrectionParams *)effect->params)->areas, num*sizeof(RECT)); + } + else + memcpy(effect->params, params, size); + + return Ok; }
/***************************************************************************** diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 471f9909c80..109c179dffc 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -5408,37 +5408,96 @@ static void test_createeffect(void) GpStatus (WINAPI *pGdipCreateEffect)( const GUID guid, CGpEffect **effect); GpStatus (WINAPI *pGdipDeleteEffect)( CGpEffect *effect); GpStatus (WINAPI *pGdipGetEffectParameterSize)( CGpEffect *effect, UINT *size); + GpStatus (WINAPI *pGdipSetEffectParameters)( CGpEffect *effect, const VOID *params, const UINT size); GpStatus stat; CGpEffect *effect = NULL; UINT size; + void *params = NULL; HMODULE mod = GetModuleHandleA("gdiplus.dll"); int i;
- static const struct test_data { + RECT rects[2] = { { 0, 0, 75, 75 }, { -32, -32, 32, 32 } }; + struct BlurParams blur = { 2.0, TRUE }; + struct SharpenParams sharpen = { 5.0, 2 }; + ColorMatrix matrix = + { + { + { 1.0, 1.0, 1.0, 1.0, 1.0 }, + { 2.0, 2.0, 2.0, 2.0, 2.0 }, + { 3.0, 3.0, 3.0, 3.0, 3.0 }, + { 4.0, 4.0, 4.0, 4.0, 4.0 }, + { 5.0, 5.0, 5.0, 5.0, 5.0 } + } + }; + struct ColorLUTParams lut = + { + { 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7, + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7, + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7, + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7 }, + { 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7, + 8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11, + 12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15, + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7, + 8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11, + 12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15 }, + { 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3, + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3 }, + { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } + }; + struct BrightnessContrastParams bc = { 75, 50 }; + struct HueSaturationLightnessParams hsl = { 50, 50, 50 }; + struct LevelsParams lvl = { 50, 50, 5 }; + struct TintParams tint = { 20, 5 }; + struct ColorBalanceParams cbal = { 50, 50, 50 }; + struct ColorCurveParams ccurve = { AdjustExposure, CurveChannelAll, 5 }; + struct RedEyeCorrectionParams redi = { 2, rects }; + const struct test_data { const GUID *guid; UINT size; + void *params; } td[] = { - { &BlurEffectGuid, 8 }, - { &SharpenEffectGuid, 8 }, - { &ColorMatrixEffectGuid, 100 }, - { &ColorLUTEffectGuid, 1024 }, - { &BrightnessContrastEffectGuid, 8 }, - { &HueSaturationLightnessEffectGuid, 12 }, - { &LevelsEffectGuid, 12 }, - { &TintEffectGuid, 8 }, - { &ColorBalanceEffectGuid, 12 }, + { &BlurEffectGuid, 8, &blur }, + { &SharpenEffectGuid, 8, &sharpen }, + { &ColorMatrixEffectGuid, 100, &matrix }, + { &ColorLUTEffectGuid, 1024, &lut }, + { &BrightnessContrastEffectGuid, 8, &bc }, + { &HueSaturationLightnessEffectGuid, 12, &hsl }, + { &LevelsEffectGuid, 12, &lvl }, + { &TintEffectGuid, 8, &tint }, + { &ColorBalanceEffectGuid, 12, &cbal }, #ifdef _WIN64 - { &RedEyeCorrectionEffectGuid, 16 }, + { &RedEyeCorrectionEffectGuid, 16, &redi }, #else - { &RedEyeCorrectionEffectGuid, 8 }, + { &RedEyeCorrectionEffectGuid, 8, &redi }, #endif - { &ColorCurveEffectGuid, 12 } + { &ColorCurveEffectGuid, 12, &ccurve } };
pGdipCreateEffect = (void*)GetProcAddress( mod, "GdipCreateEffect"); pGdipDeleteEffect = (void*)GetProcAddress( mod, "GdipDeleteEffect"); pGdipGetEffectParameterSize = (void*)GetProcAddress( mod, "GdipGetEffectParameterSize"); + pGdipSetEffectParameters = (void*)GetProcAddress( mod, "GdipSetEffectParameters"); if(!pGdipCreateEffect || !pGdipDeleteEffect) { /* GdipCreateEffect/GdipDeleteEffect was introduced in Windows Vista. */ @@ -5452,7 +5511,7 @@ static void test_createeffect(void) stat = pGdipGetEffectParameterSize(NULL, NULL); expect(InvalidParameter, stat);
- stat = pGdipGetEffectParameterSize(effect, NULL); + stat = pGdipSetEffectParameters(NULL, NULL, 0); expect(InvalidParameter, stat);
effect = (CGpEffect *)0xdeadbeef; @@ -5460,6 +5519,14 @@ static void test_createeffect(void) expect(Win32Error, stat); ok(effect == NULL, "Expected effect to be NULL\n");
+ effect = (CGpEffect *)0xdeadbeef; + stat = pGdipSetEffectParameters(effect, (void *)0xdeadbeef, 0); + expect(InvalidParameter, stat); + stat = pGdipSetEffectParameters(effect, (void *)0xdeadbeef, 8); + expect(InvalidParameter, stat); + stat = pGdipSetEffectParameters(effect, (void *)0xdeadbeef, 5); + expect(InvalidParameter, stat); + for(i=0; i < ARRAY_SIZE(td); i++) { stat = pGdipCreateEffect(*td[i].guid, &effect); @@ -5472,6 +5539,12 @@ static void test_createeffect(void) expect(Ok, stat); expect(td[i].size, size);
+ stat = pGdipSetEffectParameters(effect, td[i].params, td[i].size); + expect(Ok, stat); + size = 0; + stat = pGdipGetEffectParameterSize(effect, &size); + expect(td[i].size, size); + stat = pGdipDeleteEffect(effect); expect(Ok, stat); } diff --git a/include/gdipluseffects.h b/include/gdipluseffects.h index a58d25cb0e3..2b94479f7f5 100644 --- a/include/gdipluseffects.h +++ b/include/gdipluseffects.h @@ -112,6 +112,7 @@ extern "C" { GpStatus WINGDIPAPI GdipCreateEffect(const GUID guid, CGpEffect **effect); GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect); GpStatus WINGDIPAPI GdipGetEffectParameterSize(CGpEffect *effect, UINT *size); +GpStatus WINGDIPAPI GdipSetEffectParameters(CGpEffect *effect, const VOID *params, const UINT size);
#ifdef __cplusplus }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=142294
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
gdiplus: 0b84:image: unhandled exception c0000005 at 73C37016
=== w7u_adm (32 bit report) ===
gdiplus: 0868:image: unhandled exception c0000005 at 742A7016
=== w7u_el (32 bit report) ===
gdiplus: 0a80:image: unhandled exception c0000005 at 73CE7016
=== w8 (32 bit report) ===
gdiplus: 0c2c:image: unhandled exception c0000005 at 6DD832A4
=== w8adm (32 bit report) ===
gdiplus: 0ab8:image: unhandled exception c0000005 at 6DB332A4
=== w864 (32 bit report) ===
gdiplus: 050c:image: unhandled exception c0000005 at 72AF32A4
=== w1064v1507 (32 bit report) ===
gdiplus: 0a08:image: unhandled exception c0000005 at 748C2754
=== w1064v1809 (32 bit report) ===
gdiplus: 1df4:image: unhandled exception c0000005 at 74A4AA29
=== w1064_tsign (32 bit report) ===
gdiplus: 1e64:image: unhandled exception c0000005 at 749D3149
=== w10pro64 (32 bit report) ===
gdiplus: 21c8:image: unhandled exception c0000005 at 73D92D99
=== w10pro64_en_AE_u8 (32 bit report) ===
gdiplus: 23d4:image: unhandled exception c0000005 at 748C2D99
=== w11pro64 (32 bit report) ===
gdiplus: 1d30:image: unhandled exception c0000005 at 745B3729
=== w7pro64 (64 bit report) ===
gdiplus: 0aec:image: unhandled exception c0000005 at 000007FEFB1464E3
=== w864 (64 bit report) ===
gdiplus: 0b4c:image: unhandled exception c0000005 at 00007FFA3FE7EB7A
=== w1064v1507 (64 bit report) ===
gdiplus: 0d0c:image: unhandled exception c0000005 at 00007FFAC886748A
=== w1064v1809 (64 bit report) ===
gdiplus: 1dfc:image: unhandled exception c0000005 at 00007FFF99D46F44
=== w1064_2qxl (64 bit report) ===
gdiplus: 1e44:image: unhandled exception c0000005 at 00007FFFE52F8024
=== w1064_adm (64 bit report) ===
gdiplus: 1544:image: unhandled exception c0000005 at 00007FFA3BA38024
=== w1064_tsign (64 bit report) ===
gdiplus: 1d78:image: unhandled exception c0000005 at 00007FFD3C868024
=== w10pro64 (64 bit report) ===
gdiplus: 2090:image: unhandled exception c0000005 at 00007FFF1C897D34
=== w10pro64_ar (64 bit report) ===
gdiplus: 1184:image: unhandled exception c0000005 at 00007FF9F6DB7D34
=== w10pro64_ja (64 bit report) ===
gdiplus: 1e64:image: unhandled exception c0000005 at 00007FF95D997D34
=== w10pro64_zh_CN (64 bit report) ===
gdiplus: 227c:image: unhandled exception c0000005 at 00007FF8A4387D34
=== w11pro64_amd (64 bit report) ===
gdiplus: 0368:image: unhandled exception c0000005 at 00007FF9AE66FDC1
=== debian11 (32 bit report) ===
gdiplus: Unhandled exception: page fault on read access to 0xdeadbefb in 32-bit code (0x78e83daf).
=== debian11 (32 bit ar:MA report) ===
gdiplus: Unhandled exception: page fault on read access to 0xdeadbefb in 32-bit code (0x78ca3daf).
=== debian11 (32 bit de report) ===
gdiplus: Unhandled exception: page fault on read access to 0xdeadbefb in 32-bit code (0x77203daf).
=== debian11 (32 bit fr report) ===
gdiplus: Unhandled exception: page fault on read access to 0xdeadbefb in 32-bit code (0x78e83daf).
=== debian11 (32 bit he:IL report) ===
gdiplus: Unhandled exception: page fault on read access to 0xdeadbefb in 32-bit code (0x78e83daf).
=== debian11 (32 bit hi:IN report) ===
gdiplus: Unhandled exception: page fault on read access to 0xdeadbefb in 32-bit code (0x78e83daf).
=== debian11 (32 bit ja:JP report) ===
gdiplus: Unhandled exception: page fault on read access to 0xdeadbefb in 32-bit code (0x77203daf).
=== debian11 (32 bit zh:CN report) ===
gdiplus: Unhandled exception: page fault on read access to 0xdeadbefb in 32-bit code (0x78e83daf).
=== debian11b (32 bit WoW report) ===
gdiplus: Unhandled exception: page fault on read access to 0xdeadbefb in wow64 32-bit code (0x79133daf).
=== debian11b (64 bit WoW report) ===
gdiplus: Unhandled exception: page fault on read access to 0x00000000deadbf07 in 64-bit code (0x0000007909705f).