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
762845ca
Commit
762845ca
authored
Jan 30, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Feb 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipSetImageAttributesGamma.
parent
c0c5ab16
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
5 deletions
+71
-5
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+2
-0
imageattributes.c
dlls/gdiplus/imageattributes.c
+6
-5
image.c
dlls/gdiplus/tests/image.c
+63
-0
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
762845ca
...
@@ -263,6 +263,8 @@ struct GpImageAttributes{
...
@@ -263,6 +263,8 @@ 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
];
BOOL
gamma_enabled
[
ColorAdjustTypeCount
];
REAL
gamma
[
ColorAdjustTypeCount
];
};
};
struct
GpFont
{
struct
GpFont
{
...
...
dlls/gdiplus/imageattributes.c
View file @
762845ca
...
@@ -149,14 +149,15 @@ GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground(GpImageAttributes *im
...
@@ -149,14 +149,15 @@ GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground(GpImageAttributes *im
GpStatus
WINGDIPAPI
GdipSetImageAttributesGamma
(
GpImageAttributes
*
imageAttr
,
GpStatus
WINGDIPAPI
GdipSetImageAttributesGamma
(
GpImageAttributes
*
imageAttr
,
ColorAdjustType
type
,
BOOL
enableFlag
,
REAL
gamma
)
ColorAdjustType
type
,
BOOL
enableFlag
,
REAL
gamma
)
{
{
static
int
calls
;
TRACE
(
"(%p,%u,%i,%0.2f)
\n
"
,
imageAttr
,
type
,
enableFlag
,
gamma
);
TRACE
(
"(%p,%u,%i,%0.2f)
\n
"
,
imageAttr
,
type
,
enableFlag
,
gamma
);
if
(
!
(
calls
++
)
)
if
(
!
imageAttr
||
(
enableFlag
&&
gamma
<=
0
.
0
)
||
type
>=
ColorAdjustTypeCount
)
FIXME
(
"not implemented
\n
"
)
;
return
InvalidParameter
;
return
NotImplemented
;
imageAttr
->
gamma_enabled
[
type
]
=
enableFlag
;
imageAttr
->
gamma
[
type
]
=
gamma
;
return
Ok
;
}
}
GpStatus
WINGDIPAPI
GdipSetImageAttributesNoOp
(
GpImageAttributes
*
imageAttr
,
GpStatus
WINGDIPAPI
GdipSetImageAttributesNoOp
(
GpImageAttributes
*
imageAttr
,
...
...
dlls/gdiplus/tests/image.c
View file @
762845ca
...
@@ -1365,6 +1365,68 @@ static void test_colormatrix(void)
...
@@ -1365,6 +1365,68 @@ static void test_colormatrix(void)
GdipDisposeImageAttributes
(
imageattr
);
GdipDisposeImageAttributes
(
imageattr
);
}
}
static
void
test_gamma
(
void
)
{
GpStatus
stat
;
GpImageAttributes
*
imageattr
;
GpBitmap
*
bitmap1
,
*
bitmap2
;
GpGraphics
*
graphics
;
ARGB
color
;
stat
=
GdipSetImageAttributesGamma
(
NULL
,
ColorAdjustTypeDefault
,
TRUE
,
1
.
0
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipCreateImageAttributes
(
&
imageattr
);
expect
(
Ok
,
stat
);
stat
=
GdipSetImageAttributesGamma
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
1
.
0
);
expect
(
Ok
,
stat
);
stat
=
GdipSetImageAttributesGamma
(
imageattr
,
ColorAdjustTypeAny
,
TRUE
,
1
.
0
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipSetImageAttributesGamma
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
-
1
.
0
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipSetImageAttributesGamma
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
0
.
0
);
expect
(
InvalidParameter
,
stat
);
stat
=
GdipSetImageAttributesGamma
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
0
.
5
);
expect
(
Ok
,
stat
);
stat
=
GdipSetImageAttributesGamma
(
imageattr
,
ColorAdjustTypeDefault
,
FALSE
,
0
.
0
);
expect
(
Ok
,
stat
);
/* Drawing a bitmap transforms the colors */
stat
=
GdipSetImageAttributesGamma
(
imageattr
,
ColorAdjustTypeDefault
,
TRUE
,
3
.
0
);
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
,
0xff80ffff
);
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
(
0xff20ffff
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap1
);
GdipDisposeImage
((
GpImage
*
)
bitmap2
);
GdipDisposeImageAttributes
(
imageattr
);
}
/* 1x1 pixel gif, 2 frames; first frame is white, second is black */
/* 1x1 pixel gif, 2 frames; first frame is white, second is black */
static
const
unsigned
char
gifanimation
[
72
]
=
{
static
const
unsigned
char
gifanimation
[
72
]
=
{
0x47
,
0x49
,
0x46
,
0x38
,
0x39
,
0x61
,
0x01
,
0x00
,
0x01
,
0x00
,
0xa1
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x47
,
0x49
,
0x46
,
0x38
,
0x39
,
0x61
,
0x01
,
0x00
,
0x01
,
0x00
,
0xa1
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
...
@@ -1533,6 +1595,7 @@ START_TEST(image)
...
@@ -1533,6 +1595,7 @@ START_TEST(image)
test_getsetpixel
();
test_getsetpixel
();
test_palette
();
test_palette
();
test_colormatrix
();
test_colormatrix
();
test_gamma
();
test_multiframegif
();
test_multiframegif
();
GdiplusShutdown
(
gdiplusToken
);
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