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