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
8d8dd3de
Commit
8d8dd3de
authored
Nov 29, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Standardize the COM usage in gifformat.c.
parent
1881db6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
17 deletions
+27
-17
gifformat.c
dlls/windowscodecs/gifformat.c
+27
-17
No files found.
dlls/windowscodecs/gifformat.c
View file @
8d8dd3de
...
...
@@ -36,7 +36,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wincodecs
);
typedef
struct
{
const
IWICBitmapDecoderVtbl
*
lpVtbl
;
IWICBitmapDecoder
IWICBitmapDecoder_iface
;
LONG
ref
;
BOOL
initialized
;
GifFileType
*
gif
;
...
...
@@ -44,16 +44,26 @@ typedef struct {
}
GifDecoder
;
typedef
struct
{
const
IWICBitmapFrameDecodeVtbl
*
lpVtbl
;
IWICBitmapFrameDecode
IWICBitmapFrameDecode_iface
;
LONG
ref
;
SavedImage
*
frame
;
GifDecoder
*
parent
;
}
GifFrameDecode
;
static
inline
GifDecoder
*
impl_from_IWICBitmapDecoder
(
IWICBitmapDecoder
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
GifDecoder
,
IWICBitmapDecoder_iface
);
}
static
inline
GifFrameDecode
*
impl_from_IWICBitmapFrameDecode
(
IWICBitmapFrameDecode
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
GifFrameDecode
,
IWICBitmapFrameDecode_iface
);
}
static
HRESULT
WINAPI
GifFrameDecode_QueryInterface
(
IWICBitmapFrameDecode
*
iface
,
REFIID
iid
,
void
**
ppv
)
{
GifFrameDecode
*
This
=
(
GifFrameDecode
*
)
iface
;
GifFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
if
(
!
ppv
)
return
E_INVALIDARG
;
...
...
@@ -76,7 +86,7 @@ static HRESULT WINAPI GifFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface
static
ULONG
WINAPI
GifFrameDecode_AddRef
(
IWICBitmapFrameDecode
*
iface
)
{
GifFrameDecode
*
This
=
(
GifFrameDecode
*
)
iface
;
GifFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
...
@@ -86,7 +96,7 @@ static ULONG WINAPI GifFrameDecode_AddRef(IWICBitmapFrameDecode *iface)
static
ULONG
WINAPI
GifFrameDecode_Release
(
IWICBitmapFrameDecode
*
iface
)
{
GifFrameDecode
*
This
=
(
GifFrameDecode
*
)
iface
;
GifFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
...
@@ -103,7 +113,7 @@ static ULONG WINAPI GifFrameDecode_Release(IWICBitmapFrameDecode *iface)
static
HRESULT
WINAPI
GifFrameDecode_GetSize
(
IWICBitmapFrameDecode
*
iface
,
UINT
*
puiWidth
,
UINT
*
puiHeight
)
{
GifFrameDecode
*
This
=
(
GifFrameDecode
*
)
iface
;
GifFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
TRACE
(
"(%p,%p,%p)
\n
"
,
iface
,
puiWidth
,
puiHeight
);
*
puiWidth
=
This
->
frame
->
ImageDesc
.
Width
;
...
...
@@ -123,7 +133,7 @@ static HRESULT WINAPI GifFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface
static
HRESULT
WINAPI
GifFrameDecode_GetResolution
(
IWICBitmapFrameDecode
*
iface
,
double
*
pDpiX
,
double
*
pDpiY
)
{
GifFrameDecode
*
This
=
(
GifFrameDecode
*
)
iface
;
GifFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
const
GifWord
aspect_word
=
This
->
parent
->
gif
->
SAspectRatio
;
const
double
aspect
=
(
aspect_word
>
0
)
?
((
aspect_word
+
15
.
0
)
/
64
.
0
)
:
1
.
0
;
TRACE
(
"(%p,%p,%p)
\n
"
,
iface
,
pDpiX
,
pDpiY
);
...
...
@@ -137,7 +147,7 @@ static HRESULT WINAPI GifFrameDecode_GetResolution(IWICBitmapFrameDecode *iface,
static
HRESULT
WINAPI
GifFrameDecode_CopyPalette
(
IWICBitmapFrameDecode
*
iface
,
IWICPalette
*
pIPalette
)
{
GifFrameDecode
*
This
=
(
GifFrameDecode
*
)
iface
;
GifFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
WICColor
colors
[
256
];
ColorMapObject
*
cm
=
This
->
frame
->
ImageDesc
.
ColorMap
;
int
i
,
trans
;
...
...
@@ -229,7 +239,7 @@ static HRESULT copy_interlaced_pixels(const BYTE *srcbuffer,
static
HRESULT
WINAPI
GifFrameDecode_CopyPixels
(
IWICBitmapFrameDecode
*
iface
,
const
WICRect
*
prc
,
UINT
cbStride
,
UINT
cbBufferSize
,
BYTE
*
pbBuffer
)
{
GifFrameDecode
*
This
=
(
GifFrameDecode
*
)
iface
;
GifFrameDecode
*
This
=
impl_from_IWICBitmapFrameDecode
(
iface
)
;
TRACE
(
"(%p,%p,%u,%u,%p)
\n
"
,
iface
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
if
(
This
->
frame
->
ImageDesc
.
Interlace
)
...
...
@@ -284,7 +294,7 @@ static const IWICBitmapFrameDecodeVtbl GifFrameDecode_Vtbl = {
static
HRESULT
WINAPI
GifDecoder_QueryInterface
(
IWICBitmapDecoder
*
iface
,
REFIID
iid
,
void
**
ppv
)
{
GifDecoder
*
This
=
(
GifDecoder
*
)
iface
;
GifDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
if
(
!
ppv
)
return
E_INVALIDARG
;
...
...
@@ -305,7 +315,7 @@ static HRESULT WINAPI GifDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID
static
ULONG
WINAPI
GifDecoder_AddRef
(
IWICBitmapDecoder
*
iface
)
{
GifDecoder
*
This
=
(
GifDecoder
*
)
iface
;
GifDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
...
@@ -315,7 +325,7 @@ static ULONG WINAPI GifDecoder_AddRef(IWICBitmapDecoder *iface)
static
ULONG
WINAPI
GifDecoder_Release
(
IWICBitmapDecoder
*
iface
)
{
GifDecoder
*
This
=
(
GifDecoder
*
)
iface
;
GifDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
...
@@ -357,7 +367,7 @@ static int _gif_inputfunc(GifFileType *gif, GifByteType *data, int len) {
static
HRESULT
WINAPI
GifDecoder_Initialize
(
IWICBitmapDecoder
*
iface
,
IStream
*
pIStream
,
WICDecodeOptions
cacheOptions
)
{
GifDecoder
*
This
=
(
GifDecoder
*
)
iface
;
GifDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
LARGE_INTEGER
seek
;
int
ret
;
...
...
@@ -465,7 +475,7 @@ static HRESULT WINAPI GifDecoder_GetThumbnail(IWICBitmapDecoder *iface,
static
HRESULT
WINAPI
GifDecoder_GetFrameCount
(
IWICBitmapDecoder
*
iface
,
UINT
*
pCount
)
{
GifDecoder
*
This
=
(
GifDecoder
*
)
iface
;
GifDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pCount
);
if
(
!
This
->
initialized
)
return
WINCODEC_ERR_NOTINITIALIZED
;
...
...
@@ -480,7 +490,7 @@ static HRESULT WINAPI GifDecoder_GetFrameCount(IWICBitmapDecoder *iface,
static
HRESULT
WINAPI
GifDecoder_GetFrame
(
IWICBitmapDecoder
*
iface
,
UINT
index
,
IWICBitmapFrameDecode
**
ppIBitmapFrame
)
{
GifDecoder
*
This
=
(
GifDecoder
*
)
iface
;
GifDecoder
*
This
=
impl_from_IWICBitmapDecoder
(
iface
)
;
GifFrameDecode
*
result
;
TRACE
(
"(%p,%u,%p)
\n
"
,
iface
,
index
,
ppIBitmapFrame
);
...
...
@@ -491,7 +501,7 @@ static HRESULT WINAPI GifDecoder_GetFrame(IWICBitmapDecoder *iface,
result
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
GifFrameDecode
));
if
(
!
result
)
return
E_OUTOFMEMORY
;
result
->
lpVtbl
=
&
GifFrameDecode_Vtbl
;
result
->
IWICBitmapFrameDecode_iface
.
lpVtbl
=
&
GifFrameDecode_Vtbl
;
result
->
ref
=
1
;
result
->
frame
=
&
This
->
gif
->
SavedImages
[
index
];
IWICBitmapDecoder_AddRef
(
iface
);
...
...
@@ -533,7 +543,7 @@ HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
GifDecoder
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
lpVtbl
=
&
GifDecoder_Vtbl
;
This
->
IWICBitmapDecoder_iface
.
lpVtbl
=
&
GifDecoder_Vtbl
;
This
->
ref
=
1
;
This
->
initialized
=
FALSE
;
This
->
gif
=
NULL
;
...
...
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