Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
70bdc43c
Commit
70bdc43c
authored
Dec 18, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Dec 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add a test for GdipSetImageAttributesColorMatrix.
parent
149c44eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
104 additions
and
0 deletions
+104
-0
image.c
dlls/gdiplus/tests/image.c
+104
-0
No files found.
dlls/gdiplus/tests/image.c
View file @
70bdc43c
...
...
@@ -1092,6 +1092,109 @@ static void test_palette(void)
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
static
void
test_colormatrix
(
void
)
{
GpStatus
stat
;
ColorMatrix
colormatrix
,
graymatrix
;
GpImageAttributes
*
imageattr
;
const
ColorMatrix
identity
=
{{
{
1
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
},
{
0
.
0
,
1
.
0
,
0
.
0
,
0
.
0
,
0
.
0
},
{
0
.
0
,
0
.
0
,
1
.
0
,
0
.
0
,
0
.
0
},
{
0
.
0
,
0
.
0
,
0
.
0
,
1
.
0
,
0
.
0
},
{
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
1
.
0
}}};
const
ColorMatrix
double_red
=
{{
{
2
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
},
{
0
.
0
,
1
.
0
,
0
.
0
,
0
.
0
,
0
.
0
},
{
0
.
0
,
0
.
0
,
1
.
0
,
0
.
0
,
0
.
0
},
{
0
.
0
,
0
.
0
,
0
.
0
,
1
.
0
,
0
.
0
},
{
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
1
.
0
}}};
GpBitmap
*
bitmap1
,
*
bitmap2
;
GpGraphics
*
graphics
;
ARGB
color
;
colormatrix
=
identity
;
graymatrix
=
identity
;
stat
=
GdipSetImageAttributesColorMatrix
(
NULL
,
ColorAdjustTypeDefault
,
TRUE
,
&
colormatrix
,
&
graymatrix
,
ColorMatrixFlagsDefault
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipCreateImageAttributes
(
&
imageattr
);
expect
(
Ok
,
stat
);
stat
=
GdipSetImageAttributesColorMatrix
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
&
colormatrix
,
NULL
,
ColorMatrixFlagsDefault
);
todo_wine
expect
(
Ok
,
stat
);
stat
=
GdipSetImageAttributesColorMatrix
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
NULL
,
NULL
,
ColorMatrixFlagsDefault
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipSetImageAttributesColorMatrix
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
&
colormatrix
,
&
graymatrix
,
ColorMatrixFlagsDefault
);
todo_wine
expect
(
Ok
,
stat
);
stat
=
GdipSetImageAttributesColorMatrix
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
&
colormatrix
,
NULL
,
ColorMatrixFlagsSkipGrays
);
todo_wine
expect
(
Ok
,
stat
);
stat
=
GdipSetImageAttributesColorMatrix
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
&
colormatrix
,
NULL
,
ColorMatrixFlagsAltGray
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipSetImageAttributesColorMatrix
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
&
colormatrix
,
&
graymatrix
,
ColorMatrixFlagsAltGray
);
todo_wine
expect
(
Ok
,
stat
);
stat
=
GdipSetImageAttributesColorMatrix
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
&
colormatrix
,
&
graymatrix
,
3
);
todo_wine
expect
(
InvalidParameter
,
stat
);
stat
=
GdipSetImageAttributesColorMatrix
(
imageattr
,
ColorAdjustTypeCount
,
TRUE
,
&
colormatrix
,
&
graymatrix
,
ColorMatrixFlagsDefault
);
todo_wine
expect
(
InvalidParameter
,
stat
);
stat
=
GdipSetImageAttributesColorMatrix
(
imageattr
,
ColorAdjustTypeAny
,
TRUE
,
&
colormatrix
,
&
graymatrix
,
ColorMatrixFlagsDefault
);
todo_wine
expect
(
InvalidParameter
,
stat
);
stat
=
GdipSetImageAttributesColorMatrix
(
imageattr
,
ColorAdjustTypeDefault
,
FALSE
,
NULL
,
NULL
,
ColorMatrixFlagsDefault
);
todo_wine
expect
(
Ok
,
stat
);
/* Drawing a bitmap transforms the colors */
colormatrix
=
double_red
;
stat
=
GdipSetImageAttributesColorMatrix
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
&
colormatrix
,
NULL
,
ColorMatrixFlagsDefault
);
todo_wine
expect
(
Ok
,
stat
);
stat
=
GdipCreateBitmapFromScan0
(
1
,
1
,
0
,
PixelFormat32bppRGB
,
NULL
,
&
bitmap1
);
expect
(
Ok
,
stat
);
stat
=
GdipCreateBitmapFromScan0
(
1
,
1
,
0
,
PixelFormat32bppRGB
,
NULL
,
&
bitmap2
);
expect
(
Ok
,
stat
);
stat
=
GdipBitmapSetPixel
(
bitmap1
,
0
,
0
,
0xff40ffff
);
expect
(
Ok
,
stat
);
stat
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap2
,
&
graphics
);
expect
(
Ok
,
stat
);
stat
=
GdipDrawImageRectRectI
(
graphics
,
(
GpImage
*
)
bitmap1
,
0
,
0
,
1
,
1
,
0
,
0
,
1
,
1
,
UnitPixel
,
imageattr
,
NULL
,
NULL
);
expect
(
Ok
,
stat
);
stat
=
GdipBitmapGetPixel
(
bitmap2
,
0
,
0
,
&
color
);
expect
(
Ok
,
stat
);
todo_wine
expect
(
0xff80ffff
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap1
);
GdipDisposeImage
((
GpImage
*
)
bitmap2
);
GdipDisposeImageAttributes
(
imageattr
);
}
START_TEST
(
image
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -1120,6 +1223,7 @@ START_TEST(image)
test_createhbitmap
();
test_getsetpixel
();
test_palette
();
test_colormatrix
();
GdiplusShutdown
(
gdiplusToken
);
}
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