ReactOS  0.4.14-dev-358-gbef841c
wincodecs_private.h File Reference
#include "wincodec.h"
#include "wincodecsdk.h"
#include "wine/debug.h"
#include "wine/unicode.h"
Include dependency graph for wincodecs_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _MetadataItem
 
struct  _MetadataHandlerVtbl
 

Macros

#define INTERFACE   IMILBitmapSource
 
#define INTERFACE   IMILBitmapScaler
 
#define THISCALL(func)   func
 
#define DEFINE_THISCALL_WRAPPER(func, args)   /* nothing */
 
#define INTERFACE   IMILUnknown1
 
#define INTERFACE   IMILUnknown2
 

Typedefs

typedef HRESULT(* class_constructor) (REFIID, void **)
 
typedef struct BmpDecoder BmpDecoder
 
typedef struct _MetadataItem MetadataItem
 
typedef struct _MetadataHandlerVtbl MetadataHandlerVtbl
 

Functions

 DEFINE_GUID (CLSID_WineTgaDecoder, 0xb11fc79a, 0x67cc, 0x43e6, 0xa9, 0xce, 0xe3, 0xd5, 0x49, 0x45, 0xd3, 0x04)
 
 DEFINE_GUID (CLSID_WICIcnsEncoder, 0x312fb6f1, 0xb767, 0x409d, 0x8a, 0x6d, 0x0f, 0xc1, 0x54, 0xd4, 0xf0, 0x5c)
 
 DEFINE_GUID (GUID_WineContainerFormatTga, 0x0c44fda1, 0xa5c5, 0x4298, 0x96, 0x85, 0x47, 0x3f, 0xc1, 0x7c, 0xd3, 0x22)
 
 DEFINE_GUID (GUID_VendorWine, 0xddf46da1, 0x7dc1, 0x404e, 0x98, 0xf2, 0xef, 0xa4, 0x8d, 0xfc, 0x95, 0x0a)
 
 DEFINE_GUID (IID_IMILBitmap, 0xb1784d3f, 0x8115, 0x4763, 0x13, 0xaa, 0x32, 0xed, 0xdb, 0x68, 0x29, 0x4a)
 
 DEFINE_GUID (IID_IMILBitmapSource, 0x7543696a, 0xbc8d, 0x46b0, 0x5f, 0x81, 0x8d, 0x95, 0x72, 0x89, 0x72, 0xbe)
 
 DEFINE_GUID (IID_IMILBitmapLock, 0xa67b2b53, 0x8fa1, 0x4155, 0x8f, 0x64, 0x0c, 0x24, 0x7a, 0x8f, 0x84, 0xcd)
 
 DEFINE_GUID (IID_IMILBitmapScaler, 0xa767b0f0, 0x1c8c, 0x4aef, 0x56, 0x8f, 0xad, 0xf9, 0x6d, 0xcf, 0xd5, 0xcb)
 
 DEFINE_GUID (IID_IMILFormatConverter, 0x7e2a746f, 0x25c5, 0x4851, 0xb3, 0xaf, 0x44, 0x3b, 0x79, 0x63, 0x9e, 0xc0)
 
 DEFINE_GUID (IID_IMILPalette, 0xca8e206f, 0xf22c, 0x4af7, 0x6f, 0xba, 0x7b, 0xed, 0x5e, 0xb1, 0xc9, 0x2f)
 
 DECLARE_INTERFACE_ (IMILBitmapSource, IUnknown)
 
 DECLARE_INTERFACE_ (IMILBitmapScaler, IUnknown)
 
 DECLARE_INTERFACE_ (IMILUnknown1, IUnknown)
 
 DECLARE_INTERFACE_ (IMILUnknown2, IUnknown)
 
HRESULT create_instance (CLSID *clsid, const IID *iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT FormatConverter_CreateInstance (REFIID riid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT ImagingFactory_CreateInstance (REFIID riid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT BmpDecoder_CreateInstance (REFIID riid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT PngDecoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT PngEncoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT BmpEncoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT DibDecoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT GifDecoder_CreateInstance (REFIID riid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT GifEncoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT IcoDecoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT JpegDecoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT JpegEncoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT TiffDecoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT TiffEncoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT IcnsEncoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT TgaDecoder_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT BitmapImpl_Create (UINT uiWidth, UINT uiHeight, UINT stride, UINT datasize, void *view, UINT offset, REFWICPixelFormatGUID pixelFormat, WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap) DECLSPEC_HIDDEN
 
HRESULT BitmapScaler_Create (IWICBitmapScaler **scaler) DECLSPEC_HIDDEN
 
HRESULT FlipRotator_Create (IWICBitmapFlipRotator **fliprotator) DECLSPEC_HIDDEN
 
HRESULT PaletteImpl_Create (IWICPalette **palette) DECLSPEC_HIDDEN
 
HRESULT StreamImpl_Create (IWICStream **stream) DECLSPEC_HIDDEN
 
HRESULT ColorContext_Create (IWICColorContext **context) DECLSPEC_HIDDEN
 
HRESULT ColorTransform_Create (IWICColorTransform **transform) DECLSPEC_HIDDEN
 
HRESULT BitmapClipper_Create (IWICBitmapClipper **clipper) DECLSPEC_HIDDEN
 
HRESULT copy_pixels (UINT bpp, const BYTE *srcbuffer, UINT srcwidth, UINT srcheight, INT srcstride, const WICRect *rc, UINT dststride, UINT dstbuffersize, BYTE *dstbuffer) DECLSPEC_HIDDEN
 
HRESULT configure_write_source (IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, INT width, INT height, double xres, double yres) DECLSPEC_HIDDEN
 
HRESULT write_source (IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, UINT bpp, INT width, INT height) DECLSPEC_HIDDEN
 
void reverse_bgr8 (UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride) DECLSPEC_HIDDEN
 
HRESULT get_pixelformat_bpp (const GUID *pixelformat, UINT *bpp) DECLSPEC_HIDDEN
 
HRESULT CreatePropertyBag2 (const PROPBAG2 *options, UINT count, IPropertyBag2 **property) DECLSPEC_HIDDEN
 
HRESULT CreateComponentInfo (REFCLSID clsid, IWICComponentInfo **ppIInfo) DECLSPEC_HIDDEN
 
void ReleaseComponentInfos (void) DECLSPEC_HIDDEN
 
HRESULT CreateComponentEnumerator (DWORD componentTypes, DWORD options, IEnumUnknown **ppIEnumUnknown) DECLSPEC_HIDDEN
 
HRESULT get_decoder_info (REFCLSID clsid, IWICBitmapDecoderInfo **info) DECLSPEC_HIDDEN
 
HRESULT IcoDibDecoder_CreateInstance (BmpDecoder **ppDecoder) DECLSPEC_HIDDEN
 
void BmpDecoder_GetWICDecoder (BmpDecoder *This, IWICBitmapDecoder **ppDecoder) DECLSPEC_HIDDEN
 
void BmpDecoder_FindIconMask (BmpDecoder *This, ULONG *mask_offset, int *topdown) DECLSPEC_HIDDEN
 
HRESULT MetadataReader_Create (const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT UnknownMetadataReader_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT IfdMetadataReader_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT PngChrmReader_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT PngGamaReader_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT PngTextReader_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT LSDReader_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT IMDReader_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT GCEReader_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT APEReader_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT GifCommentReader_CreateInstance (REFIID iid, void **ppv) DECLSPEC_HIDDEN
 
HRESULT MetadataQueryReader_CreateInstance (IWICMetadataBlockReader *, const WCHAR *, IWICMetadataQueryReader **) DECLSPEC_HIDDEN
 
HRESULT stream_initialize_from_filehandle (IWICStream *iface, HANDLE hfile) DECLSPEC_HIDDEN
 
static WCHARheap_strdupW (const WCHAR *src)
 
static const chardebug_wic_rect (const WICRect *rect)
 

Macro Definition Documentation

◆ DEFINE_THISCALL_WRAPPER

#define DEFINE_THISCALL_WRAPPER (   func,
  args 
)    /* nothing */

Definition at line 98 of file wincodecs_private.h.

◆ INTERFACE [1/4]

#define INTERFACE   IMILBitmapSource

Definition at line 125 of file wincodecs_private.h.

◆ INTERFACE [2/4]

#define INTERFACE   IMILBitmapScaler

Definition at line 125 of file wincodecs_private.h.

◆ INTERFACE [3/4]

Definition at line 125 of file wincodecs_private.h.

◆ INTERFACE [4/4]

#define INTERFACE   IMILUnknown2

Definition at line 125 of file wincodecs_private.h.

◆ THISCALL

#define THISCALL (   func)    func

Definition at line 97 of file wincodecs_private.h.

Typedef Documentation

◆ BmpDecoder

Definition at line 197 of file wincodecs_private.h.

◆ class_constructor

typedef HRESULT(* class_constructor) (REFIID, void **)

Definition at line 141 of file wincodecs_private.h.

◆ MetadataHandlerVtbl

◆ MetadataItem

Function Documentation

◆ APEReader_CreateInstance()

HRESULT APEReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 434 of file gifformat.c.

435 {
437 }
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv)
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const MetadataHandlerVtbl APEReader_Vtbl
Definition: gifformat.c:428

Referenced by GifDecoder_Block_GetReaderByIndex().

◆ BitmapClipper_Create()

HRESULT BitmapClipper_Create ( IWICBitmapClipper **  clipper)

Definition at line 243 of file clipper.c.

244 {
246 
247  This = HeapAlloc(GetProcessHeap(), 0, sizeof(BitmapClipper));
248  if (!This) return E_OUTOFMEMORY;
249 
250  This->IWICBitmapClipper_iface.lpVtbl = &BitmapClipper_Vtbl;
251  This->ref = 1;
252  This->source = NULL;
254  This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BitmapClipper.lock");
255 
256  *clipper = &This->IWICBitmapClipper_iface;
257 
258  return S_OK;
259 }
#define DWORD_PTR
Definition: treelist.c:76
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const IWICBitmapClipperVtbl BitmapClipper_Vtbl
Definition: clipper.c:231
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define S_OK
Definition: intsafe.h:59

Referenced by ImagingFactory_CreateBitmapClipper().

◆ BitmapImpl_Create()

HRESULT BitmapImpl_Create ( UINT  uiWidth,
UINT  uiHeight,
UINT  stride,
UINT  datasize,
void view,
UINT  offset,
REFWICPixelFormatGUID  pixelFormat,
WICBitmapCreateCacheOption  option,
IWICBitmap **  ppIBitmap 
)

Definition at line 809 of file bitmap.c.

812 {
813  HRESULT hr;
814  BitmapImpl *This;
815  BYTE *data;
816  UINT bpp;
817 
818  hr = get_pixelformat_bpp(pixelFormat, &bpp);
819  if (FAILED(hr)) return hr;
820 
821  if (!stride) stride = (((bpp*uiWidth)+31)/32)*4;
822  if (!datasize) datasize = stride * uiHeight;
823 
824  if (datasize < stride * uiHeight) return WINCODEC_ERR_INSUFFICIENTBUFFER;
825  if (stride < ((bpp*uiWidth)+7)/8) return E_INVALIDARG;
826 
827  This = HeapAlloc(GetProcessHeap(), 0, sizeof(BitmapImpl));
828  if (!This) return E_OUTOFMEMORY;
829 
830  if (view) data = (BYTE *)view + offset;
832  {
834  return E_OUTOFMEMORY;
835  }
836 
837  This->IWICBitmap_iface.lpVtbl = &BitmapImpl_Vtbl;
838  This->IMILBitmapSource_iface.lpVtbl = &IMILBitmapImpl_Vtbl;
839  This->IMILUnknown1_iface.lpVtbl = &IMILUnknown1Impl_Vtbl;
840  This->IMILUnknown2_iface.lpVtbl = &IMILUnknown2Impl_Vtbl;
841  This->ref = 1;
842  This->palette = NULL;
843  This->palette_set = 0;
844  This->lock = 0;
845  This->data = data;
846  This->view = view;
847  This->offset = offset;
848  This->width = uiWidth;
849  This->height = uiHeight;
850  This->stride = stride;
851  This->bpp = bpp;
852  memcpy(&This->pixelformat, pixelFormat, sizeof(GUID));
853  This->dpix = This->dpiy = 0.0;
855  This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BitmapImpl.lock");
856 
857  *ppIBitmap = &This->IWICBitmap_iface;
858 
859  return S_OK;
860 }
static const IMILUnknown1Vtbl IMILUnknown1Impl_Vtbl
Definition: bitmap.c:745
static const IMILUnknown2Vtbl IMILUnknown2Impl_Vtbl
Definition: bitmap.c:799
static SIZE_T datasize
Definition: asm.c:30
#define DWORD_PTR
Definition: treelist.c:76
HRESULT hr
Definition: shlfolder.c:183
GLintptr offset
Definition: glext.h:5920
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
GLsizei stride
Definition: glext.h:5848
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static const IMILBitmapSourceVtbl IMILBitmapImpl_Vtbl
Definition: bitmap.c:656
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
#define S_OK
Definition: intsafe.h:59
static const IWICBitmapVtbl BitmapImpl_Vtbl
Definition: bitmap.c:467
unsigned int UINT
Definition: ndis.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static IOleDocumentView * view
Definition: activex.c:1749
DWORD bpp
Definition: surface.c:181
#define WINCODEC_ERR_INSUFFICIENTBUFFER
Definition: winerror.h:3303
HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp)
Definition: main.c:231
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by create_bitmap_from_source_rect(), ImagingFactory_CreateBitmap(), ImagingFactory_CreateBitmapFromHBITMAP(), ImagingFactory_CreateBitmapFromHICON(), ImagingFactory_CreateBitmapFromMemory(), and WICCreateBitmapFromSectionEx().

◆ BitmapScaler_Create()

HRESULT BitmapScaler_Create ( IWICBitmapScaler **  scaler)

Definition at line 551 of file scaler.c.

552 {
554 
555  This = HeapAlloc(GetProcessHeap(), 0, sizeof(BitmapScaler));
556  if (!This) return E_OUTOFMEMORY;
557 
558  This->IWICBitmapScaler_iface.lpVtbl = &BitmapScaler_Vtbl;
559  This->IMILBitmapScaler_iface.lpVtbl = &IMILBitmapScaler_Vtbl;
560  This->ref = 1;
561  This->source = NULL;
562  This->width = 0;
563  This->height = 0;
564  This->src_width = 0;
565  This->src_height = 0;
566  This->mode = 0;
567  This->bpp = 0;
569  This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BitmapScaler.lock");
570 
571  *scaler = &This->IWICBitmapScaler_iface;
572 
573  return S_OK;
574 }
#define DWORD_PTR
Definition: treelist.c:76
static const IWICBitmapScalerVtbl BitmapScaler_Vtbl
Definition: scaler.c:382
static const IMILBitmapScalerVtbl IMILBitmapScaler_Vtbl
Definition: scaler.c:538
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define S_OK
Definition: intsafe.h:59

Referenced by ImagingFactory_CreateBitmapScaler().

◆ BmpDecoder_CreateInstance()

HRESULT BmpDecoder_CreateInstance ( REFIID  riid,
void **  ppv 
)

Definition at line 1194 of file bmpdecode.c.

1195 {
1196  return BmpDecoder_Construct(FALSE, FALSE, iid, ppv);
1197 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT BmpDecoder_Construct(int packed, int icoframe, REFIID iid, void **ppv)
Definition: bmpdecode.c:1176

◆ BmpDecoder_FindIconMask()

void BmpDecoder_FindIconMask ( BmpDecoder This,
ULONG mask_offset,
int topdown 
)

Definition at line 1215 of file bmpdecode.c.

1216 {
1217  assert(This->stream != NULL);
1218 
1219  if (This->read_data_func == BmpFrameDecode_ReadUncompressed)
1220  {
1221  /* RGB or BITFIELDS data */
1222  ULONG width, height, bytesperrow, datasize;
1223  IWICBitmapFrameDecode_GetSize(&This->IWICBitmapFrameDecode_iface, &width, &height);
1224  bytesperrow = (((width * This->bitsperpixel)+31)/32)*4;
1225  datasize = bytesperrow * height;
1226  *mask_offset = This->image_offset + datasize;
1227  }
1228  else
1229  *mask_offset = 0;
1230 
1231  *topdown = This->stride > 0;
1232 }
GLint GLint GLsizei width
Definition: gl.h:1546
static SIZE_T datasize
Definition: asm.c:30
#define assert(x)
Definition: debug.h:53
static HRESULT BmpFrameDecode_ReadUncompressed(BmpDecoder *This)
Definition: bmpdecode.c:363
smooth NULL
Definition: ftsmooth.c:416
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
unsigned int ULONG
Definition: retypes.h:1

Referenced by ReadIcoDib().

◆ BmpDecoder_GetWICDecoder()

void BmpDecoder_GetWICDecoder ( BmpDecoder This,
IWICBitmapDecoder **  ppDecoder 
)

Definition at line 1209 of file bmpdecode.c.

1210 {
1211  *ppDecoder = &This->IWICBitmapDecoder_iface;
1212 }

Referenced by ReadIcoDib().

◆ 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:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
int ret
static const IWICBitmapEncoderVtbl BmpEncoder_Vtbl
Definition: bmpencode.c:626

◆ ColorContext_Create()

HRESULT ColorContext_Create ( IWICColorContext **  context)

Definition at line 258 of file colorcontext.c.

259 {
261 
262  if (!colorcontext) return E_INVALIDARG;
263 
264  This = HeapAlloc(GetProcessHeap(), 0, sizeof(ColorContext));
265  if (!This) return E_OUTOFMEMORY;
266 
267  This->IWICColorContext_iface.lpVtbl = &ColorContext_Vtbl;
268  This->ref = 1;
269  This->type = 0;
270  This->profile = NULL;
271  This->profile_len = 0;
272  This->exif_color_space = ~0u;
273 
274  *colorcontext = &This->IWICColorContext_iface;
275 
276  return S_OK;
277 }
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 * u
Definition: glfuncs.h:240
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const IWICColorContextVtbl ColorContext_Vtbl
Definition: colorcontext.c:246
#define S_OK
Definition: intsafe.h:59

Referenced by ImagingFactory_CreateColorContext().

◆ ColorTransform_Create()

HRESULT ColorTransform_Create ( IWICColorTransform **  transform)

Definition at line 174 of file colortransform.c.

175 {
177 
178  if (!colortransform) return E_INVALIDARG;
179 
180  This = HeapAlloc(GetProcessHeap(), 0, sizeof(ColorTransform));
181  if (!This) return E_OUTOFMEMORY;
182 
183  This->IWICColorTransform_iface.lpVtbl = &ColorTransform_Vtbl;
184  This->ref = 1;
185  This->dst = NULL;
186 
187  *colortransform = &This->IWICColorTransform_iface;
188 
189  return S_OK;
190 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static const IWICColorTransformVtbl ColorTransform_Vtbl
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define S_OK
Definition: intsafe.h:59

Referenced by ImagingFactory_CreateColorTransformer().

◆ configure_write_source()

HRESULT configure_write_source ( IWICBitmapFrameEncode iface,
IWICBitmapSource source,
const WICRect prc,
const WICPixelFormatGUID format,
INT  width,
INT  height,
double  xres,
double  yres 
)

Definition at line 123 of file main.c.

127 {
128  HRESULT hr = S_OK;
129 
130  if (width == 0 || height == 0)
132 
133  if (!format)
134  {
135  WICPixelFormatGUID src_format;
136 
137  hr = IWICBitmapSource_GetPixelFormat(source, &src_format);
138  if (FAILED(hr)) return hr;
139 
140  hr = IWICBitmapFrameEncode_SetPixelFormat(iface, &src_format);
141  if (FAILED(hr)) return hr;
142  }
143 
144  if (xres == 0.0 || yres == 0.0)
145  {
146  hr = IWICBitmapSource_GetResolution(source, &xres, &yres);
147  if (FAILED(hr)) return hr;
148  hr = IWICBitmapFrameEncode_SetResolution(iface, xres, yres);
149  if (FAILED(hr)) return hr;
150  }
151 
152  return hr;
153 }
GLint GLint GLsizei width
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
LONG HRESULT
Definition: typedefs.h:77
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3273
#define S_OK
Definition: intsafe.h:59

Referenced by BmpFrameEncode_WriteSource(), and GifFrameEncode_WriteSource().

◆ copy_pixels()

HRESULT copy_pixels ( UINT  bpp,
const BYTE srcbuffer,
UINT  srcwidth,
UINT  srcheight,
INT  srcstride,
const WICRect rc,
UINT  dststride,
UINT  dstbuffersize,
BYTE dstbuffer 
)

Definition at line 58 of file main.c.

61 {
62  UINT bytesperrow;
63  UINT row_offset; /* number of bits into the source rows where the data starts */
64  WICRect rect;
65 
66  if (!rc)
67  {
68  rect.X = 0;
69  rect.Y = 0;
70  rect.Width = srcwidth;
71  rect.Height = srcheight;
72  rc = &rect;
73  }
74  else
75  {
76  if (rc->X < 0 || rc->Y < 0 || rc->X+rc->Width > srcwidth || rc->Y+rc->Height > srcheight)
77  return E_INVALIDARG;
78  }
79 
80  bytesperrow = ((bpp * rc->Width)+7)/8;
81 
82  if (dststride < bytesperrow)
83  return E_INVALIDARG;
84 
85  if ((dststride * (rc->Height-1)) + bytesperrow > dstbuffersize)
86  return E_INVALIDARG;
87 
88  /* if the whole bitmap is copied and the buffer format matches then it's a matter of a single memcpy */
89  if (rc->X == 0 && rc->Y == 0 && rc->Width == srcwidth && rc->Height == srcheight &&
90  srcstride == dststride && srcstride == bytesperrow)
91  {
92  memcpy(dstbuffer, srcbuffer, srcstride * srcheight);
93  return S_OK;
94  }
95 
96  row_offset = rc->X * bpp;
97 
98  if (row_offset % 8 == 0)
99  {
100  /* everything lines up on a byte boundary */
101  INT row;
102  const BYTE *src;
103  BYTE *dst;
104 
105  src = srcbuffer + (row_offset / 8) + srcstride * rc->Y;
106  dst = dstbuffer;
107  for (row=0; row < rc->Height; row++)
108  {
109  memcpy(dst, src, bytesperrow);
110  src += srcstride;
111  dst += dststride;
112  }
113  return S_OK;
114  }
115  else
116  {
117  /* we have to do a weird bitwise copy. eww. */
118  FIXME("cannot reliably copy bitmap data if bpp < 8\n");
119  return E_FAIL;
120  }
121 }
#define E_FAIL
Definition: ddrawi.h:102
int32_t INT
Definition: typedefs.h:56
& rect
Definition: startmenu.cpp:1413
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
INT Height
Definition: wincodec.idl:239
#define for
Definition: utility.h:88
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
GLenum GLenum dst
Definition: glext.h:6340
unsigned int UINT
Definition: ndis.h:50
INT Width
Definition: wincodec.idl:238
DWORD bpp
Definition: surface.c:181
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

◆ create_instance()

HRESULT create_instance ( CLSID clsid,
const IID iid,
void **  ppv 
)

Definition at line 208 of file clsfactory.c.

209 {
210  int i;
211 
212  for (i=0; wic_classes[i].classid; i++)
213  if (IsEqualCLSID(wic_classes[i].classid, clsid))
214  return wic_classes[i].constructor(iid, ppv);
215 
216  return CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, iid, ppv);
217 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
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
smooth NULL
Definition: ftsmooth.c:416
static const classinfo wic_classes[]
Definition: clsfactory.c:45
REFCLSID clsid
Definition: msctf.c:82
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96

Referenced by BitmapDecoderInfo_CreateInstance(), BitmapEncoderInfo_CreateInstance(), FormatConverterInfo_CreateInstance(), and MetadataReaderInfo_CreateInstance().

◆ CreateComponentEnumerator()

HRESULT CreateComponentEnumerator ( DWORD  componentTypes,
DWORD  options,
IEnumUnknown **  ppIEnumUnknown 
)

Definition at line 2380 of file info.c.

2381 {
2384  const struct category *category;
2385  HKEY clsidkey, catidkey, instancekey;
2386  WCHAR guidstring[39];
2387  LONG res;
2388  int i;
2389  HRESULT hr=S_OK;
2390  CLSID clsid;
2391 
2392  if (options) FIXME("ignoring flags %x\n", options);
2393 
2395  if (res != ERROR_SUCCESS)
2396  return HRESULT_FROM_WIN32(res);
2397 
2398  This = HeapAlloc(GetProcessHeap(), 0, sizeof(ComponentEnum));
2399  if (!This)
2400  {
2401  RegCloseKey(clsidkey);
2402  return E_OUTOFMEMORY;
2403  }
2404 
2405  This->IEnumUnknown_iface.lpVtbl = &ComponentEnumVtbl;
2406  This->ref = 1;
2407  list_init(&This->objects);
2409  This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ComponentEnum.lock");
2410 
2411  for (category=categories; category->type && hr == S_OK; category++)
2412  {
2413  if ((category->type & componentTypes) == 0) continue;
2414  StringFromGUID2(category->catid, guidstring, 39);
2415  res = RegOpenKeyExW(clsidkey, guidstring, 0, KEY_READ, &catidkey);
2416  if (res == ERROR_SUCCESS)
2417  {
2418  res = RegOpenKeyExW(catidkey, instance_keyname, 0, KEY_READ, &instancekey);
2419  if (res == ERROR_SUCCESS)
2420  {
2421  i=0;
2422  for (;;i++)
2423  {
2424  DWORD guidstring_size = 39;
2425  res = RegEnumKeyExW(instancekey, i, guidstring, &guidstring_size, NULL, NULL, NULL, NULL);
2426  if (res != ERROR_SUCCESS) break;
2427 
2429  if (!item) { hr = E_OUTOFMEMORY; break; }
2430 
2431  hr = CLSIDFromString(guidstring, &clsid);
2432  if (SUCCEEDED(hr))
2433  {
2435  if (SUCCEEDED(hr))
2436  list_add_tail(&This->objects, &item->entry);
2437  }
2438 
2439  if (FAILED(hr))
2440  {
2441  HeapFree(GetProcessHeap(), 0, item);
2442  hr = S_OK;
2443  }
2444  }
2445  RegCloseKey(instancekey);
2446  }
2447  RegCloseKey(catidkey);
2448  }
2451  }
2452  RegCloseKey(clsidkey);
2453 
2454  if (SUCCEEDED(hr))
2455  {
2456  IEnumUnknown_Reset(&This->IEnumUnknown_iface);
2457  *ppIEnumUnknown = &This->IEnumUnknown_iface;
2458  }
2459  else
2460  {
2461  *ppIEnumUnknown = NULL;
2462  IEnumUnknown_Release(&This->IEnumUnknown_iface);
2463  }
2464 
2465  return hr;
2466 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
#define DWORD_PTR
Definition: treelist.c:76
HRESULT hr
Definition: shlfolder.c:183
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
#define KEY_READ
Definition: nt_native.h:1023
static const WCHAR clsid_keyname[]
Definition: info.c:2040
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
long LONG
Definition: pedump.c:60
#define FIXME(fmt,...)
Definition: debug.h:110
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR instance_keyname[]
Definition: info.c:2041
HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
Definition: info.c:2075
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
const GUID * catid
Definition: info.c:2045
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
unsigned long DWORD
Definition: ntddk_ex.h:95
REFCLSID clsid
Definition: msctf.c:82
WICComponentType type
Definition: info.c:2044
#define S_OK
Definition: intsafe.h:59
static ATOM item
Definition: dde.c:856
static const IEnumUnknownVtbl ComponentEnumVtbl
Definition: info.c:2196
GLuint res
Definition: glext.h:9613
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
#define HeapFree(x, y, z)
Definition: compat.h:402
GLsizei GLenum * categories
Definition: glext.h:11561
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by ComponentFactory_CreateMetadataReaderFromContainer(), find_decoder(), ImagingFactory_CreateComponentEnumerator(), ImagingFactory_CreateDecoder(), ImagingFactory_CreateEncoder(), and WICConvertBitmapSource().

◆ CreateComponentInfo()

HRESULT CreateComponentInfo ( REFCLSID  clsid,
IWICComponentInfo **  ppIInfo 
)

Definition at line 2075 of file info.c.

2076 {
2077  struct wine_rb_entry *cache_entry;
2079  HKEY clsidkey;
2080  HKEY classkey;
2081  HKEY catidkey;
2082  HKEY instancekey;
2083  WCHAR guidstring[39];
2084  LONG res;
2085  const struct category *category;
2086  BOOL found = FALSE;
2087  HRESULT hr;
2088 
2090 
2092  if(cache_entry)
2093  {
2095  IWICComponentInfo_AddRef(*ppIInfo = &info->IWICComponentInfo_iface);
2097  return S_OK;
2098  }
2099 
2101  if (res != ERROR_SUCCESS)
2102  {
2104  return HRESULT_FROM_WIN32(res);
2105  }
2106 
2108  {
2109  StringFromGUID2(category->catid, guidstring, 39);
2110  res = RegOpenKeyExW(clsidkey, guidstring, 0, KEY_READ, &catidkey);
2111  if (res == ERROR_SUCCESS)
2112  {
2113  res = RegOpenKeyExW(catidkey, instance_keyname, 0, KEY_READ, &instancekey);
2114  if (res == ERROR_SUCCESS)
2115  {
2116  StringFromGUID2(clsid, guidstring, 39);
2117  res = RegOpenKeyExW(instancekey, guidstring, 0, KEY_READ, &classkey);
2118  if (res == ERROR_SUCCESS)
2119  {
2120  RegCloseKey(classkey);
2121  found = TRUE;
2122  }
2123  RegCloseKey(instancekey);
2124  }
2125  RegCloseKey(catidkey);
2126  }
2127  if (found) break;
2128  }
2129 
2130  if (found)
2131  {
2132  res = RegOpenKeyExW(clsidkey, guidstring, 0, KEY_READ, &classkey);
2133  if (res == ERROR_SUCCESS)
2134  hr = category->constructor(classkey, clsid, &info);
2135  else
2137  }
2138  else
2139  {
2140  FIXME("%s is not supported\n", wine_dbgstr_guid(clsid));
2141  hr = E_FAIL;
2142  }
2143 
2144  RegCloseKey(clsidkey);
2145 
2146  if (SUCCEEDED(hr))
2147  {
2149  IWICComponentInfo_AddRef(*ppIInfo = &info->IWICComponentInfo_iface);
2150  }
2152  return hr;
2153 }
#define TRUE
Definition: types.h:120
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define KEY_READ
Definition: nt_native.h:1023
const char * wine_dbgstr_guid(const GUID *guid)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
Definition: svc_auth_des.c:77
#define E_FAIL
Definition: ddrawi.h:102
static const WCHAR clsid_keyname[]
Definition: info.c:2040
static struct wine_rb_tree component_info_cache
Definition: info.c:2064
struct _test_info info[]
Definition: SetCursorPos.c:19
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define FIXME(fmt,...)
Definition: debug.h:110
static const WCHAR instance_keyname[]
Definition: info.c:2041
HRESULT(* constructor)(HKEY, REFCLSID, ComponentInfo **)
Definition: info.c:2046
const GUID * catid
Definition: info.c:2045
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
static CRITICAL_SECTION component_info_cache_cs
Definition: info.c:2066
REFCLSID clsid
Definition: msctf.c:82
uint32_t entry
Definition: isohybrid.c:63
WICComponentType type
Definition: info.c:2044
#define S_OK
Definition: intsafe.h:59
Definition: rbtree.h:35
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
Definition: rbtree.h:215
static struct wine_rb_entry * wine_rb_get(const struct wine_rb_tree *tree, const void *key)
Definition: rbtree.h:203
GLuint res
Definition: glext.h:9613
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
GLsizei GLenum * categories
Definition: glext.h:11561
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by BmpEncoder_GetEncoderInfo(), create_bitmap_from_source_rect(), CreateComponentEnumerator(), get_decoder_info(), get_pixelformat_bpp(), GifEncoder_GetEncoderInfo(), ImagingFactory_CreateComponentInfo(), and MetadataHandler_GetMetadataHandlerInfo().

◆ CreatePropertyBag2()

HRESULT CreatePropertyBag2 ( const PROPBAG2 *  options,
UINT  count,
IPropertyBag2 **  property 
)

Definition at line 281 of file propertybag.c.

283 {
284  UINT i;
285  HRESULT res = S_OK;
286  PropertyBag *This;
287 
288  This = HeapAlloc(GetProcessHeap(), 0, sizeof(PropertyBag));
289  if (!This) return E_OUTOFMEMORY;
290 
291  This->IPropertyBag2_iface.lpVtbl = &PropertyBag_Vtbl;
292  This->ref = 1;
293  This->prop_count = count;
294 
295  if (count == 0)
296  {
297  This->properties = NULL;
298  This->values = NULL;
299  }
300  else
301  {
302  This->properties = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(PROPBAG2)*count);
304 
305  if (!This->properties || !This->values)
306  res = E_OUTOFMEMORY;
307  else
308  for (i=0; i < count; i++)
309  {
310  res = copy_propbag2(This->properties+i, options+i);
311  if (FAILED(res))
312  break;
313  This->properties[i].dwHint = i+1; /* 0 means unset, so we start with 1 */
314  }
315  }
316 
317  if (FAILED(res))
318  {
319  PropertyBag_Release(&This->IPropertyBag2_iface);
320  *ppPropertyBag2 = NULL;
321  }
322  else
323  *ppPropertyBag2 = &This->IPropertyBag2_iface;
324 
325  return res;
326 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
static HRESULT copy_propbag2(PROPBAG2 *dest, const PROPBAG2 *src)
Definition: propertybag.c:216
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
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
static ULONG WINAPI PropertyBag_Release(IPropertyBag2 *iface)
Definition: propertybag.c:83
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
GLuint res
Definition: glext.h:9613
static const IPropertyBag2Vtbl PropertyBag_Vtbl
Definition: propertybag.c:270

Referenced by BmpEncoder_CreateNewFrame(), ComponentFactory_CreateEncoderPropertyBag(), and GifEncoder_CreateNewFrame().

◆ debug_wic_rect()

static const char* debug_wic_rect ( const WICRect rect)
inlinestatic

◆ DECLARE_INTERFACE_() [1/4]

DECLARE_INTERFACE_ ( IMILBitmapSource  ,
IUnknown   
)

Definition at line 44 of file wincodecs_private.h.

45 {
46  /*** IUnknown methods ***/
50  /*** IWICBitmapSource methods ***/
53  STDMETHOD_(HRESULT,GetResolution)(THIS_ double *,double *) PURE;
54  STDMETHOD_(HRESULT,CopyPalette)(THIS_ IWICPalette *) PURE;
55  STDMETHOD_(HRESULT,CopyPixels)(THIS_ const WICRect *,UINT,UINT,BYTE *) PURE;
56  /*** IMILBitmapSource methods ***/
57  STDMETHOD_(HRESULT,unknown1)(THIS_ void **) PURE;
60  STDMETHOD_(HRESULT,SetPalette)(THIS_ IWICPalette *) PURE;
62  STDMETHOD_(HRESULT,AddDirtyRect)(THIS_ const WICRect *) PURE;
63 };
#define REFIID
Definition: guiddef.h:118
#define THIS_
Definition: basetyps.h:65
_In_ BOOLEAN Release
Definition: classpnp.h:929
int WINAPI GetPixelFormat(_In_ HDC)
#define THIS
Definition: basetyps.h:66
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
#define DWORD
Definition: nt_native.h:44
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
DWORD WINAPI GetSize(LPVOID)
LONG HRESULT
Definition: typedefs.h:77
unsigned char BYTE
Definition: mem.h:68
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
_In_ BOOLEAN SetResolution
Definition: exfuncs.h:870
#define PURE
Definition: basetyps.h:64
unsigned int UINT
Definition: ndis.h:50
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int ULONG
Definition: retypes.h:1
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DECLARE_INTERFACE_() [2/4]

DECLARE_INTERFACE_ ( IMILBitmapScaler  ,
IUnknown   
)

Definition at line 67 of file wincodecs_private.h.

68 {
69  /*** IUnknown methods ***/
73  /*** IWICBitmapSource methods ***/
76  STDMETHOD_(HRESULT,GetResolution)(THIS_ double *,double *) PURE;
77  STDMETHOD_(HRESULT,CopyPalette)(THIS_ IWICPalette *) PURE;
78  STDMETHOD_(HRESULT,CopyPixels)(THIS_ const WICRect *,UINT,UINT,BYTE *) PURE;
79  /*** IMILBitmapScaler methods ***/
80  STDMETHOD_(HRESULT,unknown1)(THIS_ void **) PURE;
82 };
#define REFIID
Definition: guiddef.h:118
#define THIS_
Definition: basetyps.h:65
_In_ BOOLEAN Release
Definition: classpnp.h:929
int WINAPI GetPixelFormat(_In_ HDC)
#define THIS
Definition: basetyps.h:66
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
DWORD WINAPI GetSize(LPVOID)
LONG HRESULT
Definition: typedefs.h:77
WICBitmapInterpolationMode
Definition: wincodec.idl:76
unsigned char BYTE
Definition: mem.h:68
BOOL Initialize(HINSTANCE hInstance)
Definition: msconfig.c:341
#define PURE
Definition: basetyps.h:64
unsigned int UINT
Definition: ndis.h:50
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int ULONG
Definition: retypes.h:1
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DECLARE_INTERFACE_() [3/4]

DECLARE_INTERFACE_ ( IMILUnknown1  ,
IUnknown   
)

Definition at line 103 of file wincodecs_private.h.

104 {
105  /*** IUnknown methods ***/
109  /*** thiscall method ***/
110  STDMETHOD_(void,unknown1)(THIS_ void*) PURE;
111  /*** stdcall ***/
112  STDMETHOD_(HRESULT,unknown2)(THIS_ void*, void*) PURE;
113  /*** thiscall method ***/
114  STDMETHOD_(HRESULT,unknown3)(THIS_ void*) PURE;
115  /*** stdcall ***/
116  STDMETHOD_(HRESULT,unknown4)(THIS_ void*) PURE;
117  STDMETHOD_(HRESULT,unknown5)(THIS_ void*) PURE;
118  STDMETHOD_(HRESULT,unknown6)(THIS_ DWORD64) PURE;
119  STDMETHOD_(HRESULT,unknown7)(THIS_ void*) PURE;
120  /*** thiscall method ***/
121  STDMETHOD_(HRESULT,unknown8)(THIS) PURE;
122 };
#define REFIID
Definition: guiddef.h:118
#define THIS_
Definition: basetyps.h:65
_In_ BOOLEAN Release
Definition: classpnp.h:929
#define THIS
Definition: basetyps.h:66
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
LONG HRESULT
Definition: typedefs.h:77
uint64_t DWORD64
Definition: typedefs.h:65
#define PURE
Definition: basetyps.h:64
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int ULONG
Definition: retypes.h:1
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DECLARE_INTERFACE_() [4/4]

DECLARE_INTERFACE_ ( IMILUnknown2  ,
IUnknown   
)

Definition at line 126 of file wincodecs_private.h.

127 {
128  /*** IUnknown methods ***/
132  /*** unknown methods ***/
133  STDMETHOD_(HRESULT,unknown1)(THIS_ void *,void **) PURE;
134  STDMETHOD_(HRESULT,unknown2)(THIS_ void *,void *) PURE;
135  STDMETHOD_(HRESULT,unknown3)(THIS_ void *) PURE;
136 };
#define REFIID
Definition: guiddef.h:118
#define THIS_
Definition: basetyps.h:65
_In_ BOOLEAN Release
Definition: classpnp.h:929
#define THIS
Definition: basetyps.h:66
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
LONG HRESULT
Definition: typedefs.h:77
#define PURE
Definition: basetyps.h:64
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int ULONG
Definition: retypes.h:1
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DEFINE_GUID() [1/10]

DEFINE_GUID ( CLSID_WineTgaDecoder  ,
0xb11fc79a  ,
0x67cc  ,
0x43e6  ,
0xa9  ,
0xce  ,
0xe3  ,
0xd5  ,
0x49  ,
0x45  ,
0xd3  ,
0x04   
)

◆ DEFINE_GUID() [2/10]

DEFINE_GUID ( CLSID_WICIcnsEncoder  ,
0x312fb6f1  ,
0xb767  ,
0x409d  ,
0x8a  ,
0x6d  ,
0x0f  ,
0xc1  ,
0x54  ,
0xd4  ,
0xf0  ,
0x5c   
)

◆ DEFINE_GUID() [3/10]

DEFINE_GUID ( GUID_WineContainerFormatTga  ,
0x0c44fda1  ,
0xa5c5  ,
0x4298  ,
0x96  ,
0x85  ,
0x47  ,
0x3f  ,
0xc1  ,
0x7c  ,
0xd3  ,
0x22   
)

◆ DEFINE_GUID() [4/10]

DEFINE_GUID ( GUID_VendorWine  ,
0xddf46da1  ,
0x7dc1  ,
0x404e  ,
0x98  ,
0xf2  ,
0xef  ,
0xa4  ,
0x8d  ,
0xfc  ,
0x95  ,
0x0a   
)

◆ DEFINE_GUID() [5/10]

DEFINE_GUID ( IID_IMILBitmap  ,
0xb1784d3f  ,
0x8115  ,
0x4763  ,
0x13  ,
0xaa  ,
0x32  ,
0xed  ,
0xdb  ,
0x68  ,
0x29  ,
0x4a   
)

◆ DEFINE_GUID() [6/10]

DEFINE_GUID ( IID_IMILBitmapSource  ,
0x7543696a  ,
0xbc8d  ,
0x46b0  ,
0x5f  ,
0x81  ,
0x8d  ,
0x95  ,
0x72  ,
0x89  ,
0x72  ,
0xbe   
)

◆ DEFINE_GUID() [7/10]

DEFINE_GUID ( IID_IMILBitmapLock  ,
0xa67b2b53  ,
0x8fa1  ,
0x4155  ,
0x8f  ,
0x64  ,
0x0c  ,
0x24  ,
0x7a  ,
0x8f  ,
0x84  ,
0xcd   
)

◆ DEFINE_GUID() [8/10]

DEFINE_GUID ( IID_IMILBitmapScaler  ,
0xa767b0f0  ,
0x1c8c  ,
0x4aef  ,
0x56  ,
0x8f  ,
0xad  ,
0xf9  ,
0x6d  ,
0xcf  ,
0xd5  ,
0xcb   
)

◆ DEFINE_GUID() [9/10]

DEFINE_GUID ( IID_IMILFormatConverter  ,
0x7e2a746f  ,
0x25c5  ,
0x4851  ,
0xb3  ,
0xaf  ,
0x44  ,
0x3b  ,
0x79  ,
0x63  ,
0x9e  ,
0xc0   
)

◆ DEFINE_GUID() [10/10]

DEFINE_GUID ( IID_IMILPalette  ,
0xca8e206f  ,
0xf22c  ,
0x4af7  ,
0x6f  ,
0xba  ,
0x7b  ,
0xed  ,
0x5e  ,
0xb1  ,
0xc9  ,
0x2f   
)

◆ DibDecoder_CreateInstance()

HRESULT DibDecoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 1199 of file bmpdecode.c.

1200 {
1201  return BmpDecoder_Construct(TRUE, FALSE, iid, ppv);
1202 }
#define TRUE
Definition: types.h:120
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT BmpDecoder_Construct(int packed, int icoframe, REFIID iid, void **ppv)
Definition: bmpdecode.c:1176

◆ FlipRotator_Create()

HRESULT FlipRotator_Create ( IWICBitmapFlipRotator **  fliprotator)

Definition at line 268 of file fliprotate.c.

269 {
270  FlipRotator *This;
271 
272  This = HeapAlloc(GetProcessHeap(), 0, sizeof(FlipRotator));
273  if (!This) return E_OUTOFMEMORY;
274 
275  This->IWICBitmapFlipRotator_iface.lpVtbl = &FlipRotator_Vtbl;
276  This->ref = 1;
277  This->source = NULL;
278  This->flip_x = 0;
279  This->flip_y = 0;
280  This->swap_xy = 0;
282  This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": FlipRotator.lock");
283 
284  *fliprotator = &This->IWICBitmapFlipRotator_iface;
285 
286  return S_OK;
287 }
#define DWORD_PTR
Definition: treelist.c:76
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
static const IWICBitmapFlipRotatorVtbl FlipRotator_Vtbl
Definition: fliprotate.c:256
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define S_OK
Definition: intsafe.h:59

Referenced by ImagingFactory_CreateBitmapFlipRotator().

◆ FormatConverter_CreateInstance()

HRESULT FormatConverter_CreateInstance ( REFIID  riid,
void **  ppv 
)

Definition at line 1762 of file converter.c.

1763 {
1765  HRESULT ret;
1766 
1767  TRACE("(%s,%p)\n", debugstr_guid(iid), ppv);
1768 
1769  *ppv = NULL;
1770 
1771  This = HeapAlloc(GetProcessHeap(), 0, sizeof(FormatConverter));
1772  if (!This) return E_OUTOFMEMORY;
1773 
1774  This->IWICFormatConverter_iface.lpVtbl = &FormatConverter_Vtbl;
1775  This->ref = 1;
1776  This->source = NULL;
1777  This->palette = NULL;
1779  This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": FormatConverter.lock");
1780 
1781  ret = IWICFormatConverter_QueryInterface(&This->IWICFormatConverter_iface, iid, ppv);
1782  IWICFormatConverter_Release(&This->IWICFormatConverter_iface);
1783 
1784  return ret;
1785 }
#define DWORD_PTR
Definition: treelist.c:76
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
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:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
int ret
static const IWICFormatConverterVtbl FormatConverter_Vtbl
Definition: converter.c:1749

Referenced by ImagingFactory_CreateFormatConverter().

◆ GCEReader_CreateInstance()

HRESULT GCEReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 327 of file gifformat.c.

328 {
330 }
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv)
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const MetadataHandlerVtbl GCEReader_Vtbl
Definition: gifformat.c:321

Referenced by GifFrameDecode_Block_GetReaderByIndex().

◆ get_decoder_info()

HRESULT get_decoder_info ( REFCLSID  clsid,
IWICBitmapDecoderInfo **  info 
)

Definition at line 2162 of file info.c.

2163 {
2164  IWICComponentInfo *compinfo;
2165  HRESULT hr;
2166 
2167  hr = CreateComponentInfo(clsid, &compinfo);
2168  if (FAILED(hr)) return hr;
2169 
2170  hr = IWICComponentInfo_QueryInterface(compinfo, &IID_IWICBitmapDecoderInfo,
2171  (void **)info);
2172 
2173  IWICComponentInfo_Release(compinfo);
2174 
2175  return hr;
2176 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
Definition: info.c:2075
LONG HRESULT
Definition: typedefs.h:77
REFCLSID clsid
Definition: msctf.c:82

◆ get_pixelformat_bpp()

HRESULT get_pixelformat_bpp ( const GUID pixelformat,
UINT bpp 
)

Definition at line 231 of file main.c.

232 {
233  HRESULT hr;
235  IWICPixelFormatInfo *formatinfo;
236 
238  if (SUCCEEDED(hr))
239  {
240  hr = IWICComponentInfo_QueryInterface(info, &IID_IWICPixelFormatInfo, (void**)&formatinfo);
241 
242  if (SUCCEEDED(hr))
243  {
244  hr = IWICPixelFormatInfo_GetBitsPerPixel(formatinfo, bpp);
245 
246  IWICPixelFormatInfo_Release(formatinfo);
247  }
248 
249  IWICComponentInfo_Release(info);
250  }
251 
252  return hr;
253 }
HRESULT hr
Definition: shlfolder.c:183
struct _test_info info[]
Definition: SetCursorPos.c:19
pixelformat
Definition: converter.c:40
HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
Definition: info.c:2075
LONG HRESULT
Definition: typedefs.h:77
DWORD bpp
Definition: surface.c:181
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by BitmapImpl_Create(), BitmapScaler_Initialize(), FormatConverter_CopyPalette(), FormatConverter_Initialize(), and WICCreateBitmapFromSectionEx().

◆ GifCommentReader_CreateInstance()

HRESULT GifCommentReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 528 of file gifformat.c.

529 {
531 }
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv)
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const MetadataHandlerVtbl GifCommentReader_Vtbl
Definition: gifformat.c:522

Referenced by GifDecoder_Block_GetReaderByIndex(), and GifFrameDecode_Block_GetReaderByIndex().

◆ GifDecoder_CreateInstance()

HRESULT GifDecoder_CreateInstance ( REFIID  riid,
void **  ppv 
)

Definition at line 1434 of file gifformat.c.

1435 {
1436  GifDecoder *This;
1437  HRESULT ret;
1438 
1439  TRACE("(%s,%p)\n", debugstr_guid(iid), ppv);
1440 
1441  *ppv = NULL;
1442 
1443  This = HeapAlloc(GetProcessHeap(), 0, sizeof(GifDecoder));
1444  if (!This) return E_OUTOFMEMORY;
1445 
1446  This->IWICBitmapDecoder_iface.lpVtbl = &GifDecoder_Vtbl;
1447  This->IWICMetadataBlockReader_iface.lpVtbl = &GifDecoder_BlockVtbl;
1448  This->stream = NULL;
1449  This->ref = 1;
1450  This->initialized = FALSE;
1451  This->gif = NULL;
1452  This->current_frame = 0;
1454  This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": GifDecoder.lock");
1455 
1456  ret = IWICBitmapDecoder_QueryInterface(&This->IWICBitmapDecoder_iface, iid, ppv);
1457  IWICBitmapDecoder_Release(&This->IWICBitmapDecoder_iface);
1458 
1459  return ret;
1460 }
#define DWORD_PTR
Definition: treelist.c:76
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
static const IWICBitmapDecoderVtbl GifDecoder_Vtbl
Definition: gifformat.c:1321
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
int ret
static const IWICMetadataBlockReaderVtbl GifDecoder_BlockVtbl
Definition: gifformat.c:1423

◆ GifEncoder_CreateInstance()

HRESULT GifEncoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 2375 of file gifformat.c.

2376 {
2377  GifEncoder *This;
2378  HRESULT ret;
2379 
2380  TRACE("%s,%p\n", debugstr_guid(iid), ppv);
2381 
2382  *ppv = NULL;
2383 
2384  This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
2385  if (!This) return E_OUTOFMEMORY;
2386 
2387  This->IWICBitmapEncoder_iface.lpVtbl = &GifEncoder_Vtbl;
2388  This->ref = 1;
2389  This->stream = NULL;
2391  This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": GifEncoder.lock");
2392  This->initialized = FALSE;
2393  This->info_written = FALSE;
2394  This->committed = FALSE;
2395  This->n_frames = 0;
2396  This->colors = 0;
2397 
2398  ret = IWICBitmapEncoder_QueryInterface(&This->IWICBitmapEncoder_iface, iid, ppv);
2399  IWICBitmapEncoder_Release(&This->IWICBitmapEncoder_iface);
2400 
2401  return ret;
2402 }
#define DWORD_PTR
Definition: treelist.c:76
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
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:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
int ret
static const IWICBitmapEncoderVtbl GifEncoder_Vtbl
Definition: gifformat.c:2358

◆ heap_strdupW()

static WCHAR* heap_strdupW ( const WCHAR src)
inlinestatic

Definition at line 237 of file wincodecs_private.h.

238 {
239  WCHAR *dst;
240  SIZE_T len;
241  if (!src) return NULL;
242  len = (strlenW(src) + 1) * sizeof(WCHAR);
243  if ((dst = HeapAlloc(GetProcessHeap(), 0, len))) memcpy(dst, src, len);
244  return dst;
245 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
ULONG_PTR SIZE_T
Definition: typedefs.h:78
GLenum GLenum dst
Definition: glext.h:6340

◆ IcnsEncoder_CreateInstance()

HRESULT IcnsEncoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 738 of file icnsformat.c.

739 {
740  ERR("Trying to save ICNS picture, but ICNS support is not compiled in.\n");
741  return E_FAIL;
742 }
#define E_FAIL
Definition: ddrawi.h:102
#define ERR(fmt,...)
Definition: debug.h:109

◆ IcoDecoder_CreateInstance()

HRESULT IcoDecoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 759 of file icoformat.c.

760 {
761  IcoDecoder *This;
762  HRESULT ret;
763 
764  TRACE("(%s,%p)\n", debugstr_guid(iid), ppv);
765 
766  *ppv = NULL;
767 
768  This = HeapAlloc(GetProcessHeap(), 0, sizeof(IcoDecoder));
769  if (!This) return E_OUTOFMEMORY;
770 
771  This->IWICBitmapDecoder_iface.lpVtbl = &IcoDecoder_Vtbl;
772  This->ref = 1;
773  This->stream = NULL;
774  This->initialized = FALSE;
776  This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IcoDecoder.lock");
777 
778  ret = IWICBitmapDecoder_QueryInterface(&This->IWICBitmapDecoder_iface, iid, ppv);
779  IWICBitmapDecoder_Release(&This->IWICBitmapDecoder_iface);
780 
781  return ret;
782 }
#define DWORD_PTR
Definition: treelist.c:76
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
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:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
int ret
static const IWICBitmapDecoderVtbl IcoDecoder_Vtbl
Definition: icoformat.c:742

◆ IcoDibDecoder_CreateInstance()

HRESULT IcoDibDecoder_CreateInstance ( BmpDecoder **  ppDecoder)

Definition at line 1204 of file bmpdecode.c.

1205 {
1206  return BmpDecoder_Create(TRUE, TRUE, ppDecoder);
1207 }
#define TRUE
Definition: types.h:120
static HRESULT BmpDecoder_Create(int packed, int icoframe, BmpDecoder **ppDecoder)
Definition: bmpdecode.c:1153

Referenced by ReadIcoDib().

◆ IfdMetadataReader_CreateInstance()

HRESULT IfdMetadataReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 1093 of file metadatahandler.c.

1094 {
1096 }
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv)
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const MetadataHandlerVtbl IfdMetadataReader_Vtbl

◆ ImagingFactory_CreateInstance()

HRESULT ImagingFactory_CreateInstance ( REFIID  riid,
void **  ppv 
)

Definition at line 1470 of file imgfactory.c.

1471 {
1473  HRESULT ret;
1474 
1475  TRACE("(%s,%p)\n", debugstr_guid(iid), ppv);
1476 
1477  *ppv = NULL;
1478 
1479  This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1480  if (!This) return E_OUTOFMEMORY;
1481 
1482  This->IWICImagingFactory2_iface.lpVtbl = &ImagingFactory_Vtbl;
1483  This->IWICComponentFactory_iface.lpVtbl = &ComponentFactory_Vtbl;
1484  This->ref = 1;
1485 
1486  ret = IWICImagingFactory2_QueryInterface(&This->IWICImagingFactory2_iface, iid, ppv);
1487  IWICImagingFactory2_Release(&This->IWICImagingFactory2_iface);
1488 
1489  return ret;
1490 }
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const IWICImagingFactory2Vtbl ImagingFactory_Vtbl
Definition: imgfactory.c:1034
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const IWICComponentFactoryVtbl ComponentFactory_Vtbl
Definition: imgfactory.c:1432
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:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
int ret

Referenced by PaletteImpl_InitializeFromBitmap(), and WICCreateImagingFactory_Proxy().

◆ IMDReader_CreateInstance()

HRESULT IMDReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 249 of file gifformat.c.

250 {
252 }
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv)
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const MetadataHandlerVtbl IMDReader_Vtbl
Definition: gifformat.c:243

Referenced by create_IMD_metadata_reader().

◆ JpegDecoder_CreateInstance()

HRESULT JpegDecoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 1550 of file jpegformat.c.

1551 {
1552  ERR("Trying to load JPEG picture, but JPEG support is not compiled in.\n");
1553  return E_FAIL;
1554 }
#define E_FAIL
Definition: ddrawi.h:102
#define ERR(fmt,...)
Definition: debug.h:109

◆ JpegEncoder_CreateInstance()

HRESULT JpegEncoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 1556 of file jpegformat.c.

1557 {
1558  ERR("Trying to save JPEG picture, but JPEG support is not compiled in.\n");
1559  return E_FAIL;
1560 }
#define E_FAIL
Definition: ddrawi.h:102
#define ERR(fmt,...)
Definition: debug.h:109

◆ LSDReader_CreateInstance()

HRESULT LSDReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 168 of file gifformat.c.

169 {
171 }
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv)
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const MetadataHandlerVtbl LSDReader_Vtbl
Definition: gifformat.c:162

Referenced by GifDecoder_Block_GetReaderByIndex().

◆ MetadataQueryReader_CreateInstance()

HRESULT MetadataQueryReader_CreateInstance ( IWICMetadataBlockReader ,
const WCHAR ,
IWICMetadataQueryReader **   
)

Definition at line 620 of file metadataquery.c.

621 {
622  QueryReader *obj;
623 
625  if (!obj)
626  return E_OUTOFMEMORY;
627 
628  obj->IWICMetadataQueryReader_iface.lpVtbl = &mqr_vtbl;
629  obj->ref = 1;
630 
631  IWICMetadataBlockReader_AddRef(mbr);
632  obj->block = mbr;
633 
634  obj->root = root ? heap_strdupW(root) : NULL;
635 
636  *out = &obj->IWICMetadataQueryReader_iface;
637 
638  return S_OK;
639 }
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static FILE * out
Definition: regtests2xml.c:44
static IWICMetadataQueryReaderVtbl mqr_vtbl
#define S_OK
Definition: intsafe.h:59
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by ComponentFactory_CreateQueryReaderFromBlockReader(), GifDecoder_GetMetadataQueryReader(), GifFrameDecode_GetMetadataQueryReader(), and mqr_GetMetadataByName().

◆ MetadataReader_Create()

HRESULT MetadataReader_Create ( const MetadataHandlerVtbl vtable,
REFIID  iid,
void **  ppv 
)

Definition at line 398 of file metadatahandler.c.

399 {
401  HRESULT hr;
402 
403  TRACE("%s\n", debugstr_guid(vtable->clsid));
404 
405  *ppv = NULL;
406 
407  This = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataHandler));
408  if (!This) return E_OUTOFMEMORY;
409 
410  This->IWICMetadataWriter_iface.lpVtbl = &MetadataHandler_Vtbl;
411  This->IWICPersistStream_iface.lpVtbl = &MetadataHandler_PersistStream_Vtbl;
412  This->ref = 1;
413  This->vtable = vtable;
414  This->items = NULL;
415  This->item_count = 0;
416 
418  This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": MetadataHandler.lock");
419 
420  hr = IWICMetadataWriter_QueryInterface(&This->IWICMetadataWriter_iface, iid, ppv);
421 
422  IWICMetadataWriter_Release(&This->IWICMetadataWriter_iface);
423 
424  return hr;
425 }
static const IWICMetadataWriterVtbl MetadataHandler_Vtbl
static void * vtable[]
Definition: typelib.c:1231
#define DWORD_PTR
Definition: treelist.c:76
HRESULT hr
Definition: shlfolder.c:183
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const IWICPersistStreamVtbl MetadataHandler_PersistStream_Vtbl
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
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:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77

Referenced by APEReader_CreateInstance(), GCEReader_CreateInstance(), GifCommentReader_CreateInstance(), IfdMetadataReader_CreateInstance(), IMDReader_CreateInstance(), LSDReader_CreateInstance(), PngChrmReader_CreateInstance(), PngGamaReader_CreateInstance(), PngTextReader_CreateInstance(), and UnknownMetadataReader_CreateInstance().

◆ PaletteImpl_Create()

HRESULT PaletteImpl_Create ( IWICPalette **  palette)

Definition at line 899 of file palette.c.

900 {
901  PaletteImpl *This;
902 
903  This = HeapAlloc(GetProcessHeap(), 0, sizeof(PaletteImpl));
904  if (!This) return E_OUTOFMEMORY;
905 
906  This->IWICPalette_iface.lpVtbl = &PaletteImpl_Vtbl;
907  This->ref = 1;
908  This->count = 0;
909  This->colors = NULL;
912  This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PaletteImpl.lock");
913 
914  *palette = &This->IWICPalette_iface;
915 
916  return S_OK;
917 }
static const IWICPaletteVtbl PaletteImpl_Vtbl
Definition: palette.c:883
#define DWORD_PTR
Definition: treelist.c:76
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static HPALETTE palette
Definition: clipboard.c:1345
#define S_OK
Definition: intsafe.h:59

Referenced by BitmapImpl_SetPalette(), copypixels_to_32bppBGRA(), create_bitmap_from_source_rect(), FormatConverter_Initialize(), ImagingFactory_CreateBitmapFromHBITMAP(), and ImagingFactory_CreatePalette().

◆ PngChrmReader_CreateInstance()

HRESULT PngChrmReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 295 of file pngformat.c.

296 {
298 }
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv)
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const MetadataHandlerVtbl ChrmReader_Vtbl
Definition: pngformat.c:289

◆ PngDecoder_CreateInstance()

HRESULT PngDecoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 2177 of file pngformat.c.

2178 {
2179  ERR("Trying to load PNG picture, but PNG support is not compiled in.\n");
2180  return E_FAIL;
2181 }
#define E_FAIL
Definition: ddrawi.h:102
#define ERR(fmt,...)
Definition: debug.h:109

Referenced by ReadIcoPng().

◆ PngEncoder_CreateInstance()

HRESULT PngEncoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 2183 of file pngformat.c.

2184 {
2185  ERR("Trying to save PNG picture, but PNG support is not compiled in.\n");
2186  return E_FAIL;
2187 }
#define E_FAIL
Definition: ddrawi.h:102
#define ERR(fmt,...)
Definition: debug.h:109

◆ PngGamaReader_CreateInstance()

HRESULT PngGamaReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 217 of file pngformat.c.

218 {
220 }
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv)
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const MetadataHandlerVtbl GamaReader_Vtbl
Definition: pngformat.c:211

◆ PngTextReader_CreateInstance()

HRESULT PngTextReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 155 of file pngformat.c.

156 {
158 }
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv)
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const MetadataHandlerVtbl TextReader_Vtbl
Definition: pngformat.c:149

◆ ReleaseComponentInfos()

void ReleaseComponentInfos ( void  )

Definition at line 2155 of file info.c.

2156 {
2157  ComponentInfo *info, *next_info;
2159  IWICComponentInfo_Release(&info->IWICComponentInfo_iface);
2160 }
#define WINE_RB_FOR_EACH_ENTRY_DESTRUCTOR(elem, elem2, tree, type, field)
Definition: rbtree.h:166
static struct wine_rb_tree component_info_cache
Definition: info.c:2064
struct _test_info info[]
Definition: SetCursorPos.c:19
uint32_t entry
Definition: isohybrid.c:63

Referenced by WIC_DllMain().

◆ reverse_bgr8()

void reverse_bgr8 ( UINT  bytesperpixel,
LPBYTE  bits,
UINT  width,
UINT  height,
INT  stride 
)

Definition at line 212 of file main.c.

213 {
214  UINT x, y;
215  BYTE *pixel, temp;
216 
217  for (y=0; y<height; y++)
218  {
219  pixel = bits + stride * y;
220 
221  for (x=0; x<width; x++)
222  {
223  temp = pixel[2];
224  pixel[2] = pixel[0];
225  pixel[0] = temp;
226  pixel += bytesperpixel;
227  }
228  }
229 }
GLint GLint GLsizei width
Definition: gl.h:1546
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
GLsizei stride
Definition: glext.h:5848
unsigned char BYTE
Definition: mem.h:68
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static calc_node_t temp
Definition: rpn_ieee.c:38
unsigned int UINT
Definition: ndis.h:50
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by BmpFrameDecode_ReadRGB8(), copypixels_to_24bppBGR(), copypixels_to_24bppRGB(), and copypixels_to_32bppRGBA().

◆ stream_initialize_from_filehandle()

HRESULT stream_initialize_from_filehandle ( IWICStream iface,
HANDLE  hfile 
)

Definition at line 1039 of file stream.c.

1040 {
1042  StreamOnFileHandle *pObject;
1043  IWICStream *stream = NULL;
1044  HANDLE map;
1045  void *mem;
1047  HRESULT hr;
1048  TRACE("(%p,%p)\n", iface, file);
1049 
1050  if (This->pStream) return WINCODEC_ERR_WRONGSTATE;
1051 
1052  hr = map_file(file, &map, &mem, &size);
1053  if (FAILED(hr)) return hr;
1054 
1056  if (FAILED(hr)) goto error;
1057 
1059  if (FAILED(hr)) goto error;
1060 
1061  pObject = HeapAlloc(GetProcessHeap(), 0, sizeof(StreamOnFileHandle));
1062  if (!pObject)
1063  {
1064  hr = E_OUTOFMEMORY;
1065  goto error;
1066  }
1067  pObject->IStream_iface.lpVtbl = &StreamOnFileHandle_Vtbl;
1068  pObject->ref = 1;
1069  pObject->map = map;
1070  pObject->mem = mem;
1071  pObject->stream = stream;
1072 
1073  if (InterlockedCompareExchangePointer((void**)&This->pStream, pObject, NULL))
1074  {
1075  /* Some other thread set the stream first. */
1076  IStream_Release(&pObject->IStream_iface);
1077  return WINCODEC_ERR_WRONGSTATE;
1078  }
1079  return S_OK;
1080 
1081 error:
1082  if (stream) IWICStream_Release(stream);
1084  CloseHandle(map);
1085  return hr;
1086 }
#define CloseHandle
Definition: compat.h:406
static IWICStreamImpl * impl_from_IWICStream(IWICStream *iface)
Definition: stream.c:752
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
smooth NULL
Definition: ftsmooth.c:416
static HRESULT map_file(HANDLE file, HANDLE *map, void **mem, LARGE_INTEGER *size)
Definition: stream.c:1018
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static HRESULT WINAPI IWICStreamImpl_InitializeFromMemory(IWICStream *iface, BYTE *pbBuffer, DWORD cbBufferSize)
Definition: stream.c:987
LONG HRESULT
Definition: typedefs.h:77
IWICStream * stream
Definition: stream.c:280
Definition: _map.h:44
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
static const IStreamVtbl StreamOnFileHandle_Vtbl
Definition: stream.c:419
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3273
#define S_OK
Definition: intsafe.h:59
Definition: mem.c:156
HRESULT StreamImpl_Create(IWICStream **stream)
Definition: stream.c:1150
#define UnmapViewOfFile
Definition: compat.h:411
IStream IStream_iface
Definition: stream.c:275
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 GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum map
Definition: glfuncs.h:262
Definition: fci.c:126

Referenced by ImagingFactory_CreateDecoderFromFileHandle().

◆ StreamImpl_Create()

HRESULT StreamImpl_Create ( IWICStream **  stream)

Definition at line 1150 of file stream.c.

1151 {
1152  IWICStreamImpl *pObject;
1153 
1154  if( !stream ) return E_INVALIDARG;
1155 
1156  pObject = HeapAlloc(GetProcessHeap(), 0, sizeof(IWICStreamImpl));
1157  if( !pObject ) {
1158  *stream = NULL;
1159  return E_OUTOFMEMORY;
1160  }
1161 
1162  pObject->IWICStream_iface.lpVtbl = &WICStream_Vtbl;
1163  pObject->ref = 1;
1164  pObject->pStream = NULL;
1165 
1166  *stream = &pObject->IWICStream_iface;
1167 
1168  return S_OK;
1169 }
IWICStream IWICStream_iface
Definition: stream.c:746
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
IStream * pStream
Definition: stream.c:749
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const IWICStreamVtbl WICStream_Vtbl
Definition: stream.c:1124
Definition: parse.h:22
#define S_OK
Definition: intsafe.h:59

Referenced by IcoDecoder_GetFrame(), ImagingFactory_CreateDecoderFromFileHandle(), ImagingFactory_CreateDecoderFromFilename(), ImagingFactory_CreateStream(), and stream_initialize_from_filehandle().

◆ TgaDecoder_CreateInstance()

HRESULT TgaDecoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 942 of file tgaformat.c.

943 {
944  TgaDecoder *This;
945  HRESULT ret;
946 
947  TRACE("(%s,%p)\n", debugstr_guid(iid), ppv);
948 
949  *ppv = NULL;
950 
951  This = HeapAlloc(GetProcessHeap(), 0, sizeof(TgaDecoder));
952  if (!This) return E_OUTOFMEMORY;
953 
954  This->IWICBitmapDecoder_iface.lpVtbl = &TgaDecoder_Vtbl;
955  This->IWICBitmapFrameDecode_iface.lpVtbl = &TgaDecoder_Frame_Vtbl;
956  This->ref = 1;
957  This->initialized = FALSE;
958  This->stream = NULL;
959  This->imagebits = NULL;
961  This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": TgaDecoder.lock");
962 
963  ret = IWICBitmapDecoder_QueryInterface(&This->IWICBitmapDecoder_iface, iid, ppv);
964  IWICBitmapDecoder_Release(&This->IWICBitmapDecoder_iface);
965 
966  return ret;
967 }
#define DWORD_PTR
Definition: treelist.c:76
static const IWICBitmapDecoderVtbl TgaDecoder_Vtbl
Definition: tgaformat.c:428
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
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:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
int ret
static const IWICBitmapFrameDecodeVtbl TgaDecoder_Frame_Vtbl
Definition: tgaformat.c:928

◆ TiffDecoder_CreateInstance()

HRESULT TiffDecoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 2360 of file tiffformat.c.

2361 {
2362  ERR("Trying to load TIFF picture, but Wine was compiled without TIFF support.\n");
2363  return E_FAIL;
2364 }
#define E_FAIL
Definition: ddrawi.h:102
#define ERR(fmt,...)
Definition: debug.h:109

◆ TiffEncoder_CreateInstance()

HRESULT TiffEncoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 2366 of file tiffformat.c.

2367 {
2368  ERR("Trying to save TIFF picture, but Wine was compiled without TIFF support.\n");
2369  return E_FAIL;
2370 }
#define E_FAIL
Definition: ddrawi.h:102
#define ERR(fmt,...)
Definition: debug.h:109

◆ UnknownMetadataReader_CreateInstance()

HRESULT UnknownMetadataReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 665 of file metadatahandler.c.

666 {
668 }
static const MetadataHandlerVtbl UnknownMetadataReader_Vtbl
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv)
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by ComponentFactory_CreateMetadataReaderFromContainer(), GifDecoder_Block_GetReaderByIndex(), and GifFrameDecode_Block_GetReaderByIndex().

◆ write_source()

HRESULT write_source ( IWICBitmapFrameEncode iface,
IWICBitmapSource source,
const WICRect prc,
const WICPixelFormatGUID format,
UINT  bpp,
INT  width,
INT  height 
)

Definition at line 155 of file main.c.

159 {
160  IWICBitmapSource *converted_source;
161  HRESULT hr=S_OK;
162  WICRect rc;
163  UINT stride;
164  BYTE* pixeldata;
165 
166  if (!prc)
167  {
168  UINT src_width, src_height;
169  hr = IWICBitmapSource_GetSize(source, &src_width, &src_height);
170  if (FAILED(hr)) return hr;
171  rc.X = 0;
172  rc.Y = 0;
173  rc.Width = src_width;
174  rc.Height = src_height;
175  prc = &rc;
176  }
177 
178  if (prc->Width != width || prc->Height <= 0)
179  return E_INVALIDARG;
180 
181  hr = WICConvertBitmapSource(format, source, &converted_source);
182  if (FAILED(hr))
183  {
184  ERR("Failed to convert source, target format %s, %#x\n", debugstr_guid(format), hr);
185  return E_NOTIMPL;
186  }
187 
188  stride = (bpp * width + 7)/8;
189 
190  pixeldata = HeapAlloc(GetProcessHeap(), 0, stride * prc->Height);
191  if (!pixeldata)
192  {
193  IWICBitmapSource_Release(converted_source);
194  return E_OUTOFMEMORY;
195  }
196 
197  hr = IWICBitmapSource_CopyPixels(converted_source, prc, stride,
198  stride*prc->Height, pixeldata);
199 
200  if (SUCCEEDED(hr))
201  {
202  hr = IWICBitmapFrameEncode_WritePixels(iface, prc->Height, stride,
203  stride*prc->Height, pixeldata);
204  }
205 
206  HeapFree(GetProcessHeap(), 0, pixeldata);
207  IWICBitmapSource_Release(converted_source);
208 
209  return hr;
210 }
GLint GLint GLsizei width
Definition: gl.h:1546
HRESULT hr
Definition: shlfolder.c:183
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
INT Height
Definition: wincodec.idl:239
#define debugstr_guid
Definition: kernel32.h:35
GLsizei stride
Definition: glext.h:5848
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
unsigned char BYTE
Definition: mem.h:68
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50
INT Width
Definition: wincodec.idl:238
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
Definition: info.c:2474
DWORD bpp
Definition: surface.c:181
_Out_ LPRECT prc
Definition: ntgdi.h:1658
#define HeapFree(x, y, z)
Definition: compat.h:402
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by BmpFrameEncode_WriteSource(), and GifFrameEncode_WriteSource().