Module: wine Branch: master Commit: 29b0c79e24a64c179a9edf4ccb043575eca59009 URL: http://source.winehq.org/git/wine.git/?a=commit;h=29b0c79e24a64c179a9edf4ccb...
Author: Vincent Povirk vincent@codeweavers.com Date: Wed Apr 11 15:57:22 2012 -0500
windowscodecs: Implement JpegEncoder_Frame_SetResolution.
---
dlls/windowscodecs/jpegformat.c | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c index 57008fd..2ae1fc7 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -728,6 +728,7 @@ typedef struct JpegEncoder { int frame_initialized; int started_compress; UINT width, height; + double xres, yres; const jpeg_compress_format *format; IStream *stream; CRITICAL_SECTION lock; @@ -874,8 +875,23 @@ static HRESULT WINAPI JpegEncoder_Frame_SetSize(IWICBitmapFrameEncode *iface, static HRESULT WINAPI JpegEncoder_Frame_SetResolution(IWICBitmapFrameEncode *iface, double dpiX, double dpiY) { - FIXME("(%p,%0.2f,%0.2f): stub\n", iface, dpiX, dpiY); - return E_NOTIMPL; + JpegEncoder *This = impl_from_IWICBitmapFrameEncode(iface); + TRACE("(%p,%0.2f,%0.2f)\n", iface, dpiX, dpiY); + + EnterCriticalSection(&This->lock); + + if (!This->frame_initialized || This->started_compress) + { + LeaveCriticalSection(&This->lock); + return WINCODEC_ERR_WRONGSTATE; + } + + This->xres = dpiX; + This->yres = dpiY; + + LeaveCriticalSection(&This->lock); + + return S_OK; }
static HRESULT WINAPI JpegEncoder_Frame_SetPixelFormat(IWICBitmapFrameEncode *iface, @@ -1213,6 +1229,7 @@ HRESULT JpegEncoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This->frame_initialized = 0; This->started_compress = 0; This->width = This->height = 0; + This->xres = This->yres = 0.0; This->format = NULL; This->stream = NULL; InitializeCriticalSection(&This->lock);