winedbg: Make disassembler properly print EMX and EXMM type operands.
[wine] / include / wincodec.idl
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 import "wtypes.idl";
20 import "propidl.idl";
21 import "objidl.idl";
22 import "ocidl.idl";
23
24 #define CODEC_FORCE_DWORD 0x7fffffff
25
26 typedef enum WICDecodeOptions {
27     WICDecodeMetadataCacheOnDemand = 0x00000000,
28     WICDecodeMetadataCacheOnLoad = 0x00000001,
29     WICMETADATACACHEOPTION_FORCE_DWORD = CODEC_FORCE_DWORD
30 } WICDecodeOptions;
31
32 typedef enum WICBitmapCreateCacheOption {
33     WICBitmapNoCache = 0x00000000,
34     WICBitmapCacheOnDemand = 0x00000001,
35     WICBitmapCacheOnLoad = 0x00000002,
36     WICBITMAPCREATECACHEOPTION_FORCE_DWORD = CODEC_FORCE_DWORD
37 } WICBitmapCreateCacheOption;
38
39 typedef enum WICBitmapAlphaChannelOption {
40     WICBitmapUseAlpha = 0x00000000,
41     WICBitmapUsePremultipliedAlpha = 0x00000001,
42     WICBitmapIgnoreAlpha = 0x00000002,
43     WICBITMAPALPHACHANNELOPTIONS_FORCE_DWORD = CODEC_FORCE_DWORD
44 } WICBitmapAlphaChannelOption;
45
46 typedef enum WICBitmapDecoderCapabilities {
47     WICBitmapDecoderCapabilitySameEncoder = 0x00000001,
48     WICBitmapDecoderCapabilityCanDecodeAllImages = 0x00000002,
49     WICBitmapDecoderCapabilityCanDecodeSomeImages = 0x00000004,
50     WICBitmapDecoderCapabilityCanEnumerateMetadata = 0x00000008,
51     WICBitmapDecoderCapabilityCanDecodeThumbnail = 0x00000010,
52 } WICBitmapDecoderCapabilities;
53
54 typedef enum WICBitmapDitherType {
55     WICBitmapDitherTypeNone = 0x00000000,
56     WICBitmapDitherTypeSolid = 0x00000000,
57     WICBitmapDitherTypeOrdered4x4 = 0x00000001,
58     WICBitmapDitherTypeOrdered8x8 = 0x00000002,
59     WICBitmapDitherTypeOrdered16x16 = 0x00000003,
60     WICBitmapDitherTypeSpiral4x4 = 0x00000004,
61     WICBitmapDitherTypeSpiral8x8 = 0x00000005,
62     WICBitmapDitherTypeDualSpiral4x4 = 0x00000006,
63     WICBitmapDitherTypeDualSpiral8x8 = 0x00000007,
64     WICBitmapDitherTypeErrorDiffusion = 0x00000008,
65     WICBITMAPDITHERTYPE_FORCE_DWORD = CODEC_FORCE_DWORD
66 } WICBitmapDitherType;
67
68 typedef enum WICBitmapEncoderCacheOption {
69     WICBitmapEncoderCacheInMemory = 0x00000000,
70     WICBitmapEncoderCacheTempFile = 0x00000001,
71     WICBitmapEncoderNoCache = 0x00000002,
72     WICBITMAPENCODERCACHEOPTION_FORCE_DWORD = CODEC_FORCE_DWORD
73 } WICBitmapEncoderCacheOption;
74
75 typedef enum WICBitmapInterpolationMode {
76     WICBitmapInterpolationModeNearestNeighbor = 0x00000000,
77     WICBitmapInterpolationModeLinear = 0x00000001,
78     WICBitmapInterpolationModeCubic = 0x00000002,
79     WICBitmapInterpolationModeFaint = 0x00000003,
80     WICBITMAPINTERPOLATIONMODE_FORCE_DWORD = CODEC_FORCE_DWORD
81 } WICBitmapInterpolationMode;
82
83 typedef enum WICBitmapPaletteType {
84     WICBitmapPaletteTypeCustom = 0x00000000,
85     WICBitmapPaletteTypeMedianCut = 0x00000001,
86     WICBitmapPaletteTypeFixedBW = 0x00000002,
87     WICBitmapPaletteTypeFixedHalftone8 = 0x00000003,
88     WICBitmapPaletteTypeFixedHalftone27 = 0x00000004,
89     WICBitmapPaletteTypeFixedHalftone64 = 0x00000005,
90     WICBitmapPaletteTypeFixedHalftone125 = 0x00000006,
91     WICBitmapPaletteTypeFixedHalftone216 = 0x00000007,
92     WICBitmapPaletteTypeFixedWebPalette = WICBitmapPaletteTypeFixedHalftone216,
93     WICBitmapPaletteTypeFixedHalftone252 = 0x00000008,
94     WICBitmapPaletteTypeFixedHalftone256 = 0x00000009,
95     WICBitmapPaletteTypeFixedGray4 = 0x0000000A,
96     WICBitmapPaletteTypeFixedGray16 = 0x0000000B,
97     WICBitmapPaletteTypeFixedGray256 = 0x0000000C,
98     WICBITMAPPALETTETYPE_FORCE_DWORD = CODEC_FORCE_DWORD
99 } WICBitmapPaletteType;
100
101 typedef enum WICBitmapTransformOptions {
102     WICBitmapTransformRotate0 = 0x00000000,
103     WICBitmapTransformRotate90 = 0x00000001,
104     WICBitmapTransformRotate180 = 0x00000002,
105     WICBitmapTransformRotate270 = 0x00000003,
106     WICBitmapTransformFlipHorizontal = 0x00000008,
107     WICBitmapTransformFlipVertical = 0x00000010,
108     WICBITMAPTRANSFORMOPTIONS_FORCE_DWORD = CODEC_FORCE_DWORD
109 } WICBitmapTransformOptions;
110
111 typedef enum WICComponentType {
112     WICDecoder = 0x00000001,
113     WICEncoder = 0x00000002,
114     WICPixelFormatConverter = 0x00000004,
115     WICMetadataReader = 0x00000008,
116     WICMetadataWriter = 0x00000010,
117     WICPixelFormat = 0x00000020,
118     WICCOMPONENTTYPE_FORCE_DWORD = CODEC_FORCE_DWORD
119 } WICComponentType;
120
121 typedef enum WICComponentSigning {
122     WICComponentSigned = 0x00000001,
123     WICComponentUnsigned = 0x00000002,
124     WICComponentSafe = 0x00000004,
125     WICComponentDisabled = 0x80000000
126 } WICComponentSigning;
127
128 typedef enum WICComponentEnumerateOptions {
129     WICComponentEnumerateDefault = 0x00000000,
130     WICComponentEnumerateRefresh = 0x00000001,
131     WICComponentEnumerateBuiltInOnly = 0x20000000,
132     WICComponentEnumerateUnsigned = 0x40000000,
133     WICComponentEnumerateDisabled = 0x80000000
134 } WICComponentEnumerateOptions;
135
136 typedef GUID WICPixelFormatGUID;
137 typedef REFGUID REFWICPixelFormatGUID;
138
139 cpp_quote("DEFINE_GUID(GUID_WICPixelFormatDontCare, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x00);")
140 cpp_quote("#define GUID_WICPixelFormatUndefined GUID_WICPixelFormatDontCare")
141
142 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat1bppIndexed, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x01);")
143 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat2bppIndexed, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x02);")
144 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat4bppIndexed, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x03);")
145 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat8bppIndexed, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x04);")
146
147 cpp_quote("DEFINE_GUID(GUID_WICPixelFormatBlackWhite, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x05);")
148 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat2bppGray, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x06);")
149 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat4bppGray, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x07);")
150 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat8bppGray, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x08);")
151 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat16bppGray, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x0b);")
152
153 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat16bppBGR555, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x09);")
154 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat16bppBGR565, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x0a);")
155 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat24bppBGR, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x0c);")
156 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat32bppBGR, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x0e);")
157 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat32bppBGRA, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x0f);")
158 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat32bppPBGRA, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x10);")
159
160 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat48bppRGB, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x15);")
161 cpp_quote("DEFINE_GUID(GUID_WICPixelFormat64bppRGBA, 0x6fddc324,0x4e03,0x4bfe,0xb1,0x85,0x3d,0x77,0x76,0x8d,0xc9,0x16);")
162
163 typedef struct WICRect {
164     INT X;
165     INT Y;
166     INT Width;
167     INT Height;
168 } WICRect;
169
170 typedef struct WICBitmapPattern {
171     ULARGE_INTEGER Position;
172     ULONG Length;
173     BYTE *Pattern;
174     BYTE *Mask;
175     BOOL EndOfStream;
176 } WICBitmapPattern;
177
178 typedef UINT32 WICColor;
179
180 cpp_quote("#define WINCODEC_ERR_WRONGSTATE 0x88982f04")
181 cpp_quote("#define WINCODEC_ERR_NOTINITIALIZED 0x88982f0c")
182 cpp_quote("#define WINCODEC_ERR_CODECNOTHUMBNAIL 0x88982f44")
183 cpp_quote("#define WINCODEC_ERR_PALETTEUNAVAILABLE 0x88982f45")
184 cpp_quote("#define WINCODEC_ERR_COMPONENTNOTFOUND 0x88982f50")
185 cpp_quote("#define WINCODEC_ERR_FRAMEMISSING 0x88982f62")
186 cpp_quote("#define WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT 0x88982f80")
187 cpp_quote("#define WINCODEC_ERR_UNSUPPORTEDOPERATION 0x88982f81")
188 cpp_quote("#define WINCODEC_ERR_INSUFFICIENTBUFFER 0x88982f8c")
189
190 interface IWICPalette;
191 interface IWICColorContext;
192 interface IWICColorTransform;
193 interface IWICFastMetadataEncoder;
194 interface IWICMetadataQueryReader;
195 interface IWICMetadataQueryWriter;
196
197 [
198     object,
199     uuid(00000120-a8f2-4877-ba0a-fd2b6645fb94)
200 ]
201 interface IWICBitmapSource : IUnknown
202 {
203     HRESULT GetSize(
204         [out] UINT *puiWidth,
205         [out] UINT *puiHeight);
206
207     HRESULT GetPixelFormat(
208         [out] WICPixelFormatGUID *pPixelFormat);
209
210     HRESULT GetResolution(
211         [out] double *pDpiX,
212         [out] double *pDpiY);
213
214     HRESULT CopyPalette(
215         [in] IWICPalette *pIPalette);
216
217     HRESULT CopyPixels(
218         [in] const WICRect *prc,
219         [in] UINT cbStride,
220         [in] UINT cbBufferSize,
221         [out, size_is(cbBufferSize)] BYTE *pbBuffer);
222 }
223
224 [
225     object,
226     uuid(00000123-a8f2-4877-ba0a-fd2b6645fb94)
227 ]
228 interface IWICBitmapLock : IUnknown
229 {
230     HRESULT GetSize(
231         [out] UINT *pWidth,
232         [out] UINT *pHeight);
233
234     HRESULT GetStride(
235         [out] UINT *pcbStride);
236
237     HRESULT GetDataPointer(
238         [out] UINT *pcbBufferSize,
239         [out, size_is(,*pcbBufferSize)] BYTE **ppbData);
240
241     HRESULT GetPixelFormat(
242         [out] WICPixelFormatGUID *pPixelFormat);
243 }
244
245 [
246     object,
247     uuid(5009834f-2d6a-41ce-9e1b-17c5aff7a782)
248 ]
249 interface IWICBitmapFlipRotator : IWICBitmapSource
250 {
251     HRESULT Initialize(
252         [in] IWICBitmapSource *pISource,
253         [in] WICBitmapTransformOptions options);
254 }
255
256 [
257     object,
258     uuid(00000121-a8f2-4877-ba0a-fd2b6645fb94)
259 ]
260 interface IWICBitmap : IWICBitmapSource
261 {
262     HRESULT Lock(
263         [in] const WICRect *prcLock,
264         [in] DWORD flags,
265         [out] IWICBitmapLock **ppILock);
266
267     HRESULT SetPalette(
268         [in] IWICPalette *pIPalette);
269
270     HRESULT SetResolution(
271         [in] double dpiX,
272         [in] double dpiY);
273 }
274
275 [
276     object,
277     uuid(00000040-a8f2-4877-ba0a-fd2b6645fb94)
278 ]
279 interface IWICPalette : IUnknown
280 {
281     HRESULT InitializePredefined(
282         [in] WICBitmapPaletteType ePaletteType,
283         [in] BOOL fAddTransparentColor);
284
285     HRESULT InitializeCustom(
286         [in, size_is(colorCount)] WICColor *pColors,
287         [in] UINT colorCount);
288
289     HRESULT InitializeFromBitmap(
290         [in] IWICBitmapSource *pISurface,
291         [in] UINT colorCount,
292         [in] BOOL fAddTransparentColor);
293
294     HRESULT InitializeFromPalette(
295         [in] IWICPalette *pIPalette);
296
297     HRESULT GetType(
298         [out] WICBitmapPaletteType *pePaletteType);
299
300     HRESULT GetColorCount(
301         [out] UINT *pcCount);
302
303     HRESULT GetColors(
304         [in] UINT colorCount,
305         [out, size_is(colorCount)] WICColor *pColors,
306         [out] UINT *pcActualColors);
307
308     HRESULT IsBlackWhite(
309         [out] BOOL *pfIsBlackWhite);
310
311     HRESULT IsGrayscale(
312         [out] BOOL *pfIsGrayscale);
313
314     HRESULT HasAlpha(
315         [out] BOOL *pfHasAlpha);
316 }
317
318 [
319     object,
320     uuid(23bc3f0a-698b-4357-886b-f24d50671334)
321 ]
322 interface IWICComponentInfo : IUnknown
323 {
324     HRESULT GetComponentType(
325         [out] WICComponentType *pType);
326
327     HRESULT GetCLSID(
328         [out] CLSID *pclsid);
329
330     HRESULT GetSigningStatus(
331         [out] DWORD *pStatus);
332
333     HRESULT GetAuthor(
334         [in] UINT cchAuthor,
335         [in, out, unique, size_is(cchAuthor)] WCHAR *wzAuthor,
336         [out] UINT *pcchActual);
337
338     HRESULT GetVendorGUID(
339         [out] GUID *pguidVendor);
340
341     HRESULT GetVersion(
342         [in] UINT cchVersion,
343         [in, out, unique, size_is(cchVersion)] WCHAR *wzVersion,
344         [out] UINT *pcchActual);
345
346     HRESULT GetSpecVersion(
347         [in] UINT cchSpecVersion,
348         [in, out, unique, size_is(cchSpecVersion)] WCHAR *wzSpecVersion,
349         [out] UINT *pcchActual);
350
351     HRESULT GetFriendlyName(
352         [in] UINT cchFriendlyName,
353         [in, out, unique, size_is(cchFriendlyName)] WCHAR *wzFriendlyName,
354         [out] UINT *pcchActual);
355 }
356
357 [
358     object,
359     uuid(3b16811b-6a43-4ec9-a813-3d930c13b940)
360 ]
361 interface IWICBitmapFrameDecode : IWICBitmapSource
362 {
363     HRESULT GetMetadataQueryReader(
364         [out] IWICMetadataQueryReader **ppIMetadataQueryReader);
365
366     HRESULT GetColorContexts(
367         [in] UINT cCount,
368         [in, out, unique, size_is(cCount)] IWICColorContext **ppIColorContexts,
369         [out] UINT *pcActualCount);
370
371     HRESULT GetThumbnail(
372         [out] IWICBitmapSource **ppIThumbnail);
373 }
374
375 [
376     object,
377     uuid(e87a44c4-b76e-4c47-8b09-298eb12a2714)
378 ]
379 interface IWICBitmapCodecInfo : IWICComponentInfo
380 {
381     HRESULT GetContainerFormat(
382         [out] GUID *pguidContainerFormat);
383
384     HRESULT GetPixelFormats(
385         [in] UINT cFormats,
386         [in, out, unique, size_is(cFormats)] GUID *pguidPixelFormats,
387         [out] UINT *pcActual);
388
389     HRESULT GetColorManagementVersion(
390         [in] UINT cchColorManagementVersion,
391         [in, out, unique, size_is(cchColorManagementVersion)] WCHAR *wzColorManagementVersion,
392         [out] UINT *pcchActual);
393
394     HRESULT GetDeviceManufacturer(
395         [in] UINT cchDeviceManufacturer,
396         [in, out, unique, size_is(cchDeviceManufacturer)] WCHAR *wzDeviceManufacturer,
397         [out] UINT *pcchActual);
398
399     HRESULT GetDeviceModels(
400         [in] UINT cchDeviceModels,
401         [in, out, unique, size_is(cchDeviceModels)] WCHAR *wzDeviceModels,
402         [out] UINT *pcchActual);
403
404     HRESULT GetMimeTypes(
405         [in] UINT cchMimeTypes,
406         [in, out, unique, size_is(cchMimeTypes)] WCHAR *wzMimeTypes,
407         [out] UINT *pcchActual);
408
409     HRESULT GetFileExtensions(
410         [in] UINT cchFileExtensions,
411         [in, out, unique, size_is(cchFileExtensions)] WCHAR *wzFileExtensions,
412         [out] UINT *pcchActual);
413
414     HRESULT DoesSupportAnimation(
415         [out] BOOL *pfSupportAnimation);
416
417     HRESULT DoesSupportChromaKey(
418         [out] BOOL *pfSupportChromaKey);
419
420     HRESULT DoesSupportLossless(
421         [out] BOOL *pfSupportLossless);
422
423     HRESULT DoesSupportMultiframe(
424         [out] BOOL *pfSupportMultiframe);
425
426     HRESULT MatchesMimeType(
427         [in] LPCWSTR wzMimeType,
428         [out] BOOL *pfMatches);
429 }
430
431 interface IWICBitmapDecoder;
432
433 [
434     object,
435     uuid(d8cd007f-d08f-4191-9bfc-236ea7f0e4b5)
436 ]
437 interface IWICBitmapDecoderInfo : IWICBitmapCodecInfo
438 {
439     [local]
440     HRESULT GetPatterns(
441         [in] UINT cbSizePatterns,
442         [in, out, unique] WICBitmapPattern *pPatterns,
443         [in, out, unique] UINT *pcPatterns,
444         [in, out, unique] UINT *pcbPatternsActual);
445
446     HRESULT MatchesPattern(
447         [in] IStream *pIStream,
448         [out] BOOL *pfMatches);
449
450     HRESULT CreateInstance(
451         [out] IWICBitmapDecoder **ppIBitmapDecoder);
452 }
453
454 [
455     object,
456     uuid(9edde9e7-8dee-47ea-99df-e6faf2ed44bf)
457 ]
458 interface IWICBitmapDecoder : IUnknown
459 {
460     HRESULT QueryCapability(
461         [in] IStream *pIStream,
462         [out] DWORD *pdwCapability);
463
464     HRESULT Initialize(
465         [in] IStream *pIStream,
466         [in] WICDecodeOptions cacheOptions);
467
468     HRESULT GetContainerFormat(
469         [out] GUID *pguidContainerFormat);
470
471     HRESULT GetDecoderInfo(
472         [out] IWICBitmapDecoderInfo **ppIDecoderInfo);
473
474     HRESULT CopyPalette(
475         [in] IWICPalette *pIPalette);
476
477     HRESULT GetMetadataQueryReader(
478         [out] IWICMetadataQueryReader **ppIMetadataQueryReader);
479
480     HRESULT GetPreview(
481         [out] IWICBitmapSource **ppIBitmapSource);
482
483     HRESULT GetColorContexts(
484         [in] UINT cCount,
485         [in, out, unique, size_is(cCount)] IWICColorContext **ppIColorContexts,
486         [out] UINT *pcActualCount);
487
488     HRESULT GetThumbnail(
489         [out] IWICBitmapSource **ppIThumbnail);
490
491     HRESULT GetFrameCount(
492         [out] UINT *pCount);
493
494     HRESULT GetFrame(
495         [in] UINT index,
496         [out] IWICBitmapFrameDecode **ppIBitmapFrame);
497 }
498
499 [
500     object,
501     uuid(00000105-a8f2-4877-ba0a-fd2b6645fb94)
502 ]
503 interface IWICBitmapFrameEncode : IUnknown
504 {
505     HRESULT Initialize(
506         [in, unique] IPropertyBag2 *pIEncoderOptions);
507
508     HRESULT SetSize(
509         [in] UINT uiWidth,
510         [in] UINT uiHeight);
511
512     HRESULT SetResolution(
513         [in] double dpiX,
514         [in] double dpiY);
515
516     HRESULT SetPixelFormat(
517         [in, out] WICPixelFormatGUID *pPixelFormat);
518
519     HRESULT SetColorContexts(
520         [in] UINT cCount,
521         [in, size_is(cCount)] IWICColorContext **ppIColorContext);
522
523     HRESULT SetPalette(
524         [in] IWICPalette *pIPalette);
525
526     HRESULT SetThumbnail(
527         [in] IWICBitmapSource *pIThumbnail);
528
529     HRESULT WritePixels(
530         [in] UINT lineCount,
531         [in] UINT cbStride,
532         [in] UINT cbBufferSize,
533         [in, size_is(cbBufferSize)] BYTE *pbPixels);
534
535     HRESULT WriteSource(
536         [in] IWICBitmapSource *pIBitmapSource,
537         [in, unique] WICRect *prc);
538
539     HRESULT Commit();
540
541     HRESULT GetMetadataQueryWriter(
542         IWICMetadataQueryWriter **ppIMetadataQueryWriter);
543 }
544
545 interface IWICBitmapEncoder;
546
547 [
548     object,
549     uuid(94c9b4ee-a09f-4f92-8a1e-4a9bce7e76fb)
550 ]
551 interface IWICBitmapEncoderInfo : IWICBitmapCodecInfo
552 {
553     HRESULT CreateInstance(
554         [out] IWICBitmapEncoder **ppIBitmapEncoder);
555 }
556
557 [
558     object,
559     uuid(00000103-a8f2-4877-ba0a-fd2b6645fb94)
560 ]
561 interface IWICBitmapEncoder : IUnknown
562 {
563     HRESULT Initialize(
564         [in] IStream *pIStream,
565         [in] WICBitmapEncoderCacheOption cacheOption);
566
567     HRESULT GetContainerFormat(
568         [out] GUID *pguidContainerFormat);
569
570     HRESULT GetEncoderInfo(
571         [out] IWICBitmapEncoderInfo **ppIEncoderInfo);
572
573     HRESULT SetColorContexts(
574         [in] UINT cCount,
575         [in, size_is(cCount)] IWICColorContext **ppIColorContext);
576
577     HRESULT SetPalette(
578         [in] IWICPalette *pIPalette);
579
580     HRESULT SetThumbnail(
581         [in] IWICBitmapSource *pIThumbnail);
582
583     HRESULT SetPreview(
584         [in] IWICBitmapSource *pIPreview);
585
586     HRESULT CreateNewFrame(
587         [out] IWICBitmapFrameEncode **ppIFrameEncode,
588         [in, out, unique] IPropertyBag2 **ppIEncoderOptions);
589
590     HRESULT Commit();
591
592     HRESULT GetMetadataQueryWriter(
593         [out] IWICMetadataQueryWriter **ppIMetadataQueryWriter);
594 }
595
596 [
597     object,
598     uuid(00000301-a8f2-4877-ba0a-fd2b6645fb94)
599 ]
600 interface IWICFormatConverter : IWICBitmapSource
601 {
602     HRESULT Initialize(
603         [in] IWICBitmapSource *pISource,
604         [in] REFWICPixelFormatGUID dstFormat,
605         [in] WICBitmapDitherType dither,
606         [in] IWICPalette *pIPalette,
607         [in] double alphaThresholdPercent,
608         [in] WICBitmapPaletteType paletteTranslate);
609
610     HRESULT CanConvert(
611         [in] REFWICPixelFormatGUID srcPixelFormat,
612         [in] REFWICPixelFormatGUID dstPixelFormat,
613         [out] BOOL *pfCanConvert);
614 }
615
616 [
617     object,
618     uuid(9f34fb65-13f4-4f15-bc57-3726b5e53d9f)
619 ]
620 interface IWICFormatConverterInfo : IWICComponentInfo
621 {
622     HRESULT GetPixelFormats(
623         [in] UINT cFormats,
624         [in, out, size_is(cFormats)] WICPixelFormatGUID *pPixelFormatGUIDs,
625         [out] UINT *pcActual);
626
627     HRESULT CreateInstance(
628         [out] IWICFormatConverter **ppIConverter);
629 }
630
631 [
632     object,
633     uuid(135ff860-22b7-4ddf-b0f6-218f4f299a43)
634 ]
635 interface IWICStream : IStream
636 {
637     HRESULT InitializeFromIStream(
638         [in] IStream *pIStream);
639
640     HRESULT InitializeFromFilename(
641         [in] LPCWSTR wzFileName,
642         [in] DWORD dwAccessMode);
643
644     HRESULT InitializeFromMemory(
645         [in, size_is(cbBufferSize)] BYTE *pbBuffer,
646         [in] DWORD cbBufferSize);
647
648     HRESULT InitializeFromIStreamRegion(
649         [in] IStream *pIStream,
650         [in] ULARGE_INTEGER ulOffset,
651         [in] ULARGE_INTEGER ulMaxSize);
652 }
653
654 [
655     object,
656     uuid(00000302-a8f2-4877-ba0a-fd2b6645fb94)
657 ]
658 interface IWICBitmapScaler : IWICBitmapSource
659 {
660     HRESULT Initialize(
661         [in] IWICBitmapSource *pISource,
662         [in] UINT uiWidth,
663         [in] UINT uiHeight,
664         [in] WICBitmapInterpolationMode mode);
665 }
666
667 [
668     object,
669     uuid(e4fbcf03-223d-4e81-9333-d635556dd1b5)
670 ]
671 interface IWICBitmapClipper : IWICBitmapSource
672 {
673     HRESULT Initialize(
674         [in] IWICBitmapSource *pISource,
675         [in] const WICRect *prc);
676 }
677
678 cpp_quote("DEFINE_GUID(CLSID_WICImagingFactory, 0xcacaf262,0x9370,0x4615,0xa1,0x3b,0x9f,0x55,0x39,0xda,0x4c,0x0a);")
679
680 [
681     object,
682     uuid(ec5ec8a9-c395-4314-9c77-54d7a935ff70)
683 ]
684 interface IWICImagingFactory : IUnknown
685 {
686     HRESULT CreateDecoderFromFilename(
687         [in] LPCWSTR wzFilename,
688         [in, unique] const GUID *pguidVendor,
689         [in] DWORD dwDesiredAccess,
690         [in] WICDecodeOptions metadataOptions,
691         [out, retval] IWICBitmapDecoder **ppIDecoder);
692
693     HRESULT CreateDecoderFromStream(
694         [in] IStream *pIStream,
695         [in, unique] const GUID *pguidVendor,
696         [in] WICDecodeOptions metadataOptions,
697         [out, retval] IWICBitmapDecoder **ppIDecoder);
698
699     HRESULT CreateDecoderFromFileHandle(
700         [in] ULONG_PTR hFile,
701         [in, unique] const GUID *pguidVendor,
702         [in] WICDecodeOptions metadataOptions,
703         [out, retval] IWICBitmapDecoder **ppIDecoder);
704
705     HRESULT CreateComponentInfo(
706         [in] REFCLSID clsidComponent,
707         [out] IWICComponentInfo **ppIInfo);
708
709     HRESULT CreateDecoder(
710         [in] REFGUID guidContainerFormat,
711         [in, unique] const GUID *pguidVendor,
712         [out, retval] IWICBitmapDecoder **ppIDecoder);
713
714     HRESULT CreateEncoder(
715         [in] REFGUID guidContainerFormat,
716         [in, unique] const GUID *pguidVendor,
717         [out, retval] IWICBitmapEncoder **ppIEncoder);
718
719     HRESULT CreatePalette(
720         [out] IWICPalette **ppIPalette);
721
722     HRESULT CreateFormatConverter(
723         [out] IWICFormatConverter **ppIFormatConverter);
724
725     HRESULT CreateBitmapScaler(
726         [out] IWICBitmapScaler **ppIBitmapScaler);
727
728     HRESULT CreateBitmapClipper(
729         [out] IWICBitmapClipper **ppIBitmapClipper);
730
731     HRESULT CreateBitmapFlipRotator(
732         [out] IWICBitmapFlipRotator **ppIBitmapFlipRotator);
733
734     HRESULT CreateStream(
735         [out] IWICStream **ppIWICStream);
736
737     HRESULT CreateColorContext(
738         [out] IWICColorContext **ppIWICColorContext);
739
740     HRESULT CreateColorTransformer(
741         [out] IWICColorTransform **ppIWICColorTransform);
742
743     HRESULT CreateBitmap(
744         [in] UINT uiWidth,
745         [in] UINT uiHeight,
746         [in] REFWICPixelFormatGUID pixelFormat,
747         [in] WICBitmapCreateCacheOption option,
748         [out] IWICBitmap **ppIBitmap);
749
750     HRESULT CreateBitmapFromSource(
751         [in] IWICBitmapSource *piBitmapSource,
752         [in] WICBitmapCreateCacheOption option,
753         [out] IWICBitmap **ppIBitmap);
754
755     HRESULT CreateBitmapFromSourceRect(
756         [in] IWICBitmapSource *piBitmapSource,
757         [in] UINT x,
758         [in] UINT y,
759         [in] UINT width,
760         [in] UINT height,
761         [out] IWICBitmap **ppIBitmap);
762
763     HRESULT CreateBitmapFromMemory(
764         [in] UINT uiWidth,
765         [in] UINT uiHeight,
766         [in] REFWICPixelFormatGUID pixelFormat,
767         [in] UINT cbStride,
768         [in] UINT cbBufferSize,
769         [in, size_is(cbBufferSize)] BYTE *pbBuffer,
770         [out] IWICBitmap **ppIBitmap);
771
772     HRESULT CreateBitmapFromHBITMAP(
773         [in] HBITMAP hBitmap,
774         [in, unique] HPALETTE hPalette,
775         [in] WICBitmapAlphaChannelOption options,
776         [out] IWICBitmap **ppIBitmap);
777
778     HRESULT CreateBitmapFromHICON(
779         [in] HICON hIcon,
780         [out] IWICBitmap **ppIBitmap);
781
782     HRESULT CreateComponentEnumerator(
783         [in] DWORD componentTypes,
784         [in] DWORD options,
785         [out] IEnumUnknown **ppIEnumUnknown);
786
787     HRESULT CreateFastMetadataEncoderFromDecoder(
788         [in] IWICBitmapDecoder *pIDecoder,
789         [out] IWICFastMetadataEncoder **ppIFastEncoder);
790
791     HRESULT CreateFastMetadataEncoderFromFrameDecode(
792         [in] IWICBitmapFrameDecode *pIFrameDecoder,
793         [out] IWICFastMetadataEncoder **ppIFastEncoder);
794
795     HRESULT CreateQueryWriter(
796         [in] REFGUID guidMetadataFormat,
797         [in, unique] const GUID *pguidVendor,
798         [out] IWICMetadataQueryWriter **ppIQueryWriter);
799
800     HRESULT CreateQueryWriterFromReader(
801         [in] IWICMetadataQueryReader *pIQueryReader,
802         [in, unique] const GUID *pguidVendor,
803         [out] IWICMetadataQueryWriter **ppIQueryWriter);
804 }
805
806 cpp_quote("HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst);")
807
808 cpp_quote("DEFINE_GUID(CLSID_WICBmpDecoder, 0x6b462062,0x7cbf,0x400d,0x9f,0xdb,0x81,0x3d,0xd1,0x0f,0x27,0x78);")
809 cpp_quote("DEFINE_GUID(CLSID_WICPngDecoder, 0x389ea17b,0x5078,0x4cde,0xb6,0xef,0x25,0xc1,0x51,0x75,0xc7,0x51);")
810 cpp_quote("DEFINE_GUID(CLSID_WICIcoDecoder, 0xc61bfcdf,0x2e0f,0x4aad,0xa8,0xd7,0xe0,0x6b,0xaf,0xeb,0xcd,0xfe);")
811 cpp_quote("DEFINE_GUID(CLSID_WICJpegDecoder, 0x9456a480,0xe88b,0x43ea,0x9e,0x73,0x0b,0x2d,0x9b,0x71,0xb1,0xca);")
812 cpp_quote("DEFINE_GUID(CLSID_WICGifDecoder, 0x381dda3c,0x9ce9,0x4834,0xa2,0x3e,0x1f,0x98,0xf8,0xfc,0x52,0xbe);")
813 cpp_quote("DEFINE_GUID(CLSID_WICTiffDecoder, 0xb54e85d9,0xfe23,0x499f,0x8b,0x88,0x6a,0xce,0xa7,0x13,0x75,0x2b);")
814 cpp_quote("DEFINE_GUID(CLSID_WICWmpDecoder, 0xa26cec36,0x234c,0x4950,0xae,0x16,0xe3,0x4a,0xac,0xe7,0x1d,0x0d);")
815
816 cpp_quote("DEFINE_GUID(CLSID_WICBmpEncoder, 0x69be8bb4,0xd66d,0x47c8,0x86,0x5a,0xed,0x15,0x89,0x43,0x37,0x82);")
817 cpp_quote("DEFINE_GUID(CLSID_WICPngEncoder, 0x27949969,0x876a,0x41d7,0x94,0x47,0x56,0x8f,0x6a,0x35,0xa4,0xdc);")
818 cpp_quote("DEFINE_GUID(CLSID_WICJpegEncoder, 0x1a34f5c1,0x4a5a,0x46dc,0xb6,0x44,0x1f,0x45,0x67,0xe7,0xa6,0x76);")
819 cpp_quote("DEFINE_GUID(CLSID_WICGifEncoder, 0x114f5598,0x0b22,0x40a0,0x86,0xa1,0xc8,0x3e,0xa4,0x95,0xad,0xbd);")
820 cpp_quote("DEFINE_GUID(CLSID_WICTiffEncoder, 0x0131be10,0x2001,0x4c5f,0xa9,0xb0,0xcc,0x88,0xfa,0xb6,0x4c,0xe8);")
821 cpp_quote("DEFINE_GUID(CLSID_WICWmpEncoder, 0xac4ce3cb,0xe1c1,0x44cd,0x82,0x15,0x5a,0x16,0x65,0x50,0x9e,0xc2);")
822
823 cpp_quote("DEFINE_GUID(CLSID_WICDefaultFormatConverter, 0x1a3f11dc,0xb514,0x4b17,0x8c,0x5f,0x21,0x54,0x51,0x38,0x52,0xf1);")
824
825 cpp_quote("DEFINE_GUID(GUID_ContainerFormatBmp, 0x0af1d87e,0xfcfe,0x4188,0xbd,0xeb,0xa7,0x90,0x64,0x71,0xcb,0xe3);")
826 cpp_quote("DEFINE_GUID(GUID_ContainerFormatPng, 0x1b7cfaf4,0x713f,0x473c,0xbb,0xcd,0x61,0x37,0x42,0x5f,0xae,0xaf);")
827 cpp_quote("DEFINE_GUID(GUID_ContainerFormatIco, 0xa3a860c4,0x338f,0x4c17,0x91,0x9a,0xfb,0xa4,0xb5,0x62,0x8f,0x21);")
828 cpp_quote("DEFINE_GUID(GUID_ContainerFormatJpeg, 0x19e4a5aa,0x5662,0x4fc5,0xa0,0xc0,0x17,0x58,0x02,0x8e,0x10,0x57);")
829 cpp_quote("DEFINE_GUID(GUID_ContainerFormatTiff, 0x163bcc30,0xe2e9,0x4f0b,0x96,0x1d,0xa3,0xe9,0xfd,0xb7,0x88,0xa3);")
830 cpp_quote("DEFINE_GUID(GUID_ContainerFormatGif, 0x1f8a5601,0x7d4d,0x4cbd,0x9c,0x82,0x1b,0xc8,0xd4,0xee,0xb9,0xa5);")
831 cpp_quote("DEFINE_GUID(GUID_ContainerFormatWmp, 0x57a37caa,0x367a,0x4540,0x91,0x6b,0xf1,0x83,0xc5,0x09,0x3a,0x4b);")
832
833 cpp_quote("DEFINE_GUID(GUID_VendorMicrosoft, 0xf0e749ca,0xedef,0x4589,0xa7,0x3a,0xee,0x0e,0x62,0x6a,0x2a,0x2b);")
834
835 cpp_quote("DEFINE_GUID(CATID_WICBitmapDecoders, 0x7ed96837,0x96f0,0x4812,0xb2,0x11,0xf1,0x3c,0x24,0x11,0x7e,0xd3);")
836 cpp_quote("DEFINE_GUID(CATID_WICBitmapEncoders, 0xac757296,0x3522,0x4e11,0x98,0x62,0xc1,0x7b,0xe5,0xa1,0x76,0x7e);")
837 cpp_quote("DEFINE_GUID(CATID_WICFormatConverters, 0x7835eae8,0xbf14,0x49d1,0x93,0xce,0x53,0x3a,0x40,0x7b,0x22,0x48);")