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