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