Vincent Povirk : windowscodecs: Implement SetSize for the BMP frame encoder .
Alexandre Julliard
julliard at winehq.org
Wed Aug 12 11:09:31 CDT 2009
Module: wine
Branch: master
Commit: 07fd33d1fa73e15f2a9c39ed46842989c384316c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=07fd33d1fa73e15f2a9c39ed46842989c384316c
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Tue Aug 11 16:23:41 2009 -0500
windowscodecs: Implement SetSize for the BMP frame encoder.
---
dlls/windowscodecs/bmpencode.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c
index a7cabe4..f170abe 100644
--- a/dlls/windowscodecs/bmpencode.c
+++ b/dlls/windowscodecs/bmpencode.c
@@ -40,6 +40,8 @@ typedef struct BmpFrameEncode {
LONG ref;
IStream *stream;
BOOL initialized;
+ UINT width, height;
+ BYTE *bits;
} BmpFrameEncode;
static HRESULT WINAPI BmpFrameEncode_QueryInterface(IWICBitmapFrameEncode *iface, REFIID iid,
@@ -107,8 +109,15 @@ static HRESULT WINAPI BmpFrameEncode_Initialize(IWICBitmapFrameEncode *iface,
static HRESULT WINAPI BmpFrameEncode_SetSize(IWICBitmapFrameEncode *iface,
UINT uiWidth, UINT uiHeight)
{
- FIXME("(%p,%u,%u): stub\n", iface, uiWidth, uiHeight);
- return E_NOTIMPL;
+ BmpFrameEncode *This = (BmpFrameEncode*)iface;
+ TRACE("(%p,%u,%u)\n", iface, uiWidth, uiHeight);
+
+ if (!This->initialized || This->bits) return WINCODEC_ERR_WRONGSTATE;
+
+ This->width = uiWidth;
+ This->height = uiHeight;
+
+ return S_OK;
}
static HRESULT WINAPI BmpFrameEncode_SetResolution(IWICBitmapFrameEncode *iface,
@@ -327,6 +336,9 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
IStream_AddRef(This->stream);
encode->stream = This->stream;
encode->initialized = FALSE;
+ encode->width = 0;
+ encode->height = 0;
+ encode->bits = NULL;
*ppIFrameEncode = (IWICBitmapFrameEncode*)encode;
This->frame = (IWICBitmapFrameEncode*)encode;
More information about the wine-cvs
mailing list