50 {&GUID_WICPixelFormat24bppBGR, 24, 0,
BI_RGB},
51 {&GUID_WICPixelFormatBlackWhite, 1, 2,
BI_RGB},
52 {&GUID_WICPixelFormat1bppIndexed, 1, 2,
BI_RGB},
53 {&GUID_WICPixelFormat2bppIndexed, 2, 4,
BI_RGB},
54 {&GUID_WICPixelFormat4bppIndexed, 4, 16,
BI_RGB},
55 {&GUID_WICPixelFormat8bppIndexed, 8, 256,
BI_RGB},
56 {&GUID_WICPixelFormat16bppBGR555, 16, 0,
BI_RGB},
57 {&GUID_WICPixelFormat16bppBGR565, 16, 0,
BI_BITFIELDS, 0xf800, 0x7e0, 0x1f, 0},
58 {&GUID_WICPixelFormat32bppBGR, 32, 0,
BI_RGB},
61 {&GUID_WICPixelFormat32bppBGRA, 32, 0,
BI_BITFIELDS, 0xff0000, 0xff00, 0xff, 0xff000000},
82static const WCHAR wszEnableV5Header32bppBGRA[] = {
'E',
'n',
'a',
'b',
'l',
'e',
'V',
'5',
'H',
'e',
'a',
'd',
'e',
'r',
'3',
'2',
'b',
'p',
'p',
'B',
'G',
'R',
'A',0};
100 *
ppv = &
This->IWICBitmapFrameEncode_iface;
117 TRACE(
"(%p) refcount=%u\n", iface,
ref);
127 TRACE(
"(%p) refcount=%u\n", iface,
ref);
131 if (
This->stream) IStream_Release(
This->stream);
143 TRACE(
"(%p,%p)\n", iface, pIEncoderOptions);
147 if (pIEncoderOptions)
148 WARN(
"ignoring encoder options.\n");
159 TRACE(
"(%p,%u,%u)\n", iface, uiWidth, uiHeight);
163 This->width = uiWidth;
164 This->height = uiHeight;
170 double dpiX,
double dpiY)
173 TRACE(
"(%p,%0.2f,%0.2f)\n", iface, dpiX, dpiY);
192 if (
IsEqualGUID(pPixelFormat, &GUID_WICPixelFormatBlackWhite))
193 *pPixelFormat = GUID_WICPixelFormat1bppIndexed;
194 else if (
IsEqualGUID(pPixelFormat, &GUID_WICPixelFormat2bppIndexed))
195 *pPixelFormat = GUID_WICPixelFormat4bppIndexed;
214 FIXME(
"(%p,%u,%p): stub\n", iface, cCount, ppIColorContext);
228 if (!
This->initialized)
235 for (
i = 0;
i <
This->colors;
i++)
236 This->palette[
i] |= 0xff000000;
244 FIXME(
"(%p,%p): stub\n", iface, pIThumbnail);
255 This->stride = (((
This->width *
This->format->bpp)+31)/32)*4;
267 UINT dstbuffersize, bytesperrow,
row;
271 TRACE(
"(%p,%u,%u,%u,%p)\n", iface, lineCount, cbStride, cbBufferSize, pbPixels);
279 bytesperrow = ((
This->format->bpp *
This->width) + 7) / 8;
281 if (
This->stride < bytesperrow)
284 dstbuffersize =
This->stride * (
This->height -
This->lineswritten);
285 if ((
This->stride * (lineCount - 1)) + bytesperrow > dstbuffersize)
297 This->lineswritten += lineCount;
309 if (!
This->initialized)
335 TRACE(
"(%p)\n", iface);
345 bih.bV5Width =
This->width;
346 bih.bV5Height =
This->height;
348 bih.bV5BitCount =
This->format->bpp;
349 bih.bV5Compression =
This->format->compression;
350 bih.bV5SizeImage =
This->stride*
This->height;
351 bih.bV5XPelsPerMeter = (
This->xres+0.0127) / 0.0254;
352 bih.bV5YPelsPerMeter = (
This->yres+0.0127) / 0.0254;
353 bih.bV5ClrUsed = (
This->format->bpp <= 8) ?
This->colors : 0;
354 bih.bV5ClrImportant = bih.bV5ClrUsed;
358 if (
This->format->alphamask)
362 bih.bV5RedMask =
This->format->redmask;
363 bih.bV5GreenMask =
This->format->greenmask;
364 bih.bV5BlueMask =
This->format->bluemask;
365 bih.bV5AlphaMask =
This->format->alphamask;
381 hr = IStream_Write(
This->stream, &bih, info_size, &byteswritten);
383 if (byteswritten != info_size)
return E_FAIL;
386 if (
This->format->colors)
393 hr = IStream_Write(
This->stream,
This->bits, bih.bV5SizeImage, &byteswritten);
395 if (byteswritten != bih.bV5SizeImage)
return E_FAIL;
405 FIXME(
"(%p, %p): stub\n", iface, ppIMetadataQueryWriter);
449 *
ppv = &
This->IWICBitmapEncoder_iface;
466 TRACE(
"(%p) refcount=%u\n", iface,
ref);
476 TRACE(
"(%p) refcount=%u\n", iface,
ref);
480 if (
This->stream) IStream_Release(
This->stream);
481 if (
This->frame) IWICBitmapFrameEncode_Release(&
This->frame->IWICBitmapFrameEncode_iface);
493 TRACE(
"(%p,%p,%u)\n", iface, pIStream, cacheOption);
495 IStream_AddRef(pIStream);
496 This->stream = pIStream;
502 GUID *pguidContainerFormat)
504 TRACE(
"(%p,%p)\n", iface, pguidContainerFormat);
506 if (!pguidContainerFormat)
509 memcpy(pguidContainerFormat, &GUID_ContainerFormatBmp,
sizeof(
GUID));
525 hr = IWICComponentInfo_QueryInterface(comp_info, &IID_IWICBitmapEncoderInfo, (
void **)
info);
526 IWICComponentInfo_Release(comp_info);
534 FIXME(
"(%p,%u,%p): stub\n", iface, cCount, ppIColorContext);
548 TRACE(
"(%p,%p)\n", iface, pIThumbnail);
554 TRACE(
"(%p,%p)\n", iface, pIPreview);
564 static const PROPBAG2 opts[1] =
569 TRACE(
"(%p,%p,%p)\n", iface, ppIFrameEncode, ppIEncoderOptions);
575 if (ppIEncoderOptions)
584 IPropertyBag2_Release(*ppIEncoderOptions);
585 *ppIEncoderOptions =
NULL;
590 IStream_AddRef(
This->stream);
604 This->frame = encode;
612 TRACE(
"(%p)\n", iface);
622 FIXME(
"(%p,%p): stub\n", iface, ppIMetadataQueryWriter);
659 ret = IWICBitmapEncoder_QueryInterface(&
This->IWICBitmapEncoder_iface, iid,
ppv);
660 IWICBitmapEncoder_Release(&
This->IWICBitmapEncoder_iface);
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static HRESULT WINAPI BmpEncoder_GetEncoderInfo(IWICBitmapEncoder *iface, IWICBitmapEncoderInfo **info)
static HRESULT WINAPI BmpFrameEncode_WritePixels(IWICBitmapFrameEncode *iface, UINT lineCount, UINT cbStride, UINT cbBufferSize, BYTE *pbPixels)
static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface)
static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface, IWICBitmapFrameEncode **ppIFrameEncode, IPropertyBag2 **ppIEncoderOptions)
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
static HRESULT WINAPI BmpFrameEncode_SetThumbnail(IWICBitmapFrameEncode *iface, IWICBitmapSource *pIThumbnail)
static ULONG WINAPI BmpFrameEncode_AddRef(IWICBitmapFrameEncode *iface)
static const IWICBitmapEncoderVtbl BmpEncoder_Vtbl
static ULONG WINAPI BmpFrameEncode_Release(IWICBitmapFrameEncode *iface)
static HRESULT WINAPI BmpEncoder_SetThumbnail(IWICBitmapEncoder *iface, IWICBitmapSource *pIThumbnail)
static HRESULT WINAPI BmpFrameEncode_SetPalette(IWICBitmapFrameEncode *iface, IWICPalette *palette)
HRESULT BmpEncoder_CreateInstance(REFIID iid, void **ppv)
static HRESULT WINAPI BmpFrameEncode_SetSize(IWICBitmapFrameEncode *iface, UINT uiWidth, UINT uiHeight)
static HRESULT WINAPI BmpEncoder_Initialize(IWICBitmapEncoder *iface, IStream *pIStream, WICBitmapEncoderCacheOption cacheOption)
static HRESULT WINAPI BmpFrameEncode_SetPixelFormat(IWICBitmapFrameEncode *iface, WICPixelFormatGUID *pPixelFormat)
static HRESULT WINAPI BmpEncoder_SetColorContexts(IWICBitmapEncoder *iface, UINT cCount, IWICColorContext **ppIColorContext)
static HRESULT WINAPI BmpFrameEncode_WriteSource(IWICBitmapFrameEncode *iface, IWICBitmapSource *pIBitmapSource, WICRect *prc)
static const WCHAR wszEnableV5Header32bppBGRA[]
static HRESULT WINAPI BmpEncoder_SetPreview(IWICBitmapEncoder *iface, IWICBitmapSource *pIPreview)
static HRESULT WINAPI BmpFrameEncode_SetResolution(IWICBitmapFrameEncode *iface, double dpiX, double dpiY)
static HRESULT WINAPI BmpEncoder_Commit(IWICBitmapEncoder *iface)
static HRESULT WINAPI BmpEncoder_GetMetadataQueryWriter(IWICBitmapEncoder *iface, IWICMetadataQueryWriter **ppIMetadataQueryWriter)
static HRESULT WINAPI BmpFrameEncode_SetColorContexts(IWICBitmapFrameEncode *iface, UINT cCount, IWICColorContext **ppIColorContext)
static HRESULT BmpFrameEncode_AllocateBits(BmpFrameEncode *This)
static ULONG WINAPI BmpEncoder_AddRef(IWICBitmapEncoder *iface)
static HRESULT WINAPI BmpEncoder_SetPalette(IWICBitmapEncoder *iface, IWICPalette *palette)
static HRESULT WINAPI BmpFrameEncode_Initialize(IWICBitmapFrameEncode *iface, IPropertyBag2 *pIEncoderOptions)
static HRESULT WINAPI BmpEncoder_GetContainerFormat(IWICBitmapEncoder *iface, GUID *pguidContainerFormat)
static HRESULT WINAPI BmpEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID iid, void **ppv)
static const struct bmp_pixelformat formats[]
static const IWICBitmapFrameEncodeVtbl BmpFrameEncode_Vtbl
static HRESULT WINAPI BmpFrameEncode_GetMetadataQueryWriter(IWICBitmapFrameEncode *iface, IWICMetadataQueryWriter **ppIMetadataQueryWriter)
static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface)
static HRESULT WINAPI BmpFrameEncode_QueryInterface(IWICBitmapFrameEncode *iface, REFIID iid, void **ppv)
static BmpEncoder * impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
#define HeapFree(x, y, z)
HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
HRESULT write_source(IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, UINT bpp, INT width, INT height)
HRESULT configure_write_source(IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, INT width, INT height, double xres, double yres)
HRESULT CreatePropertyBag2(const PROPBAG2 *options, UINT count, IPropertyBag2 **ppPropertyBag2)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
IWICBitmapEncoder IWICBitmapEncoder_iface
const struct bmp_pixelformat * format
IWICBitmapFrameEncode IWICBitmapFrameEncode_iface
#define CONTAINING_RECORD(address, type, field)
WICBitmapEncoderCacheOption
static const char * debug_wic_rect(const WICRect *rect)
#define WINCODEC_ERR_WRONGSTATE
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
#define WINCODEC_ERR_NOTINITIALIZED
struct tagBITMAPFILEHEADER BITMAPFILEHEADER