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
2df20cb9
Commit
2df20cb9
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 WriteSource for BMP frame encoder.
parent
22bfe27f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
2 deletions
+59
-2
bmpencode.c
dlls/windowscodecs/bmpencode.c
+59
-2
No files found.
dlls/windowscodecs/bmpencode.c
View file @
2df20cb9
...
...
@@ -246,8 +246,65 @@ static HRESULT WINAPI BmpFrameEncode_WritePixels(IWICBitmapFrameEncode *iface,
static
HRESULT
WINAPI
BmpFrameEncode_WriteSource
(
IWICBitmapFrameEncode
*
iface
,
IWICBitmapSource
*
pIBitmapSource
,
WICRect
*
prc
)
{
FIXME
(
"(%p,%p,%p): stub
\n
"
,
iface
,
pIBitmapSource
,
prc
);
return
E_NOTIMPL
;
BmpFrameEncode
*
This
=
(
BmpFrameEncode
*
)
iface
;
HRESULT
hr
;
WICRect
rc
;
WICPixelFormatGUID
guid
;
TRACE
(
"(%p,%p,%p)
\n
"
,
iface
,
pIBitmapSource
,
prc
);
if
(
!
This
->
initialized
||
!
This
->
width
||
!
This
->
height
)
return
WINCODEC_ERR_WRONGSTATE
;
if
(
!
This
->
format
)
{
hr
=
IWICBitmapSource_GetPixelFormat
(
pIBitmapSource
,
&
guid
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
BmpFrameEncode_SetPixelFormat
(
iface
,
&
guid
);
if
(
FAILED
(
hr
))
return
hr
;
}
hr
=
IWICBitmapSource_GetPixelFormat
(
pIBitmapSource
,
&
guid
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
memcmp
(
&
guid
,
This
->
format
->
guid
,
sizeof
(
GUID
))
!=
0
)
{
/* should use WICConvertBitmapSource to convert, but that's unimplemented */
ERR
(
"format %s unsupported
\n
"
,
debugstr_guid
(
&
guid
));
return
E_FAIL
;
}
if
(
This
->
xres
==
0
.
0
||
This
->
yres
==
0
.
0
)
{
double
xres
,
yres
;
hr
=
IWICBitmapSource_GetResolution
(
pIBitmapSource
,
&
xres
,
&
yres
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
BmpFrameEncode_SetResolution
(
iface
,
xres
,
yres
);
if
(
FAILED
(
hr
))
return
hr
;
}
if
(
!
prc
)
{
UINT
width
,
height
;
hr
=
IWICBitmapSource_GetSize
(
pIBitmapSource
,
&
width
,
&
height
);
if
(
FAILED
(
hr
))
return
hr
;
rc
.
X
=
0
;
rc
.
Y
=
0
;
rc
.
Width
=
width
;
rc
.
Height
=
height
;
prc
=
&
rc
;
}
if
(
prc
->
Width
!=
This
->
width
)
return
E_INVALIDARG
;
hr
=
BmpFrameEncode_AllocateBits
(
This
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IWICBitmapSource_CopyPixels
(
pIBitmapSource
,
prc
,
This
->
stride
,
This
->
stride
*
(
This
->
height
-
This
->
lineswritten
),
This
->
bits
+
This
->
stride
*
This
->
lineswritten
);
This
->
lineswritten
+=
rc
.
Height
;
return
S_OK
;
}
static
HRESULT
WINAPI
BmpFrameEncode_Commit
(
IWICBitmapFrameEncode
*
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