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