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
19e78030
Commit
19e78030
authored
Aug 17, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement CopyPixels for GIF decoder.
parent
04105f7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
2 deletions
+53
-2
gifformat.c
dlls/windowscodecs/gifformat.c
+53
-2
No files found.
dlls/windowscodecs/gifformat.c
View file @
19e78030
...
...
@@ -168,11 +168,62 @@ static HRESULT WINAPI GifFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface,
return
S_OK
;
}
static
HRESULT
copy_interlaced_pixels
(
const
BYTE
*
srcbuffer
,
UINT
srcwidth
,
UINT
srcheight
,
INT
srcstride
,
const
WICRect
*
rc
,
UINT
dststride
,
UINT
dstbuffersize
,
BYTE
*
dstbuffer
)
{
UINT
row_offset
;
/* number of bytes into the source rows where the data starts */
const
BYTE
*
src
;
BYTE
*
dst
;
UINT
y
;
if
(
rc
->
X
<
0
||
rc
->
Y
<
0
||
rc
->
X
+
rc
->
Width
>
srcwidth
||
rc
->
Y
+
rc
->
Height
>
srcheight
)
return
E_INVALIDARG
;
if
(
dststride
<
rc
->
Width
)
return
E_INVALIDARG
;
if
((
dststride
*
rc
->
Height
)
>
dstbuffersize
)
return
E_INVALIDARG
;
row_offset
=
rc
->
X
;
dst
=
dstbuffer
;
for
(
y
=
rc
->
Y
;
y
-
rc
->
Y
<
rc
->
Height
;
y
++
)
{
if
(
y
%
8
==
0
)
src
=
srcbuffer
+
srcstride
*
(
y
/
8
);
else
if
(
y
%
4
==
0
)
src
=
srcbuffer
+
srcstride
*
((
srcheight
+
7
)
/
8
+
y
/
8
);
else
if
(
y
%
2
==
0
)
src
=
srcbuffer
+
srcstride
*
((
srcheight
+
3
)
/
4
+
y
/
4
);
else
/* y%2 == 1 */
src
=
srcbuffer
+
srcstride
*
((
srcheight
+
1
)
/
2
+
y
/
2
);
src
+=
row_offset
;
memcpy
(
dst
,
src
,
rc
->
Width
);
dst
+=
dststride
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
GifFrameDecode_CopyPixels
(
IWICBitmapFrameDecode
*
iface
,
const
WICRect
*
prc
,
UINT
cbStride
,
UINT
cbBufferSize
,
BYTE
*
pbBuffer
)
{
FIXME
(
"(%p,%p,%u,%u,%p): stub
\n
"
,
iface
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
return
E_NOTIMPL
;
GifFrameDecode
*
This
=
(
GifFrameDecode
*
)
iface
;
TRACE
(
"(%p,%p,%u,%u,%p)
\n
"
,
iface
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
if
(
This
->
frame
->
ImageDesc
.
Interlace
)
{
return
copy_interlaced_pixels
(
This
->
frame
->
RasterBits
,
This
->
frame
->
ImageDesc
.
Width
,
This
->
frame
->
ImageDesc
.
Height
,
This
->
frame
->
ImageDesc
.
Width
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
}
else
{
return
copy_pixels
(
8
,
This
->
frame
->
RasterBits
,
This
->
frame
->
ImageDesc
.
Width
,
This
->
frame
->
ImageDesc
.
Height
,
This
->
frame
->
ImageDesc
.
Width
,
prc
,
cbStride
,
cbBufferSize
,
pbBuffer
);
}
}
static
HRESULT
WINAPI
GifFrameDecode_GetMetadataQueryReader
(
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