ReactOS 0.4.15-dev-8127-g6338913
wincodecs_private.h
Go to the documentation of this file.
1/*
2 * Copyright 2009 Vincent Povirk for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#ifndef WINCODECS_PRIVATE_H
20#define WINCODECS_PRIVATE_H
21
22#include "wincodec.h"
23#include "wincodecsdk.h"
24
25#include "wine/debug.h"
26#include "wine/unicode.h"
27
28DEFINE_GUID(CLSID_WineTgaDecoder, 0xb11fc79a,0x67cc,0x43e6,0xa9,0xce,0xe3,0xd5,0x49,0x45,0xd3,0x04);
29
30DEFINE_GUID(CLSID_WICIcnsEncoder, 0x312fb6f1,0xb767,0x409d,0x8a,0x6d,0x0f,0xc1,0x54,0xd4,0xf0,0x5c);
31
32DEFINE_GUID(GUID_WineContainerFormatTga, 0x0c44fda1,0xa5c5,0x4298,0x96,0x85,0x47,0x3f,0xc1,0x7c,0xd3,0x22);
33
34DEFINE_GUID(GUID_VendorWine, 0xddf46da1,0x7dc1,0x404e,0x98,0xf2,0xef,0xa4,0x8d,0xfc,0x95,0x0a);
35
36DEFINE_GUID(IID_IMILBitmap,0xb1784d3f,0x8115,0x4763,0x13,0xaa,0x32,0xed,0xdb,0x68,0x29,0x4a);
37DEFINE_GUID(IID_IMILBitmapSource,0x7543696a,0xbc8d,0x46b0,0x5f,0x81,0x8d,0x95,0x72,0x89,0x72,0xbe);
38DEFINE_GUID(IID_IMILBitmapLock,0xa67b2b53,0x8fa1,0x4155,0x8f,0x64,0x0c,0x24,0x7a,0x8f,0x84,0xcd);
39DEFINE_GUID(IID_IMILBitmapScaler,0xa767b0f0,0x1c8c,0x4aef,0x56,0x8f,0xad,0xf9,0x6d,0xcf,0xd5,0xcb);
40DEFINE_GUID(IID_IMILFormatConverter,0x7e2a746f,0x25c5,0x4851,0xb3,0xaf,0x44,0x3b,0x79,0x63,0x9e,0xc0);
41DEFINE_GUID(IID_IMILPalette,0xca8e206f,0xf22c,0x4af7,0x6f,0xba,0x7b,0xed,0x5e,0xb1,0xc9,0x2f);
42
43#define INTERFACE IMILBitmapSource
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};
57#undef INTERFACE
58
59#define INTERFACE IMILBitmap
60DECLARE_INTERFACE_(IMILBitmap,IMILBitmapSource)
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};
80#undef INTERFACE
81
82#define INTERFACE IMILBitmapScaler
83DECLARE_INTERFACE_(IMILBitmapScaler,IMILBitmapSource)
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};
99#undef INTERFACE
100
101#define THISCALLMETHOD_(type,method) type (__thiscall *method)
102
103#define INTERFACE IMILUnknown1
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};
124#undef INTERFACE
125
126#define INTERFACE IMILUnknown2
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};
138#undef INTERFACE
139
141
159
160extern HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight,
163 IWICBitmap **ppIBitmap) DECLSPEC_HIDDEN;
171
172extern HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer,
173 UINT srcwidth, UINT srcheight, INT srcstride,
174 const WICRect *rc, UINT dststride, UINT dstbuffersize, BYTE *dstbuffer) DECLSPEC_HIDDEN;
175
179 INT width, INT height, double xres, double yres) DECLSPEC_HIDDEN;
180
185
186extern void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride) DECLSPEC_HIDDEN;
188
190
191extern HRESULT CreatePropertyBag2(const PROPBAG2 *options, UINT count,
193
195extern void ReleaseComponentInfos(void) DECLSPEC_HIDDEN;
196extern HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnknown **ppIEnumUnknown) DECLSPEC_HIDDEN;
198
199typedef struct BmpDecoder BmpDecoder;
200
203extern void BmpDecoder_FindIconMask(BmpDecoder *This, ULONG *mask_offset, int *topdown) DECLSPEC_HIDDEN;
204
205typedef struct _MetadataItem
206{
207 PROPVARIANT schema;
208 PROPVARIANT id;
209 PROPVARIANT value;
211
213{
215 const CLSID *clsid;
216 HRESULT (*fnLoad)(IStream *stream, const GUID *preferred_vendor,
217 DWORD persist_options, MetadataItem **items, DWORD *item_count);
218 HRESULT (*fnSave)(IStream *stream, DWORD persist_options,
219 const MetadataItem *items, DWORD item_count);
223
225
238
239static inline WCHAR *heap_strdupW(const WCHAR *src)
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}
248
249static inline const char *debug_wic_rect(const WICRect *rect)
250{
251 if (!rect) return "(null)";
252 return wine_dbg_sprintf("(%u,%u)-(%u,%u)", rect->X, rect->Y, rect->Width, rect->Height);
253}
254
255#endif /* WINCODECS_PRIVATE_H */
#define DECLARE_INTERFACE_(i, b)
Definition: basetyps.h:78
#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 SIZE_T datasize
Definition: asm.c:30
#define NULL
Definition: types.h:112
DWORD bpp
Definition: surface.c:185
#define DECLSPEC_HIDDEN
Definition: precomp.h:8
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:296
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
pixelformat
Definition: converter.c:40
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLuint GLenum GLenum transform
Definition: glext.h:9407
GLsizei stride
Definition: glext.h:5848
GLenum src
Definition: glext.h:6340
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
GLenum GLenum dst
Definition: glext.h:6340
GLenum GLsizei len
Definition: glext.h:6722
GLintptr offset
Definition: glext.h:5920
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
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 void * vtable[]
Definition: typelib.c:1231
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
static HPALETTE palette
Definition: clipboard.c:1345
REFCLSID clsid
Definition: msctf.c:82
unsigned int UINT
Definition: ndis.h:50
#define DWORD
Definition: nt_native.h:44
_Out_ LPRECT prc
Definition: ntgdi.h:1658
@ Unlock
Definition: ntsecapi.h:294
static TCHAR * items[]
Definition: page1.c:45
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
#define strlenW(s)
Definition: unicode.h:34
& rect
Definition: startmenu.cpp:1413
Definition: scsiwmi.h:51
HRESULT(* fnLoad)(IStream *stream, const GUID *preferred_vendor, DWORD persist_options, MetadataItem **items, DWORD *item_count)
HRESULT(* fnSave)(IStream *stream, DWORD persist_options, const MetadataItem *items, DWORD item_count)
HRESULT(* fnGetSizeMax)(const MetadataItem *items, DWORD item_count, ULARGE_INTEGER *size)
PROPVARIANT schema
PROPVARIANT value
Definition: http.c:7252
Definition: getopt.h:109
Definition: parse.h:23
uint64_t DWORD64
Definition: typedefs.h:67
unsigned char * LPBYTE
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
WICBitmapInterpolationMode
Definition: wincodec.idl:76
WICBitmapCreateCacheOption
Definition: wincodec.idl:33
HRESULT FormatConverter_CreateInstance(REFIID riid, void **ppv) DECLSPEC_HIDDEN
Definition: converter.c:1835
HRESULT BitmapScaler_Create(IWICBitmapScaler **scaler) DECLSPEC_HIDDEN
Definition: scaler.c:515
HRESULT configure_write_source(IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, INT width, INT height, double xres, double yres) DECLSPEC_HIDDEN
Definition: main.c:123
HRESULT APEReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: gifformat.c:434
HRESULT PaletteImpl_Create(IWICPalette **palette) DECLSPEC_HIDDEN
Definition: palette.c:899
struct _MetadataItem MetadataItem
HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp) DECLSPEC_HIDDEN
Definition: main.c:252
static const char * debug_wic_rect(const WICRect *rect)
HRESULT GifCommentReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: gifformat.c:528
HRESULT ImagingFactory_CreateInstance(REFIID riid, void **ppv) DECLSPEC_HIDDEN
Definition: imgfactory.c:1470
void BmpDecoder_GetWICDecoder(BmpDecoder *This, IWICBitmapDecoder **ppDecoder) DECLSPEC_HIDDEN
Definition: bmpdecode.c:1210
struct _MetadataHandlerVtbl MetadataHandlerVtbl
HRESULT PngTextReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: pngformat.c:155
HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight, UINT stride, UINT datasize, void *view, UINT offset, REFWICPixelFormatGUID pixelFormat, WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap) DECLSPEC_HIDDEN
Definition: bitmap.c:793
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
Definition: main.c:58
HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *, const WCHAR *, IWICMetadataQueryReader **) DECLSPEC_HIDDEN
HRESULT GCEReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: gifformat.c:327
void BmpDecoder_FindIconMask(BmpDecoder *This, ULONG *mask_offset, int *topdown) DECLSPEC_HIDDEN
Definition: bmpdecode.c:1216
HRESULT DibDecoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: bmpdecode.c:1200
HRESULT StreamImpl_Create(IWICStream **stream) DECLSPEC_HIDDEN
Definition: stream.c:1150
HRESULT IfdMetadataReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
HRESULT LSDReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: gifformat.c:168
HRESULT BmpEncoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: bmpencode.c:642
HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo) DECLSPEC_HIDDEN
Definition: info.c:2075
HRESULT GifEncoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: gifformat.c:2375
HRESULT PngEncoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: pngformat.c:2194
void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride) DECLSPEC_HIDDEN
Definition: main.c:212
HRESULT write_source(IWICBitmapFrameEncode *iface, IWICBitmapSource *source, const WICRect *prc, const WICPixelFormatGUID *format, UINT bpp, INT width, INT height) DECLSPEC_HIDDEN
Definition: main.c:155
HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnknown **ppIEnumUnknown) DECLSPEC_HIDDEN
Definition: info.c:2380
HRESULT BmpDecoder_CreateInstance(REFIID riid, void **ppv) DECLSPEC_HIDDEN
Definition: bmpdecode.c:1195
HRESULT IcnsEncoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: icnsformat.c:737
void convert_rgba_to_bgra(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride) DECLSPEC_HIDDEN
Definition: main.c:231
HRESULT CreatePropertyBag2(const PROPBAG2 *options, UINT count, IPropertyBag2 **property) DECLSPEC_HIDDEN
Definition: propertybag.c:281
HRESULT PngGamaReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: pngformat.c:217
HRESULT TiffEncoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: tiffformat.c:2379
HRESULT JpegEncoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: jpegformat.c:1556
HRESULT FlipRotator_Create(IWICBitmapFlipRotator **fliprotator) DECLSPEC_HIDDEN
Definition: fliprotate.c:268
HRESULT JpegDecoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: jpegformat.c:1550
HRESULT IMDReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: gifformat.c:249
HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void **ppv) DECLSPEC_HIDDEN
HRESULT ColorTransform_Create(IWICColorTransform **transform) DECLSPEC_HIDDEN
HRESULT PngDecoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: pngformat.c:2188
HRESULT get_decoder_info(REFCLSID clsid, IWICBitmapDecoderInfo **info) DECLSPEC_HIDDEN
Definition: info.c:2162
HRESULT IcoDibDecoder_CreateInstance(BmpDecoder **ppDecoder) DECLSPEC_HIDDEN
Definition: bmpdecode.c:1205
HRESULT create_instance(CLSID *clsid, const IID *iid, void **ppv) DECLSPEC_HIDDEN
Definition: clsfactory.c:208
static WCHAR * heap_strdupW(const WCHAR *src)
HRESULT PngChrmReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: pngformat.c:295
HRESULT TiffDecoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: tiffformat.c:2373
HRESULT TgaDecoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: tgaformat.c:942
HRESULT UnknownMetadataReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
HRESULT BitmapClipper_Create(IWICBitmapClipper **clipper) DECLSPEC_HIDDEN
Definition: clipper.c:243
HRESULT IcoDecoder_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN
Definition: icoformat.c:759
HRESULT GifDecoder_CreateInstance(REFIID riid, void **ppv) DECLSPEC_HIDDEN
Definition: gifformat.c:1434
HRESULT ColorContext_Create(IWICColorContext **context) DECLSPEC_HIDDEN
Definition: colorcontext.c:258
HRESULT(* class_constructor)(REFIID, void **)
HRESULT stream_initialize_from_filehandle(IWICStream *iface, HANDLE hfile) DECLSPEC_HIDDEN
Definition: stream.c:1039
void ReleaseComponentInfos(void) DECLSPEC_HIDDEN
Definition: info.c:2155
#define HRESULT
Definition: msvc.h:7
#define IMILUnknown1
Definition: msvc.h:8
int WINAPI GetPixelFormat(_In_ HDC)
_In_ BOOLEAN SetResolution
Definition: exfuncs.h:1078
static void Initialize()
Definition: xlate.c:212
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193