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