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