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
18520f2e
Commit
18520f2e
authored
Nov 14, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Nov 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Calculate the min/max color component intensities for 17 glyph levels.
parent
f284f597
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
0 deletions
+57
-0
dc.c
dlls/gdi32/dibdrv/dc.c
+1
-0
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+9
-0
graphics.c
dlls/gdi32/dibdrv/graphics.c
+47
-0
No files found.
dlls/gdi32/dibdrv/dc.c
View file @
18520f2e
...
@@ -528,6 +528,7 @@ static COLORREF dibdrv_SetTextColor( PHYSDEV dev, COLORREF color )
...
@@ -528,6 +528,7 @@ static COLORREF dibdrv_SetTextColor( PHYSDEV dev, COLORREF color )
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
dibdrv_physdev
*
pdev
=
get_dibdrv_pdev
(
dev
);
pdev
->
text_color
=
get_pixel_color
(
pdev
,
color
,
TRUE
);
pdev
->
text_color
=
get_pixel_color
(
pdev
,
color
,
TRUE
);
update_aa_ranges
(
pdev
);
return
next
->
funcs
->
pSetTextColor
(
next
,
color
);
return
next
->
funcs
->
pSetTextColor
(
next
,
color
);
}
}
...
...
dlls/gdi32/dibdrv/dibdrv.h
View file @
18520f2e
...
@@ -67,6 +67,13 @@ typedef struct
...
@@ -67,6 +67,13 @@ typedef struct
void
*
xor
;
void
*
xor
;
}
rop_mask_bits
;
}
rop_mask_bits
;
struct
intensity_range
{
BYTE
r_min
,
r_max
;
BYTE
g_min
,
g_max
;
BYTE
b_min
,
b_max
;
};
typedef
struct
dibdrv_physdev
typedef
struct
dibdrv_physdev
{
{
struct
gdi_physdev
dev
;
struct
gdi_physdev
dev
;
...
@@ -100,6 +107,7 @@ typedef struct dibdrv_physdev
...
@@ -100,6 +107,7 @@ typedef struct dibdrv_physdev
/* text */
/* text */
DWORD
text_color
;
DWORD
text_color
;
struct
intensity_range
glyph_intensities
[
17
];
}
dibdrv_physdev
;
}
dibdrv_physdev
;
#define DEFER_FORMAT 1
#define DEFER_FORMAT 1
...
@@ -218,6 +226,7 @@ extern HRGN add_extra_clipping_region( dibdrv_physdev *pdev, HRGN rgn ) DECLSPEC
...
@@ -218,6 +226,7 @@ extern HRGN add_extra_clipping_region( dibdrv_physdev *pdev, HRGN rgn ) DECLSPEC
extern
void
restore_clipping_region
(
dibdrv_physdev
*
pdev
,
HRGN
rgn
)
DECLSPEC_HIDDEN
;
extern
void
restore_clipping_region
(
dibdrv_physdev
*
pdev
,
HRGN
rgn
)
DECLSPEC_HIDDEN
;
extern
int
clip_line
(
const
POINT
*
start
,
const
POINT
*
end
,
const
RECT
*
clip
,
extern
int
clip_line
(
const
POINT
*
start
,
const
POINT
*
end
,
const
RECT
*
clip
,
const
bres_params
*
params
,
POINT
*
pt1
,
POINT
*
pt2
)
DECLSPEC_HIDDEN
;
const
bres_params
*
params
,
POINT
*
pt1
,
POINT
*
pt2
)
DECLSPEC_HIDDEN
;
extern
void
update_aa_ranges
(
dibdrv_physdev
*
pdev
)
DECLSPEC_HIDDEN
;
static
inline
BOOL
defer_pen
(
dibdrv_physdev
*
pdev
)
static
inline
BOOL
defer_pen
(
dibdrv_physdev
*
pdev
)
{
{
...
...
dlls/gdi32/dibdrv/graphics.c
View file @
18520f2e
...
@@ -56,6 +56,53 @@ static RECT get_device_rect( HDC hdc, int left, int top, int right, int bottom,
...
@@ -56,6 +56,53 @@ static RECT get_device_rect( HDC hdc, int left, int top, int right, int bottom,
return
rect
;
return
rect
;
}
}
/* Intensities of the 17 glyph levels when drawn with text component of 0xff on a
black bkgnd. [A log-log plot of these data gives: y = 77.05 * x^0.4315]. */
static
const
BYTE
ramp
[
17
]
=
{
0
,
0x4d
,
0x68
,
0x7c
,
0x8c
,
0x9a
,
0xa7
,
0xb2
,
0xbd
,
0xc7
,
0xd0
,
0xd9
,
0xe1
,
0xe9
,
0xf0
,
0xf8
,
0xff
};
/* For a give text-color component and a glyph level, calculate the
range of dst intensities, the min/max corresponding to 0/0xff bkgnd
components respectively.
The minimum is a linear interpolation between 0 and the value in
the ramp table.
The maximum is a linear interpolation between the value from the
ramp table read in reverse and 0xff.
To find the resulting pixel intensity, we note that if the text and
bkgnd intensities are the same then the result must be that
intensity. Otherwise we linearly interpolate between either the
min or the max value and this intermediate value depending on which
side of the inequality we lie.
*/
static
inline
void
get_range
(
BYTE
aa
,
DWORD
text_comp
,
BYTE
*
min_comp
,
BYTE
*
max_comp
)
{
*
min_comp
=
(
ramp
[
aa
]
*
text_comp
)
/
0xff
;
*
max_comp
=
ramp
[
16
-
aa
]
+
((
0xff
-
ramp
[
16
-
aa
])
*
text_comp
)
/
0xff
;
}
void
update_aa_ranges
(
dibdrv_physdev
*
pdev
)
{
int
i
;
COLORREF
text
=
pdev
->
dib
.
funcs
->
pixel_to_colorref
(
&
pdev
->
dib
,
pdev
->
text_color
);
for
(
i
=
0
;
i
<
17
;
i
++
)
{
get_range
(
i
,
GetRValue
(
text
),
&
pdev
->
glyph_intensities
[
i
].
r_min
,
&
pdev
->
glyph_intensities
[
i
].
r_max
);
get_range
(
i
,
GetGValue
(
text
),
&
pdev
->
glyph_intensities
[
i
].
g_min
,
&
pdev
->
glyph_intensities
[
i
].
g_max
);
get_range
(
i
,
GetBValue
(
text
),
&
pdev
->
glyph_intensities
[
i
].
b_min
,
&
pdev
->
glyph_intensities
[
i
].
b_max
);
}
}
/**********************************************************************
/**********************************************************************
* get_text_bkgnd_masks
* get_text_bkgnd_masks
*
*
...
...
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