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
4d1d92f8
Commit
4d1d92f8
authored
Aug 11, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement WritePixels for BMP frame encoder.
parent
fcb69378
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
2 deletions
+43
-2
bmpencode.c
dlls/windowscodecs/bmpencode.c
+43
-2
No files found.
dlls/windowscodecs/bmpencode.c
View file @
4d1d92f8
...
...
@@ -59,6 +59,8 @@ typedef struct BmpFrameEncode {
BYTE
*
bits
;
const
struct
bmp_pixelformat
*
format
;
double
xres
,
yres
;
UINT
lineswritten
;
UINT
stride
;
}
BmpFrameEncode
;
static
HRESULT
WINAPI
BmpFrameEncode_QueryInterface
(
IWICBitmapFrameEncode
*
iface
,
REFIID
iid
,
...
...
@@ -104,6 +106,7 @@ static ULONG WINAPI BmpFrameEncode_Release(IWICBitmapFrameEncode *iface)
if
(
ref
==
0
)
{
if
(
This
->
stream
)
IStream_Release
(
This
->
stream
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
bits
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -195,11 +198,48 @@ static HRESULT WINAPI BmpFrameEncode_SetThumbnail(IWICBitmapFrameEncode *iface,
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
BmpFrameEncode_AllocateBits
(
BmpFrameEncode
*
This
)
{
if
(
!
This
->
bits
)
{
if
(
!
This
->
initialized
||
!
This
->
width
||
!
This
->
height
||
!
This
->
format
)
return
WINCODEC_ERR_WRONGSTATE
;
This
->
stride
=
(((
This
->
width
*
This
->
format
->
bpp
)
+
31
)
/
32
)
*
4
;
This
->
bits
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
This
->
stride
*
This
->
height
);
if
(
!
This
->
bits
)
return
E_OUTOFMEMORY
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
BmpFrameEncode_WritePixels
(
IWICBitmapFrameEncode
*
iface
,
UINT
lineCount
,
UINT
cbStride
,
UINT
cbBufferSize
,
BYTE
*
pbPixels
)
{
FIXME
(
"(%p,%u,%u,%u,%p): stub
\n
"
,
iface
,
lineCount
,
cbStride
,
cbBufferSize
,
pbPixels
);
return
E_NOTIMPL
;
BmpFrameEncode
*
This
=
(
BmpFrameEncode
*
)
iface
;
HRESULT
hr
;
WICRect
rc
;
TRACE
(
"(%p,%u,%u,%u,%p)
\n
"
,
iface
,
lineCount
,
cbStride
,
cbBufferSize
,
pbPixels
);
if
(
!
This
->
initialized
||
!
This
->
width
||
!
This
->
height
||
!
This
->
format
)
return
WINCODEC_ERR_WRONGSTATE
;
hr
=
BmpFrameEncode_AllocateBits
(
This
);
if
(
FAILED
(
hr
))
return
hr
;
rc
.
X
=
0
;
rc
.
Y
=
0
;
rc
.
Width
=
This
->
width
;
rc
.
Height
=
lineCount
;
hr
=
copy_pixels
(
This
->
format
->
bpp
,
pbPixels
,
This
->
width
,
lineCount
,
cbStride
,
&
rc
,
This
->
stride
,
This
->
stride
*
(
This
->
height
-
This
->
lineswritten
),
This
->
bits
+
This
->
stride
*
This
->
lineswritten
);
if
(
SUCCEEDED
(
hr
))
This
->
lineswritten
+=
lineCount
;
return
hr
;
}
static
HRESULT
WINAPI
BmpFrameEncode_WriteSource
(
IWICBitmapFrameEncode
*
iface
,
...
...
@@ -382,6 +422,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
encode
->
format
=
NULL
;
encode
->
xres
=
0
.
0
;
encode
->
yres
=
0
.
0
;
encode
->
lineswritten
=
0
;
*
ppIFrameEncode
=
(
IWICBitmapFrameEncode
*
)
encode
;
This
->
frame
=
(
IWICBitmapFrameEncode
*
)
encode
;
...
...
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