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
7cc0fd4f
Commit
7cc0fd4f
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 Commit for BMP frame encoder.
parent
4d1d92f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
2 deletions
+53
-2
bmpencode.c
dlls/windowscodecs/bmpencode.c
+53
-2
No files found.
dlls/windowscodecs/bmpencode.c
View file @
7cc0fd4f
...
...
@@ -61,6 +61,7 @@ typedef struct BmpFrameEncode {
double
xres
,
yres
;
UINT
lineswritten
;
UINT
stride
;
BOOL
committed
;
}
BmpFrameEncode
;
static
HRESULT
WINAPI
BmpFrameEncode_QueryInterface
(
IWICBitmapFrameEncode
*
iface
,
REFIID
iid
,
...
...
@@ -251,8 +252,57 @@ static HRESULT WINAPI BmpFrameEncode_WriteSource(IWICBitmapFrameEncode *iface,
static
HRESULT
WINAPI
BmpFrameEncode_Commit
(
IWICBitmapFrameEncode
*
iface
)
{
FIXME
(
"(%p): stub
\n
"
,
iface
);
return
E_NOTIMPL
;
BmpFrameEncode
*
This
=
(
BmpFrameEncode
*
)
iface
;
BITMAPFILEHEADER
bfh
;
BITMAPV5HEADER
bih
;
UINT
info_size
;
LARGE_INTEGER
pos
;
ULONG
byteswritten
;
HRESULT
hr
;
TRACE
(
"(%p)
\n
"
,
iface
);
if
(
!
This
->
bits
||
This
->
committed
||
This
->
height
!=
This
->
lineswritten
)
return
WINCODEC_ERR_WRONGSTATE
;
bfh
.
bfType
=
0x4d42
;
/* "BM" */
bfh
.
bfReserved1
=
0
;
bfh
.
bfReserved2
=
0
;
bih
.
bV5Size
=
info_size
=
sizeof
(
BITMAPINFOHEADER
);
bih
.
bV5Width
=
This
->
width
;
bih
.
bV5Height
=
-
This
->
height
;
/* top-down bitmap */
bih
.
bV5Planes
=
1
;
bih
.
bV5BitCount
=
This
->
format
->
bpp
;
bih
.
bV5Compression
=
This
->
format
->
compression
;
bih
.
bV5SizeImage
=
This
->
stride
*
This
->
height
;
bih
.
bV5XPelsPerMeter
=
(
This
->
xres
-
0
.
0127
)
/
0
.
0254
;
bih
.
bV5YPelsPerMeter
=
(
This
->
yres
-
0
.
0127
)
/
0
.
0254
;
bih
.
bV5ClrUsed
=
0
;
bih
.
bV5ClrImportant
=
0
;
bfh
.
bfSize
=
sizeof
(
BITMAPFILEHEADER
)
+
info_size
+
bih
.
bV5SizeImage
;
bfh
.
bfOffBits
=
sizeof
(
BITMAPFILEHEADER
)
+
info_size
;
pos
.
QuadPart
=
0
;
hr
=
IStream_Seek
(
This
->
stream
,
pos
,
STREAM_SEEK_SET
,
NULL
);
\
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IStream_Write
(
This
->
stream
,
&
bfh
,
sizeof
(
BITMAPFILEHEADER
),
&
byteswritten
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
byteswritten
!=
sizeof
(
BITMAPFILEHEADER
))
return
E_FAIL
;
hr
=
IStream_Write
(
This
->
stream
,
&
bih
,
info_size
,
&
byteswritten
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
byteswritten
!=
info_size
)
return
E_FAIL
;
hr
=
IStream_Write
(
This
->
stream
,
This
->
bits
,
bih
.
bV5SizeImage
,
&
byteswritten
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
byteswritten
!=
bih
.
bV5SizeImage
)
return
E_FAIL
;
This
->
committed
=
TRUE
;
return
S_OK
;
}
static
HRESULT
WINAPI
BmpFrameEncode_GetMetadataQueryWriter
(
IWICBitmapFrameEncode
*
iface
,
...
...
@@ -423,6 +473,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
encode
->
xres
=
0
.
0
;
encode
->
yres
=
0
.
0
;
encode
->
lineswritten
=
0
;
encode
->
committed
=
FALSE
;
*
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