Vincent Povirk : windowscodecs: Implement SetSize for the PNG encoder.
Alexandre Julliard
julliard at winehq.org
Fri Oct 9 09:24:15 CDT 2009
Module: wine
Branch: master
Commit: e324b8ef4c4f962dddb8e3792d8043aeb9d4c9a2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e324b8ef4c4f962dddb8e3792d8043aeb9d4c9a2
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Wed Sep 23 16:39:12 2009 -0500
windowscodecs: Implement SetSize for the PNG encoder.
---
dlls/windowscodecs/pngformat.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
index ab35d89..af074e8 100644
--- a/dlls/windowscodecs/pngformat.c
+++ b/dlls/windowscodecs/pngformat.c
@@ -699,6 +699,7 @@ typedef struct PngEncoder {
BOOL frame_initialized;
const struct png_pixelformat *format;
BOOL info_written;
+ UINT width, height;
} PngEncoder;
static inline PngEncoder *encoder_from_frame(IWICBitmapFrameEncode *iface)
@@ -757,8 +758,15 @@ static HRESULT WINAPI PngFrameEncode_Initialize(IWICBitmapFrameEncode *iface,
static HRESULT WINAPI PngFrameEncode_SetSize(IWICBitmapFrameEncode *iface,
UINT uiWidth, UINT uiHeight)
{
- FIXME("(%p,%u,%u): stub\n", iface, uiWidth, uiHeight);
- return E_NOTIMPL;
+ PngEncoder *This = encoder_from_frame(iface);
+ TRACE("(%p,%u,%u)\n", iface, uiWidth, uiHeight);
+
+ if (!This->frame_initialized || This->info_written) return WINCODEC_ERR_WRONGSTATE;
+
+ This->width = uiWidth;
+ This->height = uiHeight;
+
+ return S_OK;
}
static HRESULT WINAPI PngFrameEncode_SetResolution(IWICBitmapFrameEncode *iface,
@@ -1089,6 +1097,8 @@ HRESULT PngEncoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
This->frame_initialized = FALSE;
This->format = NULL;
This->info_written = FALSE;
+ This->width = 0;
+ This->height = 0;
ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv);
IUnknown_Release((IUnknown*)This);
More information about the wine-cvs
mailing list