Commit 78f9177d authored by Justin Chevrier's avatar Justin Chevrier Committed by Alexandre Julliard

gdiplus: Implement GdipSetImageAttributesRemapTable with updated test.

parent 74a3945b
...@@ -264,10 +264,17 @@ struct color_matrix{ ...@@ -264,10 +264,17 @@ struct color_matrix{
ColorMatrix graymatrix; ColorMatrix graymatrix;
}; };
struct color_remap_table{
BOOL enabled;
INT mapsize;
GDIPCONST ColorMap *colormap;
};
struct GpImageAttributes{ struct GpImageAttributes{
WrapMode wrap; WrapMode wrap;
struct color_key colorkeys[ColorAdjustTypeCount]; struct color_key colorkeys[ColorAdjustTypeCount];
struct color_matrix colormatrices[ColorAdjustTypeCount]; struct color_matrix colormatrices[ColorAdjustTypeCount];
struct color_remap_table colorremaptables[ColorAdjustTypeCount];
BOOL gamma_enabled[ColorAdjustTypeCount]; BOOL gamma_enabled[ColorAdjustTypeCount];
REAL gamma[ColorAdjustTypeCount]; REAL gamma[ColorAdjustTypeCount];
}; };
......
...@@ -204,14 +204,23 @@ GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(GpImageAttributes *imageAtt ...@@ -204,14 +204,23 @@ GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(GpImageAttributes *imageAtt
ColorAdjustType type, BOOL enableFlag, UINT mapSize, ColorAdjustType type, BOOL enableFlag, UINT mapSize,
GDIPCONST ColorMap *map) GDIPCONST ColorMap *map)
{ {
static int calls;
TRACE("(%p,%u,%i,%u,%p)\n", imageAttr, type, enableFlag, mapSize, map); TRACE("(%p,%u,%i,%u,%p)\n", imageAttr, type, enableFlag, mapSize, map);
if(!(calls++)) if(!imageAttr || type >= ColorAdjustTypeCount)
FIXME("not implemented\n"); return InvalidParameter;
return NotImplemented; if (enableFlag)
{
if(!map || !mapSize)
return InvalidParameter;
imageAttr->colorremaptables[type].mapsize = mapSize;
imageAttr->colorremaptables[type].colormap = map;
}
imageAttr->colorremaptables[type].enabled = enableFlag;
return Ok;
} }
GpStatus WINGDIPAPI GdipSetImageAttributesThreshold(GpImageAttributes *imageAttr, GpStatus WINGDIPAPI GdipSetImageAttributesThreshold(GpImageAttributes *imageAttr,
......
...@@ -1760,28 +1760,28 @@ static void test_remaptable(void) ...@@ -1760,28 +1760,28 @@ static void test_remaptable(void)
map->newColor.Argb = 0xffff00ff; map->newColor.Argb = 0xffff00ff;
stat = GdipSetImageAttributesRemapTable(NULL, ColorAdjustTypeDefault, TRUE, 1, map); stat = GdipSetImageAttributesRemapTable(NULL, ColorAdjustTypeDefault, TRUE, 1, map);
todo_wine expect(InvalidParameter, stat); expect(InvalidParameter, stat);
stat = GdipCreateImageAttributes(&imageattr); stat = GdipCreateImageAttributes(&imageattr);
expect(Ok, stat); expect(Ok, stat);
stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 1, NULL); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 1, NULL);
todo_wine expect(InvalidParameter, stat); expect(InvalidParameter, stat);
stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeCount, TRUE, 1, map); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeCount, TRUE, 1, map);
todo_wine expect(InvalidParameter, stat); expect(InvalidParameter, stat);
stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeAny, TRUE, 1, map); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeAny, TRUE, 1, map);
todo_wine expect(InvalidParameter, stat); expect(InvalidParameter, stat);
stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 0, map); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 0, map);
todo_wine expect(InvalidParameter, stat); expect(InvalidParameter, stat);
stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, FALSE, 0, NULL); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, FALSE, 0, NULL);
todo_wine expect(Ok, stat); expect(Ok, stat);
stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 1, map); stat = GdipSetImageAttributesRemapTable(imageattr, ColorAdjustTypeDefault, TRUE, 1, map);
todo_wine expect(Ok, stat); expect(Ok, stat);
stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppRGB, NULL, &bitmap1); stat = GdipCreateBitmapFromScan0(1, 1, 0, PixelFormat32bppRGB, NULL, &bitmap1);
expect(Ok, stat); expect(Ok, stat);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment