* Sync with Wine 1.7.27.
CORE-8540
svn path=/trunk/; revision=64615
{
BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface);
HRESULT hr;
- WICRect rc;
- WICPixelFormatGUID guid;
TRACE("(%p,%p,%p)\n", iface, pIBitmapSource, prc);
- if (!This->initialized || !This->width || !This->height)
+ if (!This->initialized)
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;
- }
+ hr = configure_write_source(iface, pIBitmapSource, prc,
+ This->format ? This->format->guid : NULL, This->width, This->height,
+ This->xres, This->yres);
- if (!prc)
+ if (SUCCEEDED(hr))
{
- 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;
+ hr = write_source(iface, pIBitmapSource, prc,
+ This->format->guid, This->format->bpp, This->width, This->height);
}
- 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 += prc->Height;
-
- return S_OK;
+ return hr;
}
static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface)
{
IcnsFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface);
HRESULT hr;
- WICRect rc;
- WICPixelFormatGUID guid;
- UINT stride;
- BYTE *pixeldata = NULL;
TRACE("(%p,%p,%p)\n", iface, pIBitmapSource, prc);
- if (!This->initialized || !This->size)
- {
- hr = WINCODEC_ERR_WRONGSTATE;
- goto end;
- }
-
- hr = IWICBitmapSource_GetPixelFormat(pIBitmapSource, &guid);
- if (FAILED(hr))
- goto end;
- if (!IsEqualGUID(&guid, &GUID_WICPixelFormat32bppBGRA))
- {
- FIXME("format %s unsupported, could use WICConvertBitmapSource to convert\n", debugstr_guid(&guid));
- hr = E_FAIL;
- goto end;
- }
-
- if (!prc)
- {
- UINT width, height;
- hr = IWICBitmapSource_GetSize(pIBitmapSource, &width, &height);
- if (FAILED(hr))
- goto end;
- rc.X = 0;
- rc.Y = 0;
- rc.Width = width;
- rc.Height = height;
- prc = &rc;
- }
+ if (!This->initialized)
+ return WINCODEC_ERR_WRONGSTATE;
- if (prc->Width != This->size)
- {
- hr = E_INVALIDARG;
- goto end;
- }
+ hr = configure_write_source(iface, pIBitmapSource, &prc,
+ &GUID_WICPixelFormat32bppBGRA, This->size, This->size,
+ 1.0, 1.0);
- stride = (32 * This->size + 7)/8;
- pixeldata = HeapAlloc(GetProcessHeap(), 0, stride * prc->Height);
- if (!pixeldata)
- {
- hr = E_OUTOFMEMORY;
- goto end;
- }
-
- hr = IWICBitmapSource_CopyPixels(pIBitmapSource, prc, stride,
- stride*prc->Height, pixeldata);
if (SUCCEEDED(hr))
{
- hr = IWICBitmapFrameEncode_WritePixels(iface, prc->Height, stride,
- stride*prc->Height, pixeldata);
+ hr = write_source(iface, pIBitmapSource, prc,
+ &GUID_WICPixelFormat32bppBGRA, 32, This->size, This->size);
}
-end:
- HeapFree(GetProcessHeap(), 0, pixeldata);
return hr;
}
IWICBitmapLock_Release(lock);
}
- if (SUCCEEDED(hr))
- hr = PaletteImpl_Create(&palette);
-
if (SUCCEEDED(hr) && (format_type == WICPixelFormatNumericRepresentationUnspecified ||
format_type == WICPixelFormatNumericRepresentationIndexed))
{
- hr = IWICBitmapSource_CopyPalette(piBitmapSource, palette);
+ hr = PaletteImpl_Create(&palette);
if (SUCCEEDED(hr))
- hr = IWICBitmap_SetPalette(result, palette);
- else
- hr = S_OK;
+ {
+ hr = IWICBitmapSource_CopyPalette(piBitmapSource, palette);
+
+ if (SUCCEEDED(hr))
+ hr = IWICBitmap_SetPalette(result, palette);
+ else
+ hr = S_OK;
- IWICPalette_Release(palette);
+ IWICPalette_Release(palette);
+ }
}
if (SUCCEEDED(hr))
{
JpegEncoder *This = impl_from_IWICBitmapFrameEncode(iface);
HRESULT hr;
- WICRect rc;
- WICPixelFormatGUID guid;
- UINT stride;
- BYTE *pixeldata;
TRACE("(%p,%p,%p)\n", iface, pIBitmapSource, prc);
- if (!This->frame_initialized || !This->width || !This->height)
+ if (!This->frame_initialized)
return WINCODEC_ERR_WRONGSTATE;
- if (!This->format)
- {
- hr = IWICBitmapSource_GetPixelFormat(pIBitmapSource, &guid);
- if (FAILED(hr)) return hr;
- hr = IWICBitmapFrameEncode_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)
- {
- /* FIXME: should use WICConvertBitmapSource to convert */
- 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 = IWICBitmapFrameEncode_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;
-
- stride = (This->format->bpp * This->width + 7)/8;
-
- pixeldata = HeapAlloc(GetProcessHeap(), 0, stride * prc->Height);
- if (!pixeldata) return E_OUTOFMEMORY;
-
- hr = IWICBitmapSource_CopyPixels(pIBitmapSource, prc, stride,
- stride*prc->Height, pixeldata);
+ hr = configure_write_source(iface, pIBitmapSource, prc,
+ This->format ? This->format->guid : NULL, This->width, This->height,
+ This->xres, This->yres);
if (SUCCEEDED(hr))
{
- hr = IWICBitmapFrameEncode_WritePixels(iface, prc->Height, stride,
- stride*prc->Height, pixeldata);
+ hr = write_source(iface, pIBitmapSource, prc,
+ This->format->guid, This->format->bpp, This->width, This->height);
}
- HeapFree(GetProcessHeap(), 0, pixeldata);
-
return hr;
}
}
}
+HRESULT configure_write_source(IWICBitmapFrameEncode *iface,
+ IWICBitmapSource *source, const WICRect *prc,
+ const WICPixelFormatGUID *format,
+ INT width, INT height, double xres, double yres)
+{
+ HRESULT hr=S_OK;
+ WICPixelFormatGUID src_format, dst_format;
+
+ if (width == 0 || height == 0)
+ return WINCODEC_ERR_WRONGSTATE;
+
+ hr = IWICBitmapSource_GetPixelFormat(source, &src_format);
+ if (FAILED(hr)) return hr;
+
+ if (!format)
+ {
+ dst_format = src_format;
+
+ hr = IWICBitmapFrameEncode_SetPixelFormat(iface, &dst_format);
+ if (FAILED(hr)) return hr;
+
+ format = &dst_format;
+ }
+
+ if (!IsEqualGUID(&src_format, format))
+ {
+ /* FIXME: should use WICConvertBitmapSource to convert */
+ ERR("format %s unsupported\n", debugstr_guid(&src_format));
+ return E_FAIL;
+ }
+
+ if (xres == 0.0 || yres == 0.0)
+ {
+ hr = IWICBitmapSource_GetResolution(source, &xres, &yres);
+ if (FAILED(hr)) return hr;
+ hr = IWICBitmapFrameEncode_SetResolution(iface, xres, yres);
+ if (FAILED(hr)) return hr;
+ }
+
+ return hr;
+}
+
+HRESULT write_source(IWICBitmapFrameEncode *iface,
+ IWICBitmapSource *source, const WICRect *prc,
+ const WICPixelFormatGUID *format, UINT bpp,
+ INT width, INT height)
+{
+ HRESULT hr=S_OK;
+ WICRect rc;
+ UINT stride;
+ BYTE* pixeldata;
+
+ if (!prc)
+ {
+ UINT src_width, src_height;
+ hr = IWICBitmapSource_GetSize(source, &src_width, &src_height);
+ if (FAILED(hr)) return hr;
+ rc.X = 0;
+ rc.Y = 0;
+ rc.Width = src_width;
+ rc.Height = src_height;
+ prc = &rc;
+ }
+
+ if (prc->Width != width || prc->Height <= 0)
+ return E_INVALIDARG;
+
+ stride = (bpp * width + 7)/8;
+
+ pixeldata = HeapAlloc(GetProcessHeap(), 0, stride * prc->Height);
+ if (!pixeldata) return E_OUTOFMEMORY;
+
+ hr = IWICBitmapSource_CopyPixels(source, prc, stride,
+ stride*prc->Height, pixeldata);
+
+ if (SUCCEEDED(hr))
+ {
+ hr = IWICBitmapFrameEncode_WritePixels(iface, prc->Height, stride,
+ stride*prc->Height, pixeldata);
+ }
+
+ HeapFree(GetProcessHeap(), 0, pixeldata);
+
+ return hr;
+}
+
void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride)
{
UINT x, y;
#include <png.h>
#endif
+static const WCHAR wszPngInterlaceOption[] = {'I','n','t','e','r','l','a','c','e','O','p','t','i','o','n',0};
+
static HRESULT read_png_chunk(IStream *stream, BYTE *type, BYTE **data, ULONG *data_size)
{
BYTE header[8];
#endif
MAKE_FUNCPTR(png_set_filler);
MAKE_FUNCPTR(png_set_gray_to_rgb);
+MAKE_FUNCPTR(png_set_interlace_handling);
MAKE_FUNCPTR(png_set_IHDR);
MAKE_FUNCPTR(png_set_pHYs);
MAKE_FUNCPTR(png_set_read_fn);
#endif
LOAD_FUNCPTR(png_set_filler);
LOAD_FUNCPTR(png_set_gray_to_rgb);
+ LOAD_FUNCPTR(png_set_interlace_handling);
LOAD_FUNCPTR(png_set_IHDR);
LOAD_FUNCPTR(png_set_pHYs);
LOAD_FUNCPTR(png_set_read_fn);
BOOL frame_committed;
BOOL committed;
CRITICAL_SECTION lock;
+ BOOL interlace;
+ BYTE *data;
+ UINT stride;
+ UINT passes;
} PngEncoder;
static inline PngEncoder *impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
IPropertyBag2 *pIEncoderOptions)
{
PngEncoder *This = impl_from_IWICBitmapFrameEncode(iface);
+ BOOL interlace;
+ PROPBAG2 opts[1]= {{0}};
+ VARIANT opt_values[1];
+ HRESULT opt_hres[1];
+ HRESULT hr;
+
TRACE("(%p,%p)\n", iface, pIEncoderOptions);
+ opts[0].pstrName = (LPOLESTR)wszPngInterlaceOption;
+ opts[0].vt = VT_BOOL;
+
+ if (pIEncoderOptions)
+ {
+ hr = IPropertyBag2_Read(pIEncoderOptions, 1, opts, NULL, opt_values, opt_hres);
+
+ if (FAILED(hr))
+ return hr;
+ }
+ else
+ memset(opt_values, 0, sizeof(opt_values));
+
+ if (V_VT(&opt_values[0]) == VT_EMPTY)
+ interlace = FALSE;
+ else
+ interlace = (V_BOOL(&opt_values[0]) != 0);
+
EnterCriticalSection(&This->lock);
if (This->frame_initialized)
return WINCODEC_ERR_WRONGSTATE;
}
+ This->interlace = interlace;
+
This->frame_initialized = TRUE;
LeaveCriticalSection(&This->lock);
if (!This->info_written)
{
+ if (This->interlace)
+ {
+ /* libpng requires us to write all data multiple times in this case. */
+ This->stride = (This->format->bpp * This->width + 7)/8;
+ This->data = HeapAlloc(GetProcessHeap(), 0, This->height * This->stride);
+ if (!This->data)
+ {
+ LeaveCriticalSection(&This->lock);
+ return E_OUTOFMEMORY;
+ }
+ }
+
ppng_set_IHDR(This->png_ptr, This->info_ptr, This->width, This->height,
- This->format->bit_depth, This->format->color_type, PNG_INTERLACE_NONE,
+ This->format->bit_depth, This->format->color_type,
+ This->interlace ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
if (This->xres != 0.0 && This->yres != 0.0)
if (This->format->swap_rgb)
ppng_set_bgr(This->png_ptr);
+ if (This->interlace)
+ This->passes = ppng_set_interlace_handling(This->png_ptr);
+
This->info_written = TRUE;
}
+ if (This->interlace)
+ {
+ /* Just store the data so we can write it in multiple passes in Commit. */
+ for (i=0; i<lineCount; i++)
+ memcpy(This->data + This->stride * (This->lines_written + i),
+ pbPixels + cbStride * i,
+ This->stride);
+
+ This->lines_written += lineCount;
+
+ LeaveCriticalSection(&This->lock);
+ return S_OK;
+ }
+
row_pointers = HeapAlloc(GetProcessHeap(), 0, lineCount * sizeof(png_byte*));
if (!row_pointers)
{
{
PngEncoder *This = impl_from_IWICBitmapFrameEncode(iface);
HRESULT hr;
- WICRect rc;
- WICPixelFormatGUID guid;
- UINT stride;
- BYTE *pixeldata;
TRACE("(%p,%p,%p)\n", iface, pIBitmapSource, prc);
- if (!This->frame_initialized || !This->width || !This->height)
+ if (!This->frame_initialized)
return WINCODEC_ERR_WRONGSTATE;
- if (!This->format)
- {
- hr = IWICBitmapSource_GetPixelFormat(pIBitmapSource, &guid);
- if (FAILED(hr)) return hr;
- hr = IWICBitmapFrameEncode_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)
- {
- /* FIXME: should use WICConvertBitmapSource to convert */
- 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 = IWICBitmapFrameEncode_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;
-
- stride = (This->format->bpp * This->width + 7)/8;
-
- pixeldata = HeapAlloc(GetProcessHeap(), 0, stride * prc->Height);
- if (!pixeldata) return E_OUTOFMEMORY;
-
- hr = IWICBitmapSource_CopyPixels(pIBitmapSource, prc, stride,
- stride*prc->Height, pixeldata);
+ hr = configure_write_source(iface, pIBitmapSource, prc,
+ This->format ? This->format->guid : NULL, This->width, This->height,
+ This->xres, This->yres);
if (SUCCEEDED(hr))
{
- hr = IWICBitmapFrameEncode_WritePixels(iface, prc->Height, stride,
- stride*prc->Height, pixeldata);
+ hr = write_source(iface, pIBitmapSource, prc,
+ This->format->guid, This->format->bpp, This->width, This->height);
}
- HeapFree(GetProcessHeap(), 0, pixeldata);
-
return hr;
}
static HRESULT WINAPI PngFrameEncode_Commit(IWICBitmapFrameEncode *iface)
{
PngEncoder *This = impl_from_IWICBitmapFrameEncode(iface);
+ png_byte **row_pointers=NULL;
jmp_buf jmpbuf;
TRACE("(%p)\n", iface);
if (setjmp(jmpbuf))
{
LeaveCriticalSection(&This->lock);
+ HeapFree(GetProcessHeap(), 0, row_pointers);
return E_FAIL;
}
ppng_set_error_fn(This->png_ptr, jmpbuf, user_error_fn, user_warning_fn);
+ if (This->interlace)
+ {
+ int i;
+
+ row_pointers = HeapAlloc(GetProcessHeap(), 0, This->height * sizeof(png_byte*));
+ if (!row_pointers)
+ {
+ LeaveCriticalSection(&This->lock);
+ return E_OUTOFMEMORY;
+ }
+
+ for (i=0; i<This->height; i++)
+ row_pointers[i] = This->data + This->stride * i;
+
+ for (i=0; i<This->passes; i++)
+ ppng_write_rows(This->png_ptr, row_pointers, This->height);
+ }
+
ppng_write_end(This->png_ptr, This->info_ptr);
This->frame_committed = TRUE;
+ HeapFree(GetProcessHeap(), 0, row_pointers);
+
LeaveCriticalSection(&This->lock);
return S_OK;
ppng_destroy_write_struct(&This->png_ptr, &This->info_ptr);
if (This->stream)
IStream_Release(This->stream);
+ HeapFree(GetProcessHeap(), 0, This->data);
HeapFree(GetProcessHeap(), 0, This);
}
{
PngEncoder *This = impl_from_IWICBitmapEncoder(iface);
HRESULT hr;
+ PROPBAG2 opts[1]= {{0}};
+
TRACE("(%p,%p,%p)\n", iface, ppIFrameEncode, ppIEncoderOptions);
EnterCriticalSection(&This->lock);
return WINCODEC_ERR_NOTINITIALIZED;
}
- hr = CreatePropertyBag2(NULL, 0, ppIEncoderOptions);
+ opts[0].pstrName = (LPOLESTR)wszPngInterlaceOption;
+ opts[0].vt = VT_BOOL;
+ opts[0].dwType = PROPBAG2_TYPE_DATA;
+
+ hr = CreatePropertyBag2(opts, 1, ppIEncoderOptions);
if (FAILED(hr))
{
LeaveCriticalSection(&This->lock);
This->lines_written = 0;
This->frame_committed = FALSE;
This->committed = FALSE;
+ This->data = NULL;
InitializeCriticalSection(&This->lock);
This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PngEncoder.lock");
if (iProperty+cProperties > This->prop_count )
return WINCODEC_ERR_VALUEOUTOFRANGE;
- *pcProperties = max(cProperties, This->prop_count-iProperty);
+ *pcProperties = min(cProperties, This->prop_count-iProperty);
for (i=0; i < *pcProperties; i++)
{
HRESULT WINAPI IWICBitmapFrameEncode_WriteSource_Proxy_W(IWICBitmapFrameEncode *iface,
IWICBitmapSource *pIBitmapSource, WICRect *prc)
{
+ if (prc && (prc->Width <= 0 || prc->Height <= 0))
+ prc = NULL;
+
return IWICBitmapFrameEncode_WriteSource(iface, pIBitmapSource, prc);
}
{
TiffFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface);
HRESULT hr;
- WICRect rc;
- WICPixelFormatGUID guid;
- UINT stride;
- BYTE *pixeldata;
TRACE("(%p,%p,%p)\n", iface, pIBitmapSource, prc);
- if (!This->initialized || !This->width || !This->height)
+ if (!This->initialized)
return WINCODEC_ERR_WRONGSTATE;
- if (!This->format)
- {
- hr = IWICBitmapSource_GetPixelFormat(pIBitmapSource, &guid);
- if (FAILED(hr)) return hr;
- hr = IWICBitmapFrameEncode_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)
- {
- /* FIXME: should use WICConvertBitmapSource to convert */
- 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 = IWICBitmapFrameEncode_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;
-
- stride = (This->format->bpp * This->width + 7)/8;
-
- pixeldata = HeapAlloc(GetProcessHeap(), 0, stride * prc->Height);
- if (!pixeldata) return E_OUTOFMEMORY;
-
- hr = IWICBitmapSource_CopyPixels(pIBitmapSource, prc, stride,
- stride*prc->Height, pixeldata);
+ hr = configure_write_source(iface, pIBitmapSource, prc,
+ This->format ? This->format->guid : NULL, This->width, This->height,
+ This->xres, This->yres);
if (SUCCEEDED(hr))
{
- hr = IWICBitmapFrameEncode_WritePixels(iface, prc->Height, stride,
- stride*prc->Height, pixeldata);
+ hr = write_source(iface, pIBitmapSource, prc,
+ This->format->guid, This->format->bpp, This->width, This->height);
}
- HeapFree(GetProcessHeap(), 0, pixeldata);
-
- return S_OK;
+ return hr;
}
static HRESULT WINAPI TiffFrameEncode_Commit(IWICBitmapFrameEncode *iface)
typedef void (__cdecl typeof(png_set_error_fn))(struct png_struct_def *, void *, png_error_ptr_1, png_error_ptr_1);
typedef void (__cdecl typeof(png_set_expand_gray_1_2_4_to_8))(struct png_struct_def *);
typedef void (__cdecl typeof(png_set_filler))(struct png_struct_def *, unsigned int, int);
+typedef int (__cdecl typeof(png_set_interlace_handling))(struct png_struct_def *);
typedef void (__cdecl typeof(png_set_gray_to_rgb))(struct png_struct_def *);
typedef void (__cdecl typeof(png_set_IHDR))(struct png_struct_def *, struct png_info_def *, unsigned int, unsigned int, int, int, int, int, int);
typedef void (__cdecl typeof(png_set_pHYs))(struct png_struct_def *, struct png_info_def *, unsigned int, unsigned int, int);
GifFile->Image.Interlace = (Buf[0] & 0x40);
if (Buf[0] & 0x80) { /* Does this image have local color map? */
- /*** FIXME: Why do we check both of these in order to do this?
- * Why do we have both Image and SavedImages? */
- if (GifFile->Image.ColorMap && GifFile->SavedImages == NULL)
- FreeMapObject(GifFile->Image.ColorMap);
+ FreeMapObject(GifFile->Image.ColorMap);
GifFile->Image.ColorMap = MakeMapObject(1 << BitsPerPixel, NULL);
if (GifFile->Image.ColorMap == NULL) {
UINT srcwidth, UINT srcheight, INT srcstride,
const WICRect *rc, UINT dststride, UINT dstbuffersize, BYTE *dstbuffer) DECLSPEC_HIDDEN;
+extern HRESULT configure_write_source(IWICBitmapFrameEncode *iface,
+ IWICBitmapSource *source, const WICRect *prc,
+ const WICPixelFormatGUID *format,
+ INT width, INT height, double xres, double yres) DECLSPEC_HIDDEN;
+
+extern HRESULT write_source(IWICBitmapFrameEncode *iface,
+ IWICBitmapSource *source, const WICRect *prc,
+ const WICPixelFormatGUID *format, UINT bpp,
+ INT width, INT height) DECLSPEC_HIDDEN;
+
extern void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride) DECLSPEC_HIDDEN;
extern HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp) DECLSPEC_HIDDEN;
reactos/dll/win32/wbemdisp # Synced to Wine-1.7.17
reactos/dll/win32/wbemprox # Synced to Wine-1.7.27
reactos/dll/win32/wer # Autosync
-reactos/dll/win32/windowscodecs # Synced to Wine-1.7.17
+reactos/dll/win32/windowscodecs # Synced to Wine-1.7.27
reactos/dll/win32/windowscodecsext # Synced to Wine-1.7.17
reactos/dll/win32/winemp3.acm # Synced to Wine-1.7.17
reactos/dll/win32/wing32 # Out of sync