ReactOS  0.4.15-dev-1207-g698a8e6
bmpencode.c File Reference
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wingdi.h"
#include "objbase.h"
#include "wincodecs_private.h"
#include "wine/debug.h"
Include dependency graph for bmpencode.c:

Go to the source code of this file.

Classes

struct  bmp_pixelformat
 
struct  BmpFrameEncode
 
struct  BmpEncoder
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct BmpFrameEncode BmpFrameEncode
 
typedef struct BmpEncoder BmpEncoder
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wincodecs)
 
static BmpFrameEncodeimpl_from_IWICBitmapFrameEncode (IWICBitmapFrameEncode *iface)
 
static HRESULT WINAPI BmpFrameEncode_QueryInterface (IWICBitmapFrameEncode *iface, REFIID iid, void **ppv)
 
static ULONG WINAPI BmpFrameEncode_AddRef (IWICBitmapFrameEncode *iface)
 
static ULONG WINAPI BmpFrameEncode_Release (IWICBitmapFrameEncode *iface)
 
static HRESULT WINAPI BmpFrameEncode_Initialize (IWICBitmapFrameEncode *iface, IPropertyBag2 *pIEncoderOptions)
 
static HRESULT WINAPI BmpFrameEncode_SetSize (IWICBitmapFrameEncode *iface, UINT uiWidth, UINT uiHeight)
 
static HRESULT WINAPI BmpFrameEncode_SetResolution (IWICBitmapFrameEncode *iface, double dpiX, double dpiY)
 
static HRESULT WINAPI BmpFrameEncode_SetPixelFormat (IWICBitmapFrameEncode *iface, WICPixelFormatGUID *pPixelFormat)
 
static HRESULT WINAPI BmpFrameEncode_SetColorContexts (IWICBitmapFrameEncode *iface, UINT cCount, IWICColorContext **ppIColorContext)
 
static HRESULT WINAPI BmpFrameEncode_SetPalette (IWICBitmapFrameEncode *iface, IWICPalette *palette)
 
static HRESULT WINAPI BmpFrameEncode_SetThumbnail (IWICBitmapFrameEncode *iface, IWICBitmapSource *pIThumbnail)
 
static HRESULT BmpFrameEncode_AllocateBits (BmpFrameEncode *This)
 
static HRESULT WINAPI BmpFrameEncode_WritePixels (IWICBitmapFrameEncode *iface, UINT lineCount, UINT cbStride, UINT cbBufferSize, BYTE *pbPixels)
 
static HRESULT WINAPI BmpFrameEncode_WriteSource (IWICBitmapFrameEncode *iface, IWICBitmapSource *pIBitmapSource, WICRect *prc)
 
static HRESULT WINAPI BmpFrameEncode_Commit (IWICBitmapFrameEncode *iface)
 
static HRESULT WINAPI BmpFrameEncode_GetMetadataQueryWriter (IWICBitmapFrameEncode *iface, IWICMetadataQueryWriter **ppIMetadataQueryWriter)
 
static BmpEncoderimpl_from_IWICBitmapEncoder (IWICBitmapEncoder *iface)
 
static HRESULT WINAPI BmpEncoder_QueryInterface (IWICBitmapEncoder *iface, REFIID iid, void **ppv)
 
static ULONG WINAPI BmpEncoder_AddRef (IWICBitmapEncoder *iface)
 
static ULONG WINAPI BmpEncoder_Release (IWICBitmapEncoder *iface)
 
static HRESULT WINAPI BmpEncoder_Initialize (IWICBitmapEncoder *iface, IStream *pIStream, WICBitmapEncoderCacheOption cacheOption)
 
static HRESULT WINAPI BmpEncoder_GetContainerFormat (IWICBitmapEncoder *iface, GUID *pguidContainerFormat)
 
static HRESULT WINAPI BmpEncoder_GetEncoderInfo (IWICBitmapEncoder *iface, IWICBitmapEncoderInfo **info)
 
static HRESULT WINAPI BmpEncoder_SetColorContexts (IWICBitmapEncoder *iface, UINT cCount, IWICColorContext **ppIColorContext)
 
static HRESULT WINAPI BmpEncoder_SetPalette (IWICBitmapEncoder *iface, IWICPalette *palette)
 
static HRESULT WINAPI BmpEncoder_SetThumbnail (IWICBitmapEncoder *iface, IWICBitmapSource *pIThumbnail)
 
static HRESULT WINAPI BmpEncoder_SetPreview (IWICBitmapEncoder *iface, IWICBitmapSource *pIPreview)
 
static HRESULT WINAPI BmpEncoder_CreateNewFrame (IWICBitmapEncoder *iface, IWICBitmapFrameEncode **ppIFrameEncode, IPropertyBag2 **ppIEncoderOptions)
 
static HRESULT WINAPI BmpEncoder_Commit (IWICBitmapEncoder *iface)
 
static HRESULT WINAPI BmpEncoder_GetMetadataQueryWriter (IWICBitmapEncoder *iface, IWICMetadataQueryWriter **ppIMetadataQueryWriter)
 
HRESULT BmpEncoder_CreateInstance (REFIID iid, void **ppv)
 

Variables

static const struct bmp_pixelformat formats []
 
static 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}
 
static const IWICBitmapFrameEncodeVtbl BmpFrameEncode_Vtbl
 
static const IWICBitmapEncoderVtbl BmpEncoder_Vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file bmpencode.c.

Typedef Documentation

◆ BmpEncoder

◆ BmpFrameEncode

Function Documentation

◆ BmpEncoder_AddRef()

static ULONG WINAPI BmpEncoder_AddRef ( IWICBitmapEncoder iface)
static

Definition at line 461 of file bmpencode.c.

462 {
465 
466  TRACE("(%p) refcount=%u\n", iface, ref);
467 
468  return ref;
469 }
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static BmpEncoder * impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
Definition: bmpencode.c:433
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ BmpEncoder_Commit()

static HRESULT WINAPI BmpEncoder_Commit ( IWICBitmapEncoder iface)
static

Definition at line 609 of file bmpencode.c.

610 {
612  TRACE("(%p)\n", iface);
613 
614  if (!This->frame || !This->frame->committed) return WINCODEC_ERR_WRONGSTATE;
615 
616  return S_OK;
617 }
#define TRACE(s)
Definition: solgame.cpp:4
static BmpEncoder * impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
Definition: bmpencode.c:433
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3273
#define S_OK
Definition: intsafe.h:51

◆ BmpEncoder_CreateInstance()

HRESULT BmpEncoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 642 of file bmpencode.c.

643 {
644  BmpEncoder *This;
645  HRESULT ret;
646 
647  TRACE("(%s,%p)\n", debugstr_guid(iid), ppv);
648 
649  *ppv = NULL;
650 
651  This = HeapAlloc(GetProcessHeap(), 0, sizeof(BmpEncoder));
652  if (!This) return E_OUTOFMEMORY;
653 
654  This->IWICBitmapEncoder_iface.lpVtbl = &BmpEncoder_Vtbl;
655  This->ref = 1;
656  This->stream = NULL;
657  This->frame = NULL;
658 
659  ret = IWICBitmapEncoder_QueryInterface(&This->IWICBitmapEncoder_iface, iid, ppv);
660  IWICBitmapEncoder_Release(&This->IWICBitmapEncoder_iface);
661 
662  return ret;
663 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:79
int ret
static const IWICBitmapEncoderVtbl BmpEncoder_Vtbl
Definition: bmpencode.c:626

◆ BmpEncoder_CreateNewFrame()

static HRESULT WINAPI BmpEncoder_CreateNewFrame ( IWICBitmapEncoder iface,
IWICBitmapFrameEncode **  ppIFrameEncode,
IPropertyBag2 **  ppIEncoderOptions 
)
static

Definition at line 558 of file bmpencode.c.

560 {
562  BmpFrameEncode *encode;
563  HRESULT hr;
564  static const PROPBAG2 opts[1] =
565  {
566  { PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, (LPOLESTR)wszEnableV5Header32bppBGRA },
567  };
568 
569  TRACE("(%p,%p,%p)\n", iface, ppIFrameEncode, ppIEncoderOptions);
570 
571  if (This->frame) return WINCODEC_ERR_UNSUPPORTEDOPERATION;
572 
573  if (!This->stream) return WINCODEC_ERR_NOTINITIALIZED;
574 
575  if (ppIEncoderOptions)
576  {
577  hr = CreatePropertyBag2(opts, ARRAY_SIZE(opts), ppIEncoderOptions);
578  if (FAILED(hr)) return hr;
579  }
580 
581  encode = HeapAlloc(GetProcessHeap(), 0, sizeof(BmpFrameEncode));
582  if (!encode)
583  {
584  IPropertyBag2_Release(*ppIEncoderOptions);
585  *ppIEncoderOptions = NULL;
586  return E_OUTOFMEMORY;
587  }
589  encode->ref = 2;
590  IStream_AddRef(This->stream);
591  encode->stream = This->stream;
592  encode->initialized = FALSE;
593  encode->width = 0;
594  encode->height = 0;
595  encode->bits = NULL;
596  encode->format = NULL;
597  encode->xres = 0.0;
598  encode->yres = 0.0;
599  encode->lineswritten = 0;
600  encode->colors = 0;
601  encode->committed = FALSE;
602 
603  *ppIFrameEncode = &encode->IWICBitmapFrameEncode_iface;
604  This->frame = encode;
605 
606  return S_OK;
607 }
IStream * stream
Definition: bmpencode.c:69
HRESULT hr
Definition: shlfolder.c:183
UINT lineswritten
Definition: bmpencode.c:75
#define WINCODEC_ERR_NOTINITIALIZED
Definition: winerror.h:3277
static LPOLESTR
Definition: stg_prop.c:27
double yres
Definition: bmpencode.c:74
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
double xres
Definition: bmpencode.c:74
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static BmpEncoder * impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
Definition: bmpencode.c:433
LONG HRESULT
Definition: typedefs.h:79
IWICBitmapFrameEncode IWICBitmapFrameEncode_iface
Definition: bmpencode.c:67
BYTE * bits
Definition: bmpencode.c:72
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
Definition: winerror.h:3300
BOOL committed
Definition: bmpencode.c:79
#define S_OK
Definition: intsafe.h:51
static const IWICBitmapFrameEncodeVtbl BmpFrameEncode_Vtbl
Definition: bmpencode.c:409
HRESULT CreatePropertyBag2(const PROPBAG2 *options, UINT count, IPropertyBag2 **ppPropertyBag2)
Definition: propertybag.c:281
#define ARRAY_SIZE(a)
Definition: main.h:24
const struct bmp_pixelformat * format
Definition: bmpencode.c:73
static const WCHAR wszEnableV5Header32bppBGRA[]
Definition: bmpencode.c:82
BOOL initialized
Definition: bmpencode.c:70

◆ BmpEncoder_GetContainerFormat()

static HRESULT WINAPI BmpEncoder_GetContainerFormat ( IWICBitmapEncoder iface,
GUID pguidContainerFormat 
)
static

Definition at line 501 of file bmpencode.c.

503 {
504  TRACE("(%p,%p)\n", iface, pguidContainerFormat);
505 
506  if (!pguidContainerFormat)
507  return E_INVALIDARG;
508 
509  memcpy(pguidContainerFormat, &GUID_ContainerFormatBmp, sizeof(GUID));
510  return S_OK;
511 }
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:51

◆ BmpEncoder_GetEncoderInfo()

static HRESULT WINAPI BmpEncoder_GetEncoderInfo ( IWICBitmapEncoder iface,
IWICBitmapEncoderInfo **  info 
)
static

Definition at line 513 of file bmpencode.c.

514 {
515  IWICComponentInfo *comp_info;
516  HRESULT hr;
517 
518  TRACE("%p,%p\n", iface, info);
519 
520  if (!info) return E_INVALIDARG;
521 
522  hr = CreateComponentInfo(&CLSID_WICBmpEncoder, &comp_info);
523  if (hr == S_OK)
524  {
525  hr = IWICComponentInfo_QueryInterface(comp_info, &IID_IWICBitmapEncoderInfo, (void **)info);
526  IWICComponentInfo_Release(comp_info);
527  }
528  return hr;
529 }
HRESULT hr
Definition: shlfolder.c:183
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
Definition: info.c:2075
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define S_OK
Definition: intsafe.h:51

◆ BmpEncoder_GetMetadataQueryWriter()

static HRESULT WINAPI BmpEncoder_GetMetadataQueryWriter ( IWICBitmapEncoder iface,
IWICMetadataQueryWriter **  ppIMetadataQueryWriter 
)
static

Definition at line 619 of file bmpencode.c.

621 {
622  FIXME("(%p,%p): stub\n", iface, ppIMetadataQueryWriter);
623  return E_NOTIMPL;
624 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BmpEncoder_Initialize()

static HRESULT WINAPI BmpEncoder_Initialize ( IWICBitmapEncoder iface,
IStream pIStream,
WICBitmapEncoderCacheOption  cacheOption 
)
static

Definition at line 488 of file bmpencode.c.

490 {
492 
493  TRACE("(%p,%p,%u)\n", iface, pIStream, cacheOption);
494 
495  IStream_AddRef(pIStream);
496  This->stream = pIStream;
497 
498  return S_OK;
499 }
#define TRACE(s)
Definition: solgame.cpp:4
static BmpEncoder * impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
Definition: bmpencode.c:433
#define S_OK
Definition: intsafe.h:51

◆ BmpEncoder_QueryInterface()

static HRESULT WINAPI BmpEncoder_QueryInterface ( IWICBitmapEncoder iface,
REFIID  iid,
void **  ppv 
)
static

Definition at line 438 of file bmpencode.c.

440 {
442  TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
443 
444  if (!ppv) return E_INVALIDARG;
445 
446  if (IsEqualIID(&IID_IUnknown, iid) ||
447  IsEqualIID(&IID_IWICBitmapEncoder, iid))
448  {
449  *ppv = &This->IWICBitmapEncoder_iface;
450  }
451  else
452  {
453  *ppv = NULL;
454  return E_NOINTERFACE;
455  }
456 
457  IUnknown_AddRef((IUnknown*)*ppv);
458  return S_OK;
459 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static BmpEncoder * impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
Definition: bmpencode.c:433
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:51
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ BmpEncoder_Release()

static ULONG WINAPI BmpEncoder_Release ( IWICBitmapEncoder iface)
static

Definition at line 471 of file bmpencode.c.

472 {
475 
476  TRACE("(%p) refcount=%u\n", iface, ref);
477 
478  if (ref == 0)
479  {
480  if (This->stream) IStream_Release(This->stream);
481  if (This->frame) IWICBitmapFrameEncode_Release(&This->frame->IWICBitmapFrameEncode_iface);
483  }
484 
485  return ref;
486 }
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
static BmpEncoder * impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
Definition: bmpencode.c:433
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ BmpEncoder_SetColorContexts()

static HRESULT WINAPI BmpEncoder_SetColorContexts ( IWICBitmapEncoder iface,
UINT  cCount,
IWICColorContext **  ppIColorContext 
)
static

Definition at line 531 of file bmpencode.c.

533 {
534  FIXME("(%p,%u,%p): stub\n", iface, cCount, ppIColorContext);
535  return E_NOTIMPL;
536 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BmpEncoder_SetPalette()

static HRESULT WINAPI BmpEncoder_SetPalette ( IWICBitmapEncoder iface,
IWICPalette palette 
)
static

Definition at line 538 of file bmpencode.c.

539 {
541 
542  TRACE("(%p,%p)\n", iface, palette);
544 }
#define WINCODEC_ERR_NOTINITIALIZED
Definition: winerror.h:3277
#define TRACE(s)
Definition: solgame.cpp:4
static BmpEncoder * impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
Definition: bmpencode.c:433
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
Definition: winerror.h:3300
static HPALETTE palette
Definition: clipboard.c:1345

◆ BmpEncoder_SetPreview()

static HRESULT WINAPI BmpEncoder_SetPreview ( IWICBitmapEncoder iface,
IWICBitmapSource pIPreview 
)
static

Definition at line 552 of file bmpencode.c.

553 {
554  TRACE("(%p,%p)\n", iface, pIPreview);
556 }
#define TRACE(s)
Definition: solgame.cpp:4
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
Definition: winerror.h:3300

◆ BmpEncoder_SetThumbnail()

static HRESULT WINAPI BmpEncoder_SetThumbnail ( IWICBitmapEncoder iface,
IWICBitmapSource pIThumbnail 
)
static

Definition at line 546 of file bmpencode.c.

547 {
548  TRACE("(%p,%p)\n", iface, pIThumbnail);
550 }
#define TRACE(s)
Definition: solgame.cpp:4
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
Definition: winerror.h:3300

◆ BmpFrameEncode_AddRef()

static ULONG WINAPI BmpFrameEncode_AddRef ( IWICBitmapFrameEncode iface)
static

Definition at line 112 of file bmpencode.c.

113 {
116 
117  TRACE("(%p) refcount=%u\n", iface, ref);
118 
119  return ref;
120 }
Definition: send.c:48
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:84
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ BmpFrameEncode_AllocateBits()

static HRESULT BmpFrameEncode_AllocateBits ( BmpFrameEncode This)
static

Definition at line 248 of file bmpencode.c.

249 {
250  if (!This->bits)
251  {
252  if (!This->initialized || !This->width || !This->height || !This->format)
254 
255  This->stride = (((This->width * This->format->bpp)+31)/32)*4;
256  This->bits = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->stride * This->height);
257  if (!This->bits) return E_OUTOFMEMORY;
258  }
259 
260  return S_OK;
261 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3273
#define S_OK
Definition: intsafe.h:51
#define HEAP_ZERO_MEMORY
Definition: compat.h:134

Referenced by BmpFrameEncode_WritePixels().

◆ BmpFrameEncode_Commit()

static HRESULT WINAPI BmpFrameEncode_Commit ( IWICBitmapFrameEncode iface)
static

Definition at line 325 of file bmpencode.c.

326 {
328  BITMAPFILEHEADER bfh;
329  BITMAPV5HEADER bih;
330  UINT info_size;
332  ULONG byteswritten;
333  HRESULT hr;
334 
335  TRACE("(%p)\n", iface);
336 
337  if (!This->bits || This->committed || This->height != This->lineswritten)
339 
340  bfh.bfType = 0x4d42; /* "BM" */
341  bfh.bfReserved1 = 0;
342  bfh.bfReserved2 = 0;
343 
344  bih.bV5Size = info_size = sizeof(BITMAPINFOHEADER);
345  bih.bV5Width = This->width;
346  bih.bV5Height = This->height;
347  bih.bV5Planes = 1;
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;
355 
356  if (This->format->compression == BI_BITFIELDS)
357  {
358  if (This->format->alphamask)
359  bih.bV5Size = info_size = sizeof(BITMAPV4HEADER);
360  else
361  info_size = sizeof(BITMAPINFOHEADER)+12;
362  bih.bV5RedMask = This->format->redmask;
363  bih.bV5GreenMask = This->format->greenmask;
364  bih.bV5BlueMask = This->format->bluemask;
365  bih.bV5AlphaMask = This->format->alphamask;
366  bih.bV5CSType = LCS_DEVICE_RGB;
367  }
368 
369  bfh.bfSize = sizeof(BITMAPFILEHEADER) + info_size + bih.bV5SizeImage;
370  bfh.bfOffBits = sizeof(BITMAPFILEHEADER) + info_size;
371  bfh.bfOffBits += bih.bV5ClrUsed * sizeof(WICColor);
372 
373  pos.QuadPart = 0;
374  hr = IStream_Seek(This->stream, pos, STREAM_SEEK_SET, NULL);
375  if (FAILED(hr)) return hr;
376 
377  hr = IStream_Write(This->stream, &bfh, sizeof(BITMAPFILEHEADER), &byteswritten);
378  if (FAILED(hr)) return hr;
379  if (byteswritten != sizeof(BITMAPFILEHEADER)) return E_FAIL;
380 
381  hr = IStream_Write(This->stream, &bih, info_size, &byteswritten);
382  if (FAILED(hr)) return hr;
383  if (byteswritten != info_size) return E_FAIL;
384 
385  /* write the palette */
386  if (This->format->colors)
387  {
388  hr = IStream_Write(This->stream, This->palette, This->colors * sizeof(WICColor), &byteswritten);
389  if (FAILED(hr)) return hr;
390  if (byteswritten != This->colors * sizeof(WICColor)) return E_FAIL;
391  }
392 
393  hr = IStream_Write(This->stream, This->bits, bih.bV5SizeImage, &byteswritten);
394  if (FAILED(hr)) return hr;
395  if (byteswritten != bih.bV5SizeImage) return E_FAIL;
396 
397  This->committed = TRUE;
398 
399  return S_OK;
400 }
HRESULT hr
Definition: shlfolder.c:183
#define TRUE
Definition: types.h:120
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
#define E_FAIL
Definition: ddrawi.h:102
#define BI_BITFIELDS
Definition: mmreg.h:507
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:84
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
if(!(yy_init))
Definition: macro.lex.yy.c:714
LONG HRESULT
Definition: typedefs.h:79
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3273
#define S_OK
Definition: intsafe.h:51
struct tagBITMAPFILEHEADER BITMAPFILEHEADER
unsigned int UINT
Definition: ndis.h:50
unsigned int ULONG
Definition: retypes.h:1
#define LCS_DEVICE_RGB
Definition: wingdi.h:1097
UINT32 WICColor
Definition: wincodec.idl:250

◆ BmpFrameEncode_GetMetadataQueryWriter()

static HRESULT WINAPI BmpFrameEncode_GetMetadataQueryWriter ( IWICBitmapFrameEncode iface,
IWICMetadataQueryWriter **  ppIMetadataQueryWriter 
)
static

Definition at line 402 of file bmpencode.c.

404 {
405  FIXME("(%p, %p): stub\n", iface, ppIMetadataQueryWriter);
406  return E_NOTIMPL;
407 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BmpFrameEncode_Initialize()

static HRESULT WINAPI BmpFrameEncode_Initialize ( IWICBitmapFrameEncode iface,
IPropertyBag2 pIEncoderOptions 
)
static

Definition at line 139 of file bmpencode.c.

141 {
143  TRACE("(%p,%p)\n", iface, pIEncoderOptions);
144 
145  if (This->initialized) return WINCODEC_ERR_WRONGSTATE;
146 
147  if (pIEncoderOptions)
148  WARN("ignoring encoder options.\n");
149 
150  This->initialized = TRUE;
151 
152  return S_OK;
153 }
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:112
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:84
#define TRACE(s)
Definition: solgame.cpp:4
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3273
#define S_OK
Definition: intsafe.h:51

◆ BmpFrameEncode_QueryInterface()

static HRESULT WINAPI BmpFrameEncode_QueryInterface ( IWICBitmapFrameEncode iface,
REFIID  iid,
void **  ppv 
)
static

Definition at line 89 of file bmpencode.c.

91 {
93  TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
94 
95  if (!ppv) return E_INVALIDARG;
96 
97  if (IsEqualIID(&IID_IUnknown, iid) ||
98  IsEqualIID(&IID_IWICBitmapFrameEncode, iid))
99  {
100  *ppv = &This->IWICBitmapFrameEncode_iface;
101  }
102  else
103  {
104  *ppv = NULL;
105  return E_NOINTERFACE;
106  }
107 
108  IUnknown_AddRef((IUnknown*)*ppv);
109  return S_OK;
110 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID LPVOID * ppv
Definition: atlbase.h:39
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:84
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:51
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ BmpFrameEncode_Release()

static ULONG WINAPI BmpFrameEncode_Release ( IWICBitmapFrameEncode iface)
static

Definition at line 122 of file bmpencode.c.

123 {
126 
127  TRACE("(%p) refcount=%u\n", iface, ref);
128 
129  if (ref == 0)
130  {
131  if (This->stream) IStream_Release(This->stream);
132  HeapFree(GetProcessHeap(), 0, This->bits);
134  }
135 
136  return ref;
137 }
Definition: send.c:48
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:84
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ BmpFrameEncode_SetColorContexts()

static HRESULT WINAPI BmpFrameEncode_SetColorContexts ( IWICBitmapFrameEncode iface,
UINT  cCount,
IWICColorContext **  ppIColorContext 
)
static

Definition at line 211 of file bmpencode.c.

213 {
214  FIXME("(%p,%u,%p): stub\n", iface, cCount, ppIColorContext);
215  return E_NOTIMPL;
216 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ BmpFrameEncode_SetPalette()

static HRESULT WINAPI BmpFrameEncode_SetPalette ( IWICBitmapFrameEncode iface,
IWICPalette palette 
)
static

Definition at line 218 of file bmpencode.c.

220 {
222  HRESULT hr;
223 
224  TRACE("(%p,%p)\n", iface, palette);
225 
226  if (!palette) return E_INVALIDARG;
227 
228  if (!This->initialized)
230 
231  hr = IWICPalette_GetColors(palette, 256, This->palette, &This->colors);
232  if (hr == S_OK)
233  {
234  UINT i;
235  for (i = 0; i < This->colors; i++)
236  This->palette[i] |= 0xff000000; /* BMP palette has no alpha */
237  }
238  return hr;
239 }
HRESULT hr
Definition: shlfolder.c:183
#define WINCODEC_ERR_NOTINITIALIZED
Definition: winerror.h:3277
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
Definition: glfuncs.h:248
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:84
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
static HPALETTE palette
Definition: clipboard.c:1345
#define S_OK
Definition: intsafe.h:51
unsigned int UINT
Definition: ndis.h:50

◆ BmpFrameEncode_SetPixelFormat()

static HRESULT WINAPI BmpFrameEncode_SetPixelFormat ( IWICBitmapFrameEncode iface,
WICPixelFormatGUID pPixelFormat 
)
static

Definition at line 183 of file bmpencode.c.

185 {
187  int i;
188  TRACE("(%p,%s)\n", iface, debugstr_guid(pPixelFormat));
189 
190  if (!This->initialized || This->bits) return WINCODEC_ERR_WRONGSTATE;
191 
192  if (IsEqualGUID(pPixelFormat, &GUID_WICPixelFormatBlackWhite))
193  *pPixelFormat = GUID_WICPixelFormat1bppIndexed;
194  else if (IsEqualGUID(pPixelFormat, &GUID_WICPixelFormat2bppIndexed))
195  *pPixelFormat = GUID_WICPixelFormat4bppIndexed;
196 
197  for (i=0; formats[i].guid; i++)
198  {
199  if (IsEqualGUID(formats[i].guid, pPixelFormat))
200  break;
201  }
202 
203  if (!formats[i].guid) i = 0;
204 
205  This->format = &formats[i];
206  memcpy(pPixelFormat, This->format->guid, sizeof(GUID));
207 
208  return S_OK;
209 }
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
Definition: glfuncs.h:248
const GUID * guid
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:84
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3273
#define S_OK
Definition: intsafe.h:51
static const struct bmp_pixelformat formats[]
Definition: bmpencode.c:49
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ BmpFrameEncode_SetResolution()

static HRESULT WINAPI BmpFrameEncode_SetResolution ( IWICBitmapFrameEncode iface,
double  dpiX,
double  dpiY 
)
static

Definition at line 169 of file bmpencode.c.

171 {
173  TRACE("(%p,%0.2f,%0.2f)\n", iface, dpiX, dpiY);
174 
175  if (!This->initialized || This->bits) return WINCODEC_ERR_WRONGSTATE;
176 
177  This->xres = dpiX;
178  This->yres = dpiY;
179 
180  return S_OK;
181 }
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:84
#define TRACE(s)
Definition: solgame.cpp:4
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3273
#define S_OK
Definition: intsafe.h:51

◆ BmpFrameEncode_SetSize()

static HRESULT WINAPI BmpFrameEncode_SetSize ( IWICBitmapFrameEncode iface,
UINT  uiWidth,
UINT  uiHeight 
)
static

Definition at line 155 of file bmpencode.c.

157 {
159  TRACE("(%p,%u,%u)\n", iface, uiWidth, uiHeight);
160 
161  if (!This->initialized || This->bits) return WINCODEC_ERR_WRONGSTATE;
162 
163  This->width = uiWidth;
164  This->height = uiHeight;
165 
166  return S_OK;
167 }
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:84
#define TRACE(s)
Definition: solgame.cpp:4
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3273
#define S_OK
Definition: intsafe.h:51

◆ BmpFrameEncode_SetThumbnail()

static HRESULT WINAPI BmpFrameEncode_SetThumbnail ( IWICBitmapFrameEncode iface,
IWICBitmapSource pIThumbnail 
)
static

Definition at line 241 of file bmpencode.c.

243 {
244  FIXME("(%p,%p): stub\n", iface, pIThumbnail);
246 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
Definition: winerror.h:3300

◆ BmpFrameEncode_WritePixels()

static HRESULT WINAPI BmpFrameEncode_WritePixels ( IWICBitmapFrameEncode iface,
UINT  lineCount,
UINT  cbStride,
UINT  cbBufferSize,
BYTE pbPixels 
)
static

Definition at line 263 of file bmpencode.c.

265 {
267  UINT dstbuffersize, bytesperrow, row;
268  BYTE *dst, *src;
269  HRESULT hr;
270 
271  TRACE("(%p,%u,%u,%u,%p)\n", iface, lineCount, cbStride, cbBufferSize, pbPixels);
272 
273  if (!This->initialized || !This->width || !This->height || !This->format)
275 
277  if (FAILED(hr)) return hr;
278 
279  bytesperrow = ((This->format->bpp * This->width) + 7) / 8;
280 
281  if (This->stride < bytesperrow)
282  return E_INVALIDARG;
283 
284  dstbuffersize = This->stride * (This->height - This->lineswritten);
285  if ((This->stride * (lineCount - 1)) + bytesperrow > dstbuffersize)
286  return E_INVALIDARG;
287 
288  src = pbPixels;
289  dst = This->bits + This->stride * (This->height - This->lineswritten - 1);
290  for (row = 0; row < lineCount; row++)
291  {
292  memcpy(dst, src, bytesperrow);
293  src += cbStride;
294  dst -= This->stride;
295  }
296 
297  This->lineswritten += lineCount;
298 
299  return S_OK;
300 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT BmpFrameEncode_AllocateBits(BmpFrameEncode *This)
Definition: bmpencode.c:248
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:84
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum src
Definition: glext.h:6340
unsigned char BYTE
Definition: xxhash.c:193
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3273
#define S_OK
Definition: intsafe.h:51
GLenum GLenum dst
Definition: glext.h:6340
unsigned int UINT
Definition: ndis.h:50
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
Definition: typeof.h:78

◆ BmpFrameEncode_WriteSource()

static HRESULT WINAPI BmpFrameEncode_WriteSource ( IWICBitmapFrameEncode iface,
IWICBitmapSource pIBitmapSource,
WICRect prc 
)
static

Definition at line 302 of file bmpencode.c.

304 {
306  HRESULT hr;
307  TRACE("(%p,%p,%s)\n", iface, pIBitmapSource, debug_wic_rect(prc));
308 
309  if (!This->initialized)
311 
312  hr = configure_write_source(iface, pIBitmapSource, prc,
313  This->format ? This->format->guid : NULL, This->width, This->height,
314  This->xres, This->yres);
315 
316  if (SUCCEEDED(hr))
317  {
318  hr = write_source(iface, pIBitmapSource, prc,
319  This->format->guid, This->format->bpp, This->width, This->height);
320  }
321 
322  return hr;
323 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT write_source(IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, UINT bpp, INT width, INT height)
Definition: main.c:155
static BmpFrameEncode * impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:84
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
static const char * debug_wic_rect(const WICRect *rect)
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3273
HRESULT configure_write_source(IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, INT width, INT height, double xres, double yres)
Definition: main.c:123
_Out_ LPRECT prc
Definition: ntgdi.h:1658
#define SUCCEEDED(hr)
Definition: intsafe.h:49

◆ impl_from_IWICBitmapEncoder()

static BmpEncoder* impl_from_IWICBitmapEncoder ( IWICBitmapEncoder iface)
inlinestatic

Definition at line 433 of file bmpencode.c.

434 {
435  return CONTAINING_RECORD(iface, BmpEncoder, IWICBitmapEncoder_iface);
436 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by BmpEncoder_AddRef(), BmpEncoder_Commit(), BmpEncoder_CreateNewFrame(), BmpEncoder_Initialize(), BmpEncoder_QueryInterface(), BmpEncoder_Release(), and BmpEncoder_SetPalette().

◆ impl_from_IWICBitmapFrameEncode()

static BmpFrameEncode* impl_from_IWICBitmapFrameEncode ( IWICBitmapFrameEncode iface)
inlinestatic

Definition at line 84 of file bmpencode.c.

85 {
86  return CONTAINING_RECORD(iface, BmpFrameEncode, IWICBitmapFrameEncode_iface);
87 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by BmpFrameEncode_AddRef(), BmpFrameEncode_Commit(), BmpFrameEncode_Initialize(), BmpFrameEncode_QueryInterface(), BmpFrameEncode_Release(), BmpFrameEncode_SetPalette(), BmpFrameEncode_SetPixelFormat(), BmpFrameEncode_SetResolution(), BmpFrameEncode_SetSize(), BmpFrameEncode_WritePixels(), and BmpFrameEncode_WriteSource().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wincodecs  )

Variable Documentation

◆ BmpEncoder_Vtbl

const IWICBitmapEncoderVtbl BmpEncoder_Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI BmpEncoder_GetMetadataQueryWriter(IWICBitmapEncoder *iface, IWICMetadataQueryWriter **ppIMetadataQueryWriter)
Definition: bmpencode.c:619
static ULONG WINAPI BmpEncoder_Release(IWICBitmapEncoder *iface)
Definition: bmpencode.c:471
static ULONG WINAPI BmpEncoder_AddRef(IWICBitmapEncoder *iface)
Definition: bmpencode.c:461
static HRESULT WINAPI BmpEncoder_SetColorContexts(IWICBitmapEncoder *iface, UINT cCount, IWICColorContext **ppIColorContext)
Definition: bmpencode.c:531
static HRESULT WINAPI BmpEncoder_Initialize(IWICBitmapEncoder *iface, IStream *pIStream, WICBitmapEncoderCacheOption cacheOption)
Definition: bmpencode.c:488
static HRESULT WINAPI BmpEncoder_GetContainerFormat(IWICBitmapEncoder *iface, GUID *pguidContainerFormat)
Definition: bmpencode.c:501
static HRESULT WINAPI BmpEncoder_Commit(IWICBitmapEncoder *iface)
Definition: bmpencode.c:609
static HRESULT WINAPI BmpEncoder_SetThumbnail(IWICBitmapEncoder *iface, IWICBitmapSource *pIThumbnail)
Definition: bmpencode.c:546
static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface, IWICBitmapFrameEncode **ppIFrameEncode, IPropertyBag2 **ppIEncoderOptions)
Definition: bmpencode.c:558
static HRESULT WINAPI BmpEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID iid, void **ppv)
Definition: bmpencode.c:438
static HRESULT WINAPI BmpEncoder_GetEncoderInfo(IWICBitmapEncoder *iface, IWICBitmapEncoderInfo **info)
Definition: bmpencode.c:513
static HRESULT WINAPI BmpEncoder_SetPalette(IWICBitmapEncoder *iface, IWICPalette *palette)
Definition: bmpencode.c:538
static HRESULT WINAPI BmpEncoder_SetPreview(IWICBitmapEncoder *iface, IWICBitmapSource *pIPreview)
Definition: bmpencode.c:552

Definition at line 626 of file bmpencode.c.

Referenced by BmpEncoder_CreateInstance().

◆ BmpFrameEncode_Vtbl

const IWICBitmapFrameEncodeVtbl BmpFrameEncode_Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI BmpFrameEncode_Initialize(IWICBitmapFrameEncode *iface, IPropertyBag2 *pIEncoderOptions)
Definition: bmpencode.c:139
static HRESULT WINAPI BmpFrameEncode_SetPalette(IWICBitmapFrameEncode *iface, IWICPalette *palette)
Definition: bmpencode.c:218
static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:325
static HRESULT WINAPI BmpFrameEncode_SetThumbnail(IWICBitmapFrameEncode *iface, IWICBitmapSource *pIThumbnail)
Definition: bmpencode.c:241
static ULONG WINAPI BmpFrameEncode_Release(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:122
static HRESULT WINAPI BmpFrameEncode_GetMetadataQueryWriter(IWICBitmapFrameEncode *iface, IWICMetadataQueryWriter **ppIMetadataQueryWriter)
Definition: bmpencode.c:402
static HRESULT WINAPI BmpFrameEncode_WriteSource(IWICBitmapFrameEncode *iface, IWICBitmapSource *pIBitmapSource, WICRect *prc)
Definition: bmpencode.c:302
static HRESULT WINAPI BmpFrameEncode_SetPixelFormat(IWICBitmapFrameEncode *iface, WICPixelFormatGUID *pPixelFormat)
Definition: bmpencode.c:183
static HRESULT WINAPI BmpFrameEncode_QueryInterface(IWICBitmapFrameEncode *iface, REFIID iid, void **ppv)
Definition: bmpencode.c:89
static ULONG WINAPI BmpFrameEncode_AddRef(IWICBitmapFrameEncode *iface)
Definition: bmpencode.c:112
static HRESULT WINAPI BmpFrameEncode_SetSize(IWICBitmapFrameEncode *iface, UINT uiWidth, UINT uiHeight)
Definition: bmpencode.c:155
static HRESULT WINAPI BmpFrameEncode_WritePixels(IWICBitmapFrameEncode *iface, UINT lineCount, UINT cbStride, UINT cbBufferSize, BYTE *pbPixels)
Definition: bmpencode.c:263
static HRESULT WINAPI BmpFrameEncode_SetResolution(IWICBitmapFrameEncode *iface, double dpiX, double dpiY)
Definition: bmpencode.c:169
static HRESULT WINAPI BmpFrameEncode_SetColorContexts(IWICBitmapFrameEncode *iface, UINT cCount, IWICColorContext **ppIColorContext)
Definition: bmpencode.c:211

Definition at line 409 of file bmpencode.c.

Referenced by BmpEncoder_CreateNewFrame().

◆ formats

const struct bmp_pixelformat formats[]
static
Initial value:
= {
{&GUID_WICPixelFormat24bppBGR, 24, 0, BI_RGB},
{&GUID_WICPixelFormatBlackWhite, 1, 2, BI_RGB},
{&GUID_WICPixelFormat1bppIndexed, 1, 2, BI_RGB},
{&GUID_WICPixelFormat2bppIndexed, 2, 4, BI_RGB},
{&GUID_WICPixelFormat4bppIndexed, 4, 16, BI_RGB},
{&GUID_WICPixelFormat8bppIndexed, 8, 256, BI_RGB},
{&GUID_WICPixelFormat16bppBGR555, 16, 0, BI_RGB},
{&GUID_WICPixelFormat16bppBGR565, 16, 0, BI_BITFIELDS, 0xf800, 0x7e0, 0x1f, 0},
{&GUID_WICPixelFormat32bppBGR, 32, 0, BI_RGB},
{NULL}
}
#define BI_BITFIELDS
Definition: mmreg.h:507
smooth NULL
Definition: ftsmooth.c:416
#define BI_RGB
Definition: precomp.h:47

Definition at line 49 of file bmpencode.c.

Referenced by BmpFrameEncode_SetPixelFormat().

◆ wszEnableV5Header32bppBGRA

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}
static

Definition at line 82 of file bmpencode.c.

Referenced by BmpEncoder_CreateNewFrame().