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
e743a7a8
Commit
e743a7a8
authored
Aug 20, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement CopyPixels for 1-bit ICO icons.
parent
a65010aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
icoformat.c
dlls/windowscodecs/icoformat.c
+56
-0
No files found.
dlls/windowscodecs/icoformat.c
View file @
e743a7a8
...
...
@@ -203,6 +203,62 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This)
/* read the XOR data */
switch
(
This
->
entry
.
wBitCount
)
{
case
1
:
{
UINT
xorBytesPerRow
=
(
width
+
31
)
/
32
*
4
;
UINT
xorBytes
=
xorBytesPerRow
*
height
;
INT
xorStride
;
BYTE
*
xorRow
;
BYTE
*
bitsRow
;
UINT
x
,
y
;
tempdata
=
HeapAlloc
(
GetProcessHeap
(),
0
,
xorBytes
);
if
(
!
tempdata
)
{
hr
=
E_OUTOFMEMORY
;
goto
fail
;
}
hr
=
IStream_Read
(
This
->
parent
->
stream
,
tempdata
,
xorBytes
,
&
bytesread
);
if
(
FAILED
(
hr
)
||
bytesread
!=
xorBytes
)
goto
fail
;
if
(
bih
.
biHeight
>
0
)
/* bottom-up DIB */
{
xorStride
=
-
xorBytesPerRow
;
xorRow
=
tempdata
+
(
height
-
1
)
*
xorBytesPerRow
;
}
else
/* top-down DIB */
{
xorStride
=
xorBytesPerRow
;
xorRow
=
tempdata
;
}
bits
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bitsSize
);
/* palette-map the 1-bit data */
bitsRow
=
bits
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
BYTE
*
xorByte
=
xorRow
;
DWORD
*
bitsPixel
=
(
DWORD
*
)
bitsRow
;
for
(
x
=
0
;
x
<
width
;
x
+=
8
)
{
BYTE
xorVal
;
xorVal
=*
xorByte
++
;
*
bitsPixel
++
=
colors
[
xorVal
>>
7
];
if
(
x
+
1
<
width
)
*
bitsPixel
++
=
colors
[
xorVal
>>
6
&
1
];
if
(
x
+
2
<
width
)
*
bitsPixel
++
=
colors
[
xorVal
>>
5
&
1
];
if
(
x
+
3
<
width
)
*
bitsPixel
++
=
colors
[
xorVal
>>
4
&
1
];
if
(
x
+
4
<
width
)
*
bitsPixel
++
=
colors
[
xorVal
>>
3
&
1
];
if
(
x
+
5
<
width
)
*
bitsPixel
++
=
colors
[
xorVal
>>
2
&
1
];
if
(
x
+
6
<
width
)
*
bitsPixel
++
=
colors
[
xorVal
>>
1
&
1
];
if
(
x
+
7
<
width
)
*
bitsPixel
++
=
colors
[
xorVal
&
1
];
}
xorRow
+=
xorStride
;
bitsRow
+=
bitsStride
;
}
HeapFree
(
GetProcessHeap
(),
0
,
tempdata
);
break
;
}
case
4
:
{
UINT
xorBytesPerRow
=
(
width
+
7
)
/
8
*
4
;
...
...
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