Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7fbf0dee
Commit
7fbf0dee
authored
Jun 13, 2016
by
Vincent Povirk
Committed by
Alexandre Julliard
Jun 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipGetImageAttributesAdjustedPalette.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e06bbf0d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
88 additions
and
2 deletions
+88
-2
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+3
-0
graphics.c
dlls/gdiplus/graphics.c
+1
-1
imageattributes.c
dlls/gdiplus/imageattributes.c
+15
-0
image.c
dlls/gdiplus/tests/image.c
+66
-0
gdiplusflat.h
include/gdiplusflat.h
+2
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
7fbf0dee
...
@@ -264,7 +264,7 @@
...
@@ -264,7 +264,7 @@
264 stdcall GdipGetHatchForegroundColor(ptr ptr)
264 stdcall GdipGetHatchForegroundColor(ptr ptr)
265 stdcall GdipGetHatchStyle(ptr ptr)
265 stdcall GdipGetHatchStyle(ptr ptr)
266 stdcall GdipGetHemfFromMetafile(ptr ptr)
266 stdcall GdipGetHemfFromMetafile(ptr ptr)
267 st
ub GdipGetImageAttributesAdjustedPalette
267 st
dcall GdipGetImageAttributesAdjustedPalette(ptr ptr long)
268 stdcall GdipGetImageBounds(ptr ptr ptr)
268 stdcall GdipGetImageBounds(ptr ptr ptr)
269 stdcall GdipGetImageDecoders(long long ptr)
269 stdcall GdipGetImageDecoders(long long ptr)
270 stdcall GdipGetImageDecodersSize(ptr ptr)
270 stdcall GdipGetImageDecodersSize(ptr ptr)
...
...
dlls/gdiplus/gdiplus_private.h
View file @
7fbf0dee
...
@@ -176,6 +176,9 @@ extern GpStatus convert_pixels(INT width, INT height,
...
@@ -176,6 +176,9 @@ extern GpStatus convert_pixels(INT width, INT height,
INT
dst_stride
,
BYTE
*
dst_bits
,
PixelFormat
dst_format
,
INT
dst_stride
,
BYTE
*
dst_bits
,
PixelFormat
dst_format
,
INT
src_stride
,
const
BYTE
*
src_bits
,
PixelFormat
src_format
,
ColorPalette
*
palette
)
DECLSPEC_HIDDEN
;
INT
src_stride
,
const
BYTE
*
src_bits
,
PixelFormat
src_format
,
ColorPalette
*
palette
)
DECLSPEC_HIDDEN
;
extern
PixelFormat
apply_image_attributes
(
const
GpImageAttributes
*
attributes
,
LPBYTE
data
,
UINT
width
,
UINT
height
,
INT
stride
,
ColorAdjustType
type
,
PixelFormat
fmt
)
DECLSPEC_HIDDEN
;
struct
GpMatrix
{
struct
GpMatrix
{
REAL
matrix
[
6
];
REAL
matrix
[
6
];
};
};
...
...
dlls/gdiplus/graphics.c
View file @
7fbf0dee
...
@@ -661,7 +661,7 @@ static BOOL color_is_gray(ARGB color)
...
@@ -661,7 +661,7 @@ static BOOL color_is_gray(ARGB color)
}
}
/* returns preferred pixel format for the applied attributes */
/* returns preferred pixel format for the applied attributes */
static
PixelFormat
apply_image_attributes
(
const
GpImageAttributes
*
attributes
,
LPBYTE
data
,
PixelFormat
apply_image_attributes
(
const
GpImageAttributes
*
attributes
,
LPBYTE
data
,
UINT
width
,
UINT
height
,
INT
stride
,
ColorAdjustType
type
,
PixelFormat
fmt
)
UINT
width
,
UINT
height
,
INT
stride
,
ColorAdjustType
type
,
PixelFormat
fmt
)
{
{
UINT
x
,
y
;
UINT
x
,
y
;
...
...
dlls/gdiplus/imageattributes.c
View file @
7fbf0dee
...
@@ -77,6 +77,21 @@ GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes *imageattr)
...
@@ -77,6 +77,21 @@ GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes *imageattr)
return
Ok
;
return
Ok
;
}
}
GpStatus
WINGDIPAPI
GdipGetImageAttributesAdjustedPalette
(
GpImageAttributes
*
imageattr
,
ColorPalette
*
palette
,
ColorAdjustType
type
)
{
TRACE
(
"(%p,%p,%u)
\n
"
,
imageattr
,
palette
,
type
);
if
(
!
imageattr
||
!
palette
||
!
palette
->
Count
||
type
>=
ColorAdjustTypeCount
||
type
==
ColorAdjustTypeDefault
)
return
InvalidParameter
;
apply_image_attributes
(
imageattr
,
(
LPBYTE
)
palette
->
Entries
,
palette
->
Count
,
1
,
0
,
type
,
PixelFormat32bppARGB
);
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipSetImageAttributesColorKeys
(
GpImageAttributes
*
imageattr
,
GpStatus
WINGDIPAPI
GdipSetImageAttributesColorKeys
(
GpImageAttributes
*
imageattr
,
ColorAdjustType
type
,
BOOL
enableFlag
,
ARGB
colorLow
,
ARGB
colorHigh
)
ColorAdjustType
type
,
BOOL
enableFlag
,
ARGB
colorLow
,
ARGB
colorHigh
)
{
{
...
...
dlls/gdiplus/tests/image.c
View file @
7fbf0dee
...
@@ -4725,6 +4725,71 @@ static void test_createeffect(void)
...
@@ -4725,6 +4725,71 @@ static void test_createeffect(void)
}
}
}
}
static
void
test_getadjustedpalette
(
void
)
{
ColorMap
colormap
;
GpImageAttributes
*
imageattributes
;
ColorPalette
*
palette
;
GpStatus
stat
;
stat
=
GdipCreateImageAttributes
(
&
imageattributes
);
expect
(
Ok
,
stat
);
colormap
.
oldColor
.
Argb
=
0xffffff00
;
colormap
.
newColor
.
Argb
=
0xffff00ff
;
stat
=
GdipSetImageAttributesRemapTable
(
imageattributes
,
ColorAdjustTypeBitmap
,
TRUE
,
1
,
&
colormap
);
expect
(
Ok
,
stat
);
colormap
.
oldColor
.
Argb
=
0xffffff80
;
colormap
.
newColor
.
Argb
=
0xffff80ff
;
stat
=
GdipSetImageAttributesRemapTable
(
imageattributes
,
ColorAdjustTypeDefault
,
TRUE
,
1
,
&
colormap
);
expect
(
Ok
,
stat
);
palette
=
GdipAlloc
(
sizeof
(
*
palette
)
+
sizeof
(
ARGB
)
*
2
);
palette
->
Count
=
0
;
stat
=
GdipGetImageAttributesAdjustedPalette
(
imageattributes
,
palette
,
ColorAdjustTypeBitmap
);
expect
(
InvalidParameter
,
stat
);
palette
->
Count
=
3
;
palette
->
Entries
[
0
]
=
0xffffff00
;
palette
->
Entries
[
1
]
=
0xffffff80
;
palette
->
Entries
[
2
]
=
0xffffffff
;
stat
=
GdipGetImageAttributesAdjustedPalette
(
imageattributes
,
palette
,
ColorAdjustTypeBitmap
);
expect
(
Ok
,
stat
);
expect
(
0xffff00ff
,
palette
->
Entries
[
0
]);
expect
(
0xffffff80
,
palette
->
Entries
[
1
]);
expect
(
0xffffffff
,
palette
->
Entries
[
2
]);
palette
->
Entries
[
0
]
=
0xffffff00
;
palette
->
Entries
[
1
]
=
0xffffff80
;
palette
->
Entries
[
2
]
=
0xffffffff
;
stat
=
GdipGetImageAttributesAdjustedPalette
(
imageattributes
,
palette
,
ColorAdjustTypeBrush
);
expect
(
Ok
,
stat
);
expect
(
0xffffff00
,
palette
->
Entries
[
0
]);
expect
(
0xffff80ff
,
palette
->
Entries
[
1
]);
expect
(
0xffffffff
,
palette
->
Entries
[
2
]);
stat
=
GdipGetImageAttributesAdjustedPalette
(
NULL
,
palette
,
ColorAdjustTypeBitmap
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipGetImageAttributesAdjustedPalette
(
imageattributes
,
NULL
,
ColorAdjustTypeBitmap
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipGetImageAttributesAdjustedPalette
(
imageattributes
,
palette
,
-
1
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipGetImageAttributesAdjustedPalette
(
imageattributes
,
palette
,
ColorAdjustTypeDefault
);
expect
(
InvalidParameter
,
stat
);
GdipFree
(
palette
);
GdipDisposeImageAttributes
(
imageattributes
);
}
START_TEST
(
image
)
START_TEST
(
image
)
{
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
@@ -4782,6 +4847,7 @@ START_TEST(image)
...
@@ -4782,6 +4847,7 @@ START_TEST(image)
test_colorkey
();
test_colorkey
();
test_dispose
();
test_dispose
();
test_createeffect
();
test_createeffect
();
test_getadjustedpalette
();
GdiplusShutdown
(
gdiplusToken
);
GdiplusShutdown
(
gdiplusToken
);
}
}
include/gdiplusflat.h
View file @
7fbf0dee
...
@@ -436,6 +436,8 @@ GpStatus WINGDIPAPI GdipSetPropertyItem(GpImage*,GDIPCONST PropertyItem*);
...
@@ -436,6 +436,8 @@ GpStatus WINGDIPAPI GdipSetPropertyItem(GpImage*,GDIPCONST PropertyItem*);
/* ImageAttributes */
/* ImageAttributes */
GpStatus
WINGDIPAPI
GdipCreateImageAttributes
(
GpImageAttributes
**
);
GpStatus
WINGDIPAPI
GdipCreateImageAttributes
(
GpImageAttributes
**
);
GpStatus
WINGDIPAPI
GdipDisposeImageAttributes
(
GpImageAttributes
*
);
GpStatus
WINGDIPAPI
GdipDisposeImageAttributes
(
GpImageAttributes
*
);
GpStatus
WINGDIPAPI
GdipGetImageAttributesAdjustedPalette
(
GpImageAttributes
*
,
ColorPalette
*
,
ColorAdjustType
);
GpStatus
WINGDIPAPI
GdipSetImageAttributesCachedBackground
(
GpImageAttributes
*
,
GpStatus
WINGDIPAPI
GdipSetImageAttributesCachedBackground
(
GpImageAttributes
*
,
BOOL
);
BOOL
);
GpStatus
WINGDIPAPI
GdipSetImageAttributesColorKeys
(
GpImageAttributes
*
,
GpStatus
WINGDIPAPI
GdipSetImageAttributesColorKeys
(
GpImageAttributes
*
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment