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
4d53a4c9
Commit
4d53a4c9
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 GetPixel for indexed color bitmaps.
parent
3815add3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
7 deletions
+38
-7
image.c
dlls/gdiplus/image.c
+32
-1
image.c
dlls/gdiplus/tests/image.c
+6
-6
No files found.
dlls/gdiplus/image.c
View file @
4d53a4c9
...
...
@@ -94,6 +94,24 @@ GpStatus WINGDIPAPI GdipBitmapCreateApplyEffect(GpBitmap** inputBitmaps,
return
NotImplemented
;
}
static
inline
void
getpixel_1bppIndexed
(
BYTE
*
index
,
const
BYTE
*
row
,
UINT
x
)
{
*
index
=
(
row
[
x
/
8
]
>>
(
7
-
x
%
8
))
&
1
;
}
static
inline
void
getpixel_4bppIndexed
(
BYTE
*
index
,
const
BYTE
*
row
,
UINT
x
)
{
if
(
x
&
1
)
*
index
=
row
[
x
/
2
]
&
0xf
;
else
*
index
=
row
[
x
/
2
]
>>
4
;
}
static
inline
void
getpixel_8bppIndexed
(
BYTE
*
index
,
const
BYTE
*
row
,
UINT
x
)
{
*
index
=
row
[
x
];
}
static
inline
void
getpixel_16bppGrayScale
(
BYTE
*
r
,
BYTE
*
g
,
BYTE
*
b
,
BYTE
*
a
,
const
BYTE
*
row
,
UINT
x
)
{
...
...
@@ -211,6 +229,7 @@ GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap* bitmap, INT x, INT y,
ARGB
*
color
)
{
BYTE
r
,
g
,
b
,
a
;
BYTE
index
;
BYTE
*
row
;
TRACE
(
"%p %d %d %p
\n
"
,
bitmap
,
x
,
y
,
color
);
...
...
@@ -222,6 +241,15 @@ GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap* bitmap, INT x, INT y,
switch
(
bitmap
->
format
)
{
case
PixelFormat1bppIndexed
:
getpixel_1bppIndexed
(
&
index
,
row
,
x
);
break
;
case
PixelFormat4bppIndexed
:
getpixel_4bppIndexed
(
&
index
,
row
,
x
);
break
;
case
PixelFormat8bppIndexed
:
getpixel_8bppIndexed
(
&
index
,
row
,
x
);
break
;
case
PixelFormat16bppGrayScale
:
getpixel_16bppGrayScale
(
&
r
,
&
g
,
&
b
,
&
a
,
row
,
x
);
break
;
...
...
@@ -260,7 +288,10 @@ GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap* bitmap, INT x, INT y,
return
NotImplemented
;
}
*
color
=
a
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
if
(
bitmap
->
format
&
PixelFormatIndexed
)
*
color
=
bitmap
->
image
.
palette_entries
[
index
];
else
*
color
=
a
<<
24
|
r
<<
16
|
g
<<
8
|
b
;
return
Ok
;
}
...
...
dlls/gdiplus/tests/image.c
View file @
4d53a4c9
...
...
@@ -1181,8 +1181,8 @@ static void test_palette(void)
/* test getting/setting pixels */
stat
=
GdipBitmapGetPixel
(
bitmap
,
0
,
0
,
&
color
);
todo_wine
expect
(
Ok
,
stat
);
todo_wine
expect
(
0xff000000
,
color
);
expect
(
Ok
,
stat
);
expect
(
0xff000000
,
color
);
stat
=
GdipBitmapSetPixel
(
bitmap
,
0
,
1
,
0xffffffff
);
todo_wine
ok
((
stat
==
Ok
)
||
...
...
@@ -1214,8 +1214,8 @@ static void test_palette(void)
/* test getting/setting pixels */
stat
=
GdipBitmapGetPixel
(
bitmap
,
0
,
0
,
&
color
);
todo_wine
expect
(
Ok
,
stat
);
todo_wine
expect
(
0xff000000
,
color
);
expect
(
Ok
,
stat
);
expect
(
0xff000000
,
color
);
stat
=
GdipBitmapSetPixel
(
bitmap
,
0
,
1
,
0xffff00ff
);
todo_wine
ok
((
stat
==
Ok
)
||
...
...
@@ -1247,8 +1247,8 @@ static void test_palette(void)
/* test getting/setting pixels */
stat
=
GdipBitmapGetPixel
(
bitmap
,
0
,
0
,
&
color
);
todo_wine
expect
(
Ok
,
stat
);
todo_wine
expect
(
0xff000000
,
color
);
expect
(
Ok
,
stat
);
expect
(
0xff000000
,
color
);
stat
=
GdipBitmapSetPixel
(
bitmap
,
0
,
1
,
0xffcccccc
);
todo_wine
ok
((
stat
==
Ok
)
||
...
...
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