ReactOS 0.4.16-dev-297-gc569aee
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   IMILBitmap
 
#define INTERFACE   IMILBitmapScaler
 
#define THISCALLMETHOD_(type, method)   type (__thiscall *method)
 
#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_ (IMILBitmap, IMILBitmapSource)
 
 DECLARE_INTERFACE_ (IMILBitmapScaler, IMILBitmapSource)
 
 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
 
void convert_rgba_to_bgra (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

◆ INTERFACE [1/5]

#define INTERFACE   IMILBitmapSource

Definition at line 126 of file wincodecs_private.h.

◆ INTERFACE [2/5]

#define INTERFACE   IMILBitmap

Definition at line 126 of file wincodecs_private.h.

◆ INTERFACE [3/5]

#define INTERFACE   IMILBitmapScaler

Definition at line 126 of file wincodecs_private.h.

◆ INTERFACE [4/5]

Definition at line 126 of file wincodecs_private.h.

◆ INTERFACE [5/5]

#define INTERFACE   IMILUnknown2

Definition at line 126 of file wincodecs_private.h.

◆ THISCALLMETHOD_

#define THISCALLMETHOD_ (   type,
  method 
)    type (__thiscall *method)

Definition at line 101 of file wincodecs_private.h.

Typedef Documentation

◆ BmpDecoder

Definition at line 199 of file wincodecs_private.h.

◆ class_constructor

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

Definition at line 142 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}
static const MetadataHandlerVtbl APEReader_Vtbl
Definition: gifformat.c:428
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv)

Referenced by GifDecoder_Block_GetReaderByIndex().

◆ BitmapClipper_Create()

HRESULT BitmapClipper_Create ( IWICBitmapClipper **  clipper)

Definition at line 243 of file clipper.c.

244{
246
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 E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define S_OK
Definition: intsafe.h:52
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define DWORD_PTR
Definition: treelist.c:76
static const IWICBitmapClipperVtbl BitmapClipper_Vtbl
Definition: clipper.c:231

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 793 of file bitmap.c.

796{
797 HRESULT hr;
799 BYTE *data;
800 UINT bpp;
801
802 hr = get_pixelformat_bpp(pixelFormat, &bpp);
803 if (FAILED(hr)) return hr;
804
805 if (!stride) stride = (((bpp*uiWidth)+31)/32)*4;
806 if (!datasize) datasize = stride * uiHeight;
807
808 if (datasize < stride * uiHeight) return WINCODEC_ERR_INSUFFICIENTBUFFER;
809 if (stride < ((bpp*uiWidth)+7)/8) return E_INVALIDARG;
810
811 This = HeapAlloc(GetProcessHeap(), 0, sizeof(BitmapImpl));
812 if (!This) return E_OUTOFMEMORY;
813
814 if (view) data = (BYTE *)view + offset;
816 {
818 return E_OUTOFMEMORY;
819 }
820
821 This->IWICBitmap_iface.lpVtbl = &BitmapImpl_Vtbl;
822 This->IMILBitmap_iface.lpVtbl = &IMILBitmapImpl_Vtbl;
823 This->IMILUnknown1_iface.lpVtbl = &IMILUnknown1Impl_Vtbl;
824 This->IMILUnknown2_iface.lpVtbl = &IMILUnknown2Impl_Vtbl;
825 This->ref = 1;
826 This->palette = NULL;
827 This->palette_set = 0;
828 This->lock = 0;
829 This->data = data;
830 This->view = view;
831 This->offset = offset;
832 This->width = uiWidth;
833 This->height = uiHeight;
834 This->stride = stride;
835 This->bpp = bpp;
836 memcpy(&This->pixelformat, pixelFormat, sizeof(GUID));
837 This->dpix = This->dpiy = 0.0;
839 This->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BitmapImpl.lock");
840
841 *ppIBitmap = &This->IWICBitmap_iface;
842
843 return S_OK;
844}
static SIZE_T datasize
Definition: asm.c:30
#define E_INVALIDARG
Definition: ddrawi.h:101
DWORD bpp
Definition: surface.c:185
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static const IMILBitmapVtbl IMILBitmapImpl_Vtbl
Definition: bitmap.c:639
static const IMILUnknown2Vtbl IMILUnknown2Impl_Vtbl
Definition: bitmap.c:783
static const IMILUnknown1Vtbl IMILUnknown1Impl_Vtbl
Definition: bitmap.c:729
static const IWICBitmapVtbl BitmapImpl_Vtbl
Definition: bitmap.c:471
HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp)
Definition: main.c:252
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizei stride
Definition: glext.h:5848
GLintptr offset
Definition: glext.h:5920
#define FAILED(hr)
Definition: intsafe.h:51
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int UINT
Definition: ndis.h:50
HRESULT hr
Definition: shlfolder.c:183
#define WINCODEC_ERR_INSUFFICIENTBUFFER
Definition: winerror.h:3311
unsigned char BYTE
Definition: xxhash.c:193

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 515 of file scaler.c.

516{
518
519 This = HeapAlloc(GetProcessHeap(), 0, sizeof(BitmapScaler));
520 if (!This) return E_OUTOFMEMORY;
521
522 This->IWICBitmapScaler_iface.lpVtbl = &BitmapScaler_Vtbl;
523 This->IMILBitmapScaler_iface.lpVtbl = &IMILBitmapScaler_Vtbl;
524 This->ref = 1;
525 This->source = NULL;
526 This->width = 0;
527 This->height = 0;
528 This->src_width = 0;
529 This->src_height = 0;
530 This->mode = 0;
531 This->bpp = 0;
533 This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BitmapScaler.lock");
534
535 *scaler = &This->IWICBitmapScaler_iface;
536
537 return S_OK;
538}
static const IWICBitmapScalerVtbl BitmapScaler_Vtbl
Definition: scaler.c:383
static const IMILBitmapScalerVtbl IMILBitmapScaler_Vtbl
Definition: scaler.c:502

Referenced by ImagingFactory_CreateBitmapScaler().

◆ BmpDecoder_CreateInstance()

HRESULT BmpDecoder_CreateInstance ( REFIID  riid,
void **  ppv 
)

Definition at line 1195 of file bmpdecode.c.

1196{
1197 return BmpDecoder_Construct(FALSE, FALSE, iid, ppv);
1198}
static HRESULT BmpDecoder_Construct(int packed, int icoframe, REFIID iid, void **ppv)
Definition: bmpdecode.c:1177
#define FALSE
Definition: types.h:117

◆ BmpDecoder_FindIconMask()

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

Definition at line 1216 of file bmpdecode.c.

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

Referenced by ReadIcoDib().

◆ BmpDecoder_GetWICDecoder()

void BmpDecoder_GetWICDecoder ( BmpDecoder This,
IWICBitmapDecoder **  ppDecoder 
)

Definition at line 1210 of file bmpdecode.c.

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

Referenced by ReadIcoDib().

◆ BmpEncoder_CreateInstance()

HRESULT BmpEncoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 642 of file bmpencode.c.

643{
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}
static const IWICBitmapEncoderVtbl BmpEncoder_Vtbl
Definition: bmpencode.c:626
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
int ret

◆ 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}
static const IWICColorContextVtbl ColorContext_Vtbl
Definition: colorcontext.c:246
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

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
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}
static const IWICColorTransformVtbl ColorTransform_Vtbl

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}
Definition: format.c:58
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3281

Referenced by BmpFrameEncode_WriteSource(), and GifFrameEncode_WriteSource().

◆ convert_rgba_to_bgra()

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

Definition at line 231 of file main.c.

232{
233 UINT x, y;
234 BYTE *pixel, temp;
235
236 for (y=0; y<height; y++)
237 {
238 pixel = bits + stride * y;
239
240 for (x=0; x<width; x++)
241 {
242 temp = pixel[3];
243 pixel[3] = pixel[0];
244 pixel[0] = pixel[1];
245 pixel[1] = pixel[2];
246 pixel[2] = temp;
247 pixel += bytesperpixel;
248 }
249 }
250}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
static calc_node_t temp
Definition: rpn_ieee.c:38

Referenced by copypixels_to_32bppBGRA().

◆ 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 */
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 FIXME(fmt,...)
Definition: precomp.h:53
#define E_FAIL
Definition: ddrawi.h:102
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
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
#define for
Definition: utility.h:88
& rect
Definition: startmenu.cpp:1413
INT Height
Definition: wincodec.idl:301
INT Width
Definition: wincodec.idl:300
int32_t INT
Definition: typedefs.h:58

◆ 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}
static const classinfo wic_classes[]
Definition: clsfactory.c:45
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
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
REFCLSID clsid
Definition: msctf.c:82
#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
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 {
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}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
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:2504
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
static const WCHAR instance_keyname[]
Definition: info.c:2041
HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
Definition: info.c:2075
static const WCHAR clsid_keyname[]
Definition: info.c:2040
static const IEnumUnknownVtbl ComponentEnumVtbl
Definition: info.c:2196
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizei GLenum * categories
Definition: glext.h:11561
GLuint res
Definition: glext.h:9613
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static ATOM item
Definition: dde.c:856
#define KEY_READ
Definition: nt_native.h:1023
long LONG
Definition: pedump.c:60
WICComponentType type
Definition: info.c:2044
const GUID * catid
Definition: info.c:2045
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
__wchar_t WCHAR
Definition: xmlstorage.h:180

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
static struct wine_rb_tree component_info_cache
Definition: info.c:2064
static CRITICAL_SECTION component_info_cache_cs
Definition: info.c:2066
unsigned int BOOL
Definition: ntddk_ex.h:94
uint32_t entry
Definition: isohybrid.c:63
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
static struct wine_rb_entry * wine_rb_get(const struct wine_rb_tree *tree, const void *key)
Definition: rbtree.h:203
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
Definition: rbtree.h:215
Definition: svc_auth_des.c:77
HRESULT(* constructor)(HKEY, REFCLSID, ComponentInfo **)
Definition: info.c:2046
Definition: rbtree.h:36
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

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;
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)
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}
static ULONG WINAPI PropertyBag_Release(IPropertyBag2 *iface)
Definition: propertybag.c:83
static const IPropertyBag2Vtbl PropertyBag_Vtbl
Definition: propertybag.c:270
static HRESULT copy_propbag2(PROPBAG2 *dest, const PROPBAG2 *src)
Definition: propertybag.c:216
GLuint GLuint GLsizei count
Definition: gl.h:1545

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

◆ debug_wic_rect()

◆ DECLARE_INTERFACE_() [1/5]

DECLARE_INTERFACE_ ( IMILBitmap  ,
IMILBitmapSource   
)

Definition at line 60 of file wincodecs_private.h.

61{
62 /*** IUnknown methods ***/
66 /*** IWICBitmapSource methods ***/
69 STDMETHOD_(HRESULT,GetResolution)(THIS_ double *,double *) PURE;
70 STDMETHOD_(HRESULT,CopyPalette)(THIS_ IWICPalette *) PURE;
71 STDMETHOD_(HRESULT,CopyPixels)(THIS_ const WICRect *,UINT,UINT,BYTE *) PURE;
72 /*** IMILBitmap methods ***/
73 STDMETHOD_(HRESULT,unknown1)(THIS_ void **) PURE;
78 STDMETHOD_(HRESULT,AddDirtyRect)(THIS_ const WICRect *) PURE;
79};
#define PURE
Definition: basetyps.h:64
#define THIS_
Definition: basetyps.h:65
#define THIS
Definition: basetyps.h:66
#define STDMETHOD_(t, m)
Definition: basetyps.h:63
_In_ BOOLEAN Release
Definition: cdrom.h:920
DWORD WINAPI GetSize(LPVOID)
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
#define DWORD
Definition: nt_native.h:44
@ Unlock
Definition: ntsecapi.h:294
#define REFIID
Definition: guiddef.h:118
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
int WINAPI GetPixelFormat(_In_ HDC)
_In_ BOOLEAN SetResolution
Definition: exfuncs.h:1078

◆ DECLARE_INTERFACE_() [2/5]

DECLARE_INTERFACE_ ( IMILBitmapScaler  ,
IMILBitmapSource   
)

Definition at line 83 of file wincodecs_private.h.

84{
85 /*** IUnknown methods ***/
89 /*** IWICBitmapSource methods ***/
92 STDMETHOD_(HRESULT,GetResolution)(THIS_ double *,double *) PURE;
93 STDMETHOD_(HRESULT,CopyPalette)(THIS_ IWICPalette *) PURE;
94 STDMETHOD_(HRESULT,CopyPixels)(THIS_ const WICRect *,UINT,UINT,BYTE *) PURE;
95 /*** IMILBitmapScaler methods ***/
96 STDMETHOD_(HRESULT,unknown1)(THIS_ void **) PURE;
98};
WICBitmapInterpolationMode
Definition: wincodec.idl:76
static void Initialize()
Definition: xlate.c:212

◆ DECLARE_INTERFACE_() [3/5]

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

◆ DECLARE_INTERFACE_() [4/5]

DECLARE_INTERFACE_ ( IMILUnknown1  ,
IUnknown   
)

Definition at line 104 of file wincodecs_private.h.

105{
106 /*** IUnknown methods ***/
110 /*** thiscall method ***/
111 STDMETHOD_(void,unknown1)(THIS_ void*) PURE;
112 /*** stdcall ***/
113 STDMETHOD_(HRESULT,unknown2)(THIS_ void*, void*) PURE;
114 /*** thiscall method ***/
115 STDMETHOD_(HRESULT,unknown3)(THIS_ void*) PURE;
116 /*** stdcall ***/
117 STDMETHOD_(HRESULT,unknown4)(THIS_ void*) PURE;
118 STDMETHOD_(HRESULT,unknown5)(THIS_ void*) PURE;
120 STDMETHOD_(HRESULT,unknown7)(THIS_ void*) PURE;
121 /*** thiscall method ***/
122 STDMETHOD_(HRESULT,unknown8)(THIS) PURE;
123};
uint64_t DWORD64
Definition: typedefs.h:67

◆ DECLARE_INTERFACE_() [5/5]

DECLARE_INTERFACE_ ( IMILUnknown2  ,
IUnknown   
)

Definition at line 127 of file wincodecs_private.h.

128{
129 /*** IUnknown methods ***/
133 /*** unknown methods ***/
134 STDMETHOD_(HRESULT,unknown1)(THIS_ void *,void **) PURE;
135 STDMETHOD_(HRESULT,unknown2)(THIS_ void *,void *) PURE;
136 STDMETHOD_(HRESULT,unknown3)(THIS_ void *) PURE;
137};

◆ DEFINE_GUID() [1/10]

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

◆ DEFINE_GUID() [2/10]

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

◆ DEFINE_GUID() [3/10]

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

◆ DEFINE_GUID() [4/10]

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

◆ 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_IMILBitmapLock  ,
0xa67b2b53  ,
0x8fa1  ,
0x4155  ,
0x8f  ,
0x64  ,
0x0c  ,
0x24  ,
0x7a  ,
0x8f  ,
0x84  ,
0xcd   
)

◆ DEFINE_GUID() [7/10]

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

◆ DEFINE_GUID() [8/10]

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

◆ 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 1200 of file bmpdecode.c.

1201{
1202 return BmpDecoder_Construct(TRUE, FALSE, iid, ppv);
1203}

◆ FlipRotator_Create()

HRESULT FlipRotator_Create ( IWICBitmapFlipRotator **  fliprotator)

Definition at line 268 of file fliprotate.c.

269{
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}
static const IWICBitmapFlipRotatorVtbl FlipRotator_Vtbl
Definition: fliprotate.c:256

Referenced by ImagingFactory_CreateBitmapFlipRotator().

◆ FormatConverter_CreateInstance()

HRESULT FormatConverter_CreateInstance ( REFIID  riid,
void **  ppv 
)

Definition at line 1835 of file converter.c.

1836{
1838 HRESULT ret;
1839
1840 TRACE("(%s,%p)\n", debugstr_guid(iid), ppv);
1841
1842 *ppv = NULL;
1843
1845 if (!This) return E_OUTOFMEMORY;
1846
1847 This->IWICFormatConverter_iface.lpVtbl = &FormatConverter_Vtbl;
1848 This->ref = 1;
1849 This->source = NULL;
1850 This->palette = NULL;
1852 This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": FormatConverter.lock");
1853
1854 ret = IWICFormatConverter_QueryInterface(&This->IWICFormatConverter_iface, iid, ppv);
1855 IWICFormatConverter_Release(&This->IWICFormatConverter_iface);
1856
1857 return ret;
1858}
static const IWICFormatConverterVtbl FormatConverter_Vtbl
Definition: converter.c:1822

Referenced by ImagingFactory_CreateFormatConverter().

◆ GCEReader_CreateInstance()

HRESULT GCEReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 327 of file gifformat.c.

328{
330}
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}

◆ get_pixelformat_bpp()

HRESULT get_pixelformat_bpp ( const GUID pixelformat,
UINT bpp 
)

Definition at line 252 of file main.c.

253{
254 HRESULT hr;
256 IWICPixelFormatInfo *formatinfo;
257
259 if (SUCCEEDED(hr))
260 {
261 hr = IWICComponentInfo_QueryInterface(info, &IID_IWICPixelFormatInfo, (void**)&formatinfo);
262
263 if (SUCCEEDED(hr))
264 {
265 hr = IWICPixelFormatInfo_GetBitsPerPixel(formatinfo, bpp);
266
267 IWICPixelFormatInfo_Release(formatinfo);
268 }
269
270 IWICComponentInfo_Release(info);
271 }
272
273 return hr;
274}
pixelformat
Definition: converter.c:40

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}
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{
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}
static const IWICMetadataBlockReaderVtbl GifDecoder_BlockVtbl
Definition: gifformat.c:1423
static const IWICBitmapDecoderVtbl GifDecoder_Vtbl
Definition: gifformat.c:1321

◆ GifEncoder_CreateInstance()

HRESULT GifEncoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 2375 of file gifformat.c.

2376{
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}
static const IWICBitmapEncoderVtbl GifEncoder_Vtbl
Definition: gifformat.c:2358

◆ heap_strdupW()

static WCHAR * heap_strdupW ( const WCHAR src)
inlinestatic

Definition at line 239 of file wincodecs_private.h.

240{
241 WCHAR *dst;
242 SIZE_T len;
243 if (!src) return NULL;
244 len = (strlenW(src) + 1) * sizeof(WCHAR);
245 if ((dst = HeapAlloc(GetProcessHeap(), 0, len))) memcpy(dst, src, len);
246 return dst;
247}
GLenum GLsizei len
Definition: glext.h:6722
#define strlenW(s)
Definition: unicode.h:34
ULONG_PTR SIZE_T
Definition: typedefs.h:80

◆ IcnsEncoder_CreateInstance()

HRESULT IcnsEncoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 737 of file icnsformat.c.

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

◆ IcoDecoder_CreateInstance()

HRESULT IcoDecoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 759 of file icoformat.c.

760{
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}
static const IWICBitmapDecoderVtbl IcoDecoder_Vtbl
Definition: icoformat.c:742

◆ IcoDibDecoder_CreateInstance()

HRESULT IcoDibDecoder_CreateInstance ( BmpDecoder **  ppDecoder)

Definition at line 1205 of file bmpdecode.c.

1206{
1207 return BmpDecoder_Create(TRUE, TRUE, ppDecoder);
1208}
static HRESULT BmpDecoder_Create(int packed, int icoframe, BmpDecoder **ppDecoder)
Definition: bmpdecode.c:1154

Referenced by ReadIcoDib().

◆ IfdMetadataReader_CreateInstance()

HRESULT IfdMetadataReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 1093 of file metadatahandler.c.

1094{
1096}
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}
static const IWICImagingFactory2Vtbl ImagingFactory_Vtbl
Definition: imgfactory.c:1034
static const IWICComponentFactoryVtbl ComponentFactory_Vtbl
Definition: imgfactory.c:1432

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

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

◆ LSDReader_CreateInstance()

HRESULT LSDReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 168 of file gifformat.c.

169{
171}
static const MetadataHandlerVtbl LSDReader_Vtbl
Definition: gifformat.c:162

Referenced by GifDecoder_Block_GetReaderByIndex().

◆ MetadataQueryReader_CreateInstance()

HRESULT MetadataQueryReader_CreateInstance ( IWICMetadataBlockReader mbr,
const WCHAR root,
IWICMetadataQueryReader **  out 
)

Definition at line 619 of file metadataquery.c.

620{
622
624 if (!obj)
625 return E_OUTOFMEMORY;
626
627 obj->IWICMetadataQueryReader_iface.lpVtbl = &mqr_vtbl;
628 obj->ref = 1;
629
630 IWICMetadataBlockReader_AddRef(mbr);
631 obj->block = mbr;
632
633 obj->root = root ? heap_strdupW(root) : NULL;
634
635 *out = &obj->IWICMetadataQueryReader_iface;
636
637 return S_OK;
638}
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: edit.c:4312
static IWICMetadataQueryReaderVtbl mqr_vtbl
static FILE * out
Definition: regtests2xml.c:44

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
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 IWICPersistStreamVtbl MetadataHandler_PersistStream_Vtbl
static const IWICMetadataWriterVtbl MetadataHandler_Vtbl
static void * vtable[]
Definition: typelib.c:1231

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{
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
static HPALETTE palette
Definition: clipboard.c:1345
@ WICBitmapPaletteTypeCustom
Definition: wincodec.idl:91

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}
static const MetadataHandlerVtbl ChrmReader_Vtbl
Definition: pngformat.c:289

◆ PngDecoder_CreateInstance()

HRESULT PngDecoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 2188 of file pngformat.c.

2189{
2190 ERR("Trying to load PNG picture, but PNG support is not compiled in.\n");
2191 return E_FAIL;
2192}

Referenced by ReadIcoPng().

◆ PngEncoder_CreateInstance()

HRESULT PngEncoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 2194 of file pngformat.c.

2195{
2196 ERR("Trying to save PNG picture, but PNG support is not compiled in.\n");
2197 return E_FAIL;
2198}

◆ PngGamaReader_CreateInstance()

HRESULT PngGamaReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 217 of file pngformat.c.

218{
220}
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}
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

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}

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{
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
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);
1078 }
1079 return S_OK;
1080
1081error:
1082 if (stream) IWICStream_Release(stream);
1085 return hr;
1086}
Definition: _map.h:48
#define CloseHandle
Definition: compat.h:739
#define UnmapViewOfFile
Definition: compat.h:746
static HRESULT map_file(HANDLE file, HANDLE *map, void **mem, LARGE_INTEGER *size)
Definition: stream.c:1018
static const IStreamVtbl StreamOnFileHandle_Vtbl
Definition: stream.c:419
HRESULT StreamImpl_Create(IWICStream **stream)
Definition: stream.c:1150
static IWICStreamImpl * impl_from_IWICStream(IWICStream *iface)
Definition: stream.c:752
static HRESULT WINAPI IWICStreamImpl_InitializeFromMemory(IWICStream *iface, BYTE *pbBuffer, DWORD cbBufferSize)
Definition: stream.c:987
FxObject * pObject
GLsizeiptr size
Definition: glext.h:5919
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
#define error(str)
Definition: mkdosfs.c:1605
Definition: fci.c:127
Definition: mem.c:349
Definition: parse.h:23

Referenced by ImagingFactory_CreateDecoderFromFileHandle().

◆ StreamImpl_Create()

HRESULT StreamImpl_Create ( IWICStream **  stream)

Definition at line 1150 of file stream.c.

1151{
1153
1154 if( !stream ) return E_INVALIDARG;
1155
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}
static const IWICStreamVtbl WICStream_Vtbl
Definition: stream.c:1124

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{
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}
static const IWICBitmapFrameDecodeVtbl TgaDecoder_Frame_Vtbl
Definition: tgaformat.c:928
static const IWICBitmapDecoderVtbl TgaDecoder_Vtbl
Definition: tgaformat.c:428

◆ TiffDecoder_CreateInstance()

HRESULT TiffDecoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 2373 of file tiffformat.c.

2374{
2375 ERR("Trying to load TIFF picture, but Wine was compiled without TIFF support.\n");
2376 return E_FAIL;
2377}

◆ TiffEncoder_CreateInstance()

HRESULT TiffEncoder_CreateInstance ( REFIID  iid,
void **  ppv 
)

Definition at line 2379 of file tiffformat.c.

2380{
2381 ERR("Trying to save TIFF picture, but Wine was compiled without TIFF support.\n");
2382 return E_FAIL;
2383}

◆ UnknownMetadataReader_CreateInstance()

HRESULT UnknownMetadataReader_CreateInstance ( REFIID  iid,
void **  ppv 
)

◆ 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;
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}
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
Definition: info.c:2474
_Out_ LPRECT prc
Definition: ntgdi.h:1658

Referenced by BmpFrameEncode_WriteSource(), and GifFrameEncode_WriteSource().