Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
54800a80
Commit
54800a80
authored
Sep 24, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 24, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement IWICBitmapDecoder_CopyPalette for the GIF decoder.
parent
af8b90c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
8 deletions
+29
-8
gifformat.c
dlls/windowscodecs/gifformat.c
+27
-4
gifformat.c
dlls/windowscodecs/tests/gifformat.c
+2
-4
No files found.
dlls/windowscodecs/gifformat.c
View file @
54800a80
...
...
@@ -1165,11 +1165,34 @@ static HRESULT WINAPI GifDecoder_GetDecoderInfo(IWICBitmapDecoder *iface,
return
hr
;
}
static
HRESULT
WINAPI
GifDecoder_CopyPalette
(
IWICBitmapDecoder
*
iface
,
IWICPalette
*
pIPalette
)
static
HRESULT
WINAPI
GifDecoder_CopyPalette
(
IWICBitmapDecoder
*
iface
,
IWICPalette
*
palette
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIPalette
);
return
WINCODEC_ERR_FRAMEMISSING
;
GifDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
);
WICColor
colors
[
256
];
ColorMapObject
*
cm
;
int
i
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
palette
);
cm
=
This
->
gif
->
SColorMap
;
if
(
!
cm
)
return
WINCODEC_ERR_FRAMEMISSING
;
if
(
cm
->
ColorCount
>
256
)
{
ERR
(
"GIF contains invalid number of colors: %d
\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
;
}
/* FIXME: transparent color? */
return
IWICPalette_InitializeCustom
(
palette
,
colors
,
cm
->
ColorCount
);
}
static
HRESULT
WINAPI
GifDecoder_GetMetadataQueryReader
(
IWICBitmapDecoder
*
iface
,
...
...
dlls/windowscodecs/tests/gifformat.c
View file @
54800a80
...
...
@@ -103,23 +103,21 @@ static void test_global_gif_palette(void)
/* global palette */
hr
=
IWICBitmapDecoder_CopyPalette
(
decoder
,
palette
);
todo_wine
ok
(
hr
==
S_OK
,
"CopyPalette error %#x
\n
"
,
hr
);
hr
=
IWICPalette_GetColorCount
(
palette
,
&
count
);
ok
(
hr
==
S_OK
,
"GetColorCount error %#x
\n
"
,
hr
);
todo_wine
ok
(
count
==
4
,
"expected 4, got %u
\n
"
,
count
);
hr
=
IWICPalette_GetColors
(
palette
,
count
,
color
,
&
ret
);
ok
(
hr
==
S_OK
,
"GetColors error %#x
\n
"
,
hr
);
ok
(
ret
==
count
,
"expected %u, got %u
\n
"
,
count
,
ret
);
todo_wine
{
ok
(
color
[
0
]
==
0xff010203
,
"expected 0xff010203, got %#x
\n
"
,
color
[
0
]);
todo_wine
ok
(
color
[
1
]
==
0x00040506
,
"expected 0x00040506, got %#x
\n
"
,
color
[
1
]);
ok
(
color
[
2
]
==
0xff070809
,
"expected 0xff070809, got %#x
\n
"
,
color
[
2
]);
ok
(
color
[
3
]
==
0xff0a0b0c
,
"expected 0xff0a0b0c, got %#x
\n
"
,
color
[
3
]);
}
/* frame palette */
hr
=
IWICBitmapDecoder_GetFrame
(
decoder
,
0
,
&
frame
);
ok
(
hr
==
S_OK
,
"GetFrame error %#x
\n
"
,
hr
);
...
...
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