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
19b71b03
Commit
19b71b03
authored
Mar 24, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement gamma adjustment.
parent
805f0321
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
graphics.c
dlls/gdiplus/graphics.c
+25
-3
image.c
dlls/gdiplus/tests/image.c
+1
-1
No files found.
dlls/gdiplus/graphics.c
View file @
19b71b03
...
@@ -467,9 +467,31 @@ static void apply_image_attributes(const GpImageAttributes *attributes, LPBYTE d
...
@@ -467,9 +467,31 @@ static void apply_image_attributes(const GpImageAttributes *attributes, LPBYTE d
if
(
attributes
->
gamma_enabled
[
type
]
||
if
(
attributes
->
gamma_enabled
[
type
]
||
attributes
->
gamma_enabled
[
ColorAdjustTypeDefault
])
attributes
->
gamma_enabled
[
ColorAdjustTypeDefault
])
{
{
static
int
fixme
;
REAL
gamma
;
if
(
!
fixme
++
)
FIXME
(
"Gamma adjustment not implemented
\n
"
);
if
(
attributes
->
gamma_enabled
[
type
])
gamma
=
attributes
->
gamma
[
type
];
else
gamma
=
attributes
->
gamma
[
ColorAdjustTypeDefault
];
for
(
x
=
0
;
x
<
width
;
x
++
)
for
(
y
=
0
;
y
<
height
;
y
++
)
{
ARGB
*
src_color
;
BYTE
blue
,
green
,
red
;
src_color
=
(
ARGB
*
)(
data
+
stride
*
y
+
sizeof
(
ARGB
)
*
x
);
blue
=
*
src_color
&
0xff
;
green
=
(
*
src_color
>>
8
)
&
0xff
;
red
=
(
*
src_color
>>
16
)
&
0xff
;
/* FIXME: We should probably use a table for this. */
blue
=
floorf
(
powf
(
blue
/
255
.
0
,
gamma
)
*
255
.
0
);
green
=
floorf
(
powf
(
green
/
255
.
0
,
gamma
)
*
255
.
0
);
red
=
floorf
(
powf
(
red
/
255
.
0
,
gamma
)
*
255
.
0
);
*
src_color
=
(
*
src_color
&
0xff000000
)
|
(
red
<<
16
)
|
(
green
<<
8
)
|
blue
;
}
}
}
}
}
...
...
dlls/gdiplus/tests/image.c
View file @
19b71b03
...
@@ -2085,7 +2085,7 @@ static void test_gamma(void)
...
@@ -2085,7 +2085,7 @@ static void test_gamma(void)
stat
=
GdipBitmapGetPixel
(
bitmap2
,
0
,
0
,
&
color
);
stat
=
GdipBitmapGetPixel
(
bitmap2
,
0
,
0
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
Ok
,
stat
);
todo_wine
ok
(
color_match
(
0xff20ffff
,
color
,
1
),
"Expected ff20ffff, got %.8x
\n
"
,
color
);
ok
(
color_match
(
0xff20ffff
,
color
,
1
),
"Expected ff20ffff, got %.8x
\n
"
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap1
);
GdipDisposeImage
((
GpImage
*
)
bitmap1
);
...
...
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