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
548cd05c
Commit
548cd05c
authored
Aug 17, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement CopyPalette for the GIF decoder.
parent
d095d27d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
2 deletions
+37
-2
gifformat.c
dlls/windowscodecs/gifformat.c
+37
-2
No files found.
dlls/windowscodecs/gifformat.c
View file @
548cd05c
...
...
@@ -129,8 +129,43 @@ static HRESULT WINAPI GifFrameDecode_GetResolution(IWICBitmapFrameDecode *iface,
static
HRESULT
WINAPI
GifFrameDecode_CopyPalette
(
IWICBitmapFrameDecode
*
iface
,
IWICPalette
*
pIPalette
)
{
FIXME
(
"(%p,%p): stub
\n
"
,
iface
,
pIPalette
);
return
E_NOTIMPL
;
GifFrameDecode
*
This
=
(
GifFrameDecode
*
)
iface
;
WICColor
colors
[
256
];
ColorMapObject
*
cm
=
This
->
frame
->
ImageDesc
.
ColorMap
;
int
i
,
trans
;
ExtensionBlock
*
eb
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIPalette
);
if
(
!
cm
)
cm
=
This
->
parent
->
gif
->
SColorMap
;
if
(
cm
->
ColorCount
>
256
)
{
ERR
(
"GIF contains %i colors???
\n
"
,
cm
->
ColorCount
);
return
E_FAIL
;
}
for
(
i
=
0
;
i
<
cm
->
ColorCount
;
i
++
)
{
colors
[
i
]
=
0xff000000
|
/* alpha */
cm
->
Colors
[
i
].
Red
<<
16
|
cm
->
Colors
[
i
].
Green
<<
8
|
cm
->
Colors
[
i
].
Blue
;
}
/* look for the transparent color extension */
for
(
i
=
0
;
i
<
This
->
frame
->
ExtensionBlockCount
;
++
i
)
{
eb
=
This
->
frame
->
ExtensionBlocks
+
i
;
if
(
eb
->
Function
==
0xF9
&&
eb
->
ByteCount
==
4
)
{
if
((
eb
->
Bytes
[
0
]
&
1
)
==
1
)
{
trans
=
(
unsigned
char
)
eb
->
Bytes
[
3
];
colors
[
trans
]
&=
0xffffff
;
/* set alpha to 0 */
break
;
}
}
}
IWICPalette_InitializeCustom
(
pIPalette
,
colors
,
cm
->
ColorCount
);
return
S_OK
;
}
static
HRESULT
WINAPI
GifFrameDecode_CopyPixels
(
IWICBitmapFrameDecode
*
iface
,
...
...
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