2 * Copyright 2009 Vincent Povirk for CodeWeavers
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.
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.
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
19 #define WIN32_NO_STATUS
21 #define COM_NO_WINDOWS_H
33 //#include "shellapi.h"
34 //#include "wincodec.h"
35 #include <wincodecsdk.h>
37 #include "wincodecs_private.h"
39 #include <wine/debug.h>
41 WINE_DEFAULT_DEBUG_CHANNEL(wincodecs
);
44 IWICComponentFactory IWICComponentFactory_iface
;
48 static inline ComponentFactory
*impl_from_IWICComponentFactory(IWICComponentFactory
*iface
)
50 return CONTAINING_RECORD(iface
, ComponentFactory
, IWICComponentFactory_iface
);
53 static HRESULT WINAPI
ComponentFactory_QueryInterface(IWICComponentFactory
*iface
, REFIID iid
,
56 ComponentFactory
*This
= impl_from_IWICComponentFactory(iface
);
57 TRACE("(%p,%s,%p)\n", iface
, debugstr_guid(iid
), ppv
);
59 if (!ppv
) return E_INVALIDARG
;
61 if (IsEqualIID(&IID_IUnknown
, iid
) ||
62 IsEqualIID(&IID_IWICImagingFactory
, iid
) ||
63 IsEqualIID(&IID_IWICComponentFactory
, iid
))
65 *ppv
= &This
->IWICComponentFactory_iface
;
73 IUnknown_AddRef((IUnknown
*)*ppv
);
77 static ULONG WINAPI
ComponentFactory_AddRef(IWICComponentFactory
*iface
)
79 ComponentFactory
*This
= impl_from_IWICComponentFactory(iface
);
80 ULONG ref
= InterlockedIncrement(&This
->ref
);
82 TRACE("(%p) refcount=%u\n", iface
, ref
);
87 static ULONG WINAPI
ComponentFactory_Release(IWICComponentFactory
*iface
)
89 ComponentFactory
*This
= impl_from_IWICComponentFactory(iface
);
90 ULONG ref
= InterlockedDecrement(&This
->ref
);
92 TRACE("(%p) refcount=%u\n", iface
, ref
);
95 HeapFree(GetProcessHeap(), 0, This
);
100 static HRESULT WINAPI
ComponentFactory_CreateDecoderFromFilename(
101 IWICComponentFactory
*iface
, LPCWSTR wzFilename
, const GUID
*pguidVendor
,
102 DWORD dwDesiredAccess
, WICDecodeOptions metadataOptions
,
103 IWICBitmapDecoder
**ppIDecoder
)
108 TRACE("(%p,%s,%s,%u,%u,%p)\n", iface
, debugstr_w(wzFilename
),
109 debugstr_guid(pguidVendor
), dwDesiredAccess
, metadataOptions
, ppIDecoder
);
111 hr
= StreamImpl_Create(&stream
);
114 hr
= IWICStream_InitializeFromFilename(stream
, wzFilename
, dwDesiredAccess
);
118 hr
= IWICComponentFactory_CreateDecoderFromStream(iface
, (IStream
*)stream
,
119 pguidVendor
, metadataOptions
, ppIDecoder
);
122 IWICStream_Release(stream
);
128 static IWICBitmapDecoder
*find_decoder(IStream
*pIStream
, const GUID
*pguidVendor
,
129 WICDecodeOptions metadataOptions
)
131 IEnumUnknown
*enumdecoders
;
132 IUnknown
*unkdecoderinfo
;
133 IWICBitmapDecoderInfo
*decoderinfo
;
134 IWICBitmapDecoder
*decoder
= NULL
;
140 res
= CreateComponentEnumerator(WICDecoder
, WICComponentEnumerateDefault
, &enumdecoders
);
141 if (FAILED(res
)) return NULL
;
145 res
= IEnumUnknown_Next(enumdecoders
, 1, &unkdecoderinfo
, &num_fetched
);
149 res
= IUnknown_QueryInterface(unkdecoderinfo
, &IID_IWICBitmapDecoderInfo
, (void**)&decoderinfo
);
155 res
= IWICBitmapDecoderInfo_GetVendorGUID(decoderinfo
, &vendor
);
156 if (FAILED(res
) || !IsEqualIID(&vendor
, pguidVendor
))
158 IWICBitmapDecoderInfo_Release(decoderinfo
);
159 IUnknown_Release(unkdecoderinfo
);
164 res
= IWICBitmapDecoderInfo_MatchesPattern(decoderinfo
, pIStream
, &matches
);
166 if (SUCCEEDED(res
) && matches
)
168 res
= IWICBitmapDecoderInfo_CreateInstance(decoderinfo
, &decoder
);
170 /* FIXME: should use QueryCapability to choose a decoder */
174 res
= IWICBitmapDecoder_Initialize(decoder
, pIStream
, metadataOptions
);
178 IWICBitmapDecoder_Release(decoder
);
184 IWICBitmapDecoderInfo_Release(decoderinfo
);
187 IUnknown_Release(unkdecoderinfo
);
193 IEnumUnknown_Release(enumdecoders
);
198 static HRESULT WINAPI
ComponentFactory_CreateDecoderFromStream(
199 IWICComponentFactory
*iface
, IStream
*pIStream
, const GUID
*pguidVendor
,
200 WICDecodeOptions metadataOptions
, IWICBitmapDecoder
**ppIDecoder
)
203 IWICBitmapDecoder
*decoder
= NULL
;
205 TRACE("(%p,%p,%s,%u,%p)\n", iface
, pIStream
, debugstr_guid(pguidVendor
),
206 metadataOptions
, ppIDecoder
);
209 decoder
= find_decoder(pIStream
, pguidVendor
, metadataOptions
);
211 decoder
= find_decoder(pIStream
, NULL
, metadataOptions
);
215 *ppIDecoder
= decoder
;
220 if (WARN_ON(wincodecs
))
226 WARN("failed to load from a stream\n");
229 res
= IStream_Seek(pIStream
, seek
, STREAM_SEEK_SET
, NULL
);
231 res
= IStream_Read(pIStream
, data
, 4, &bytesread
);
233 WARN("first %i bytes of stream=%x %x %x %x\n", bytesread
, data
[0], data
[1], data
[2], data
[3]);
236 return WINCODEC_ERR_COMPONENTNOTFOUND
;
240 static HRESULT WINAPI
ComponentFactory_CreateDecoderFromFileHandle(
241 IWICComponentFactory
*iface
, ULONG_PTR hFile
, const GUID
*pguidVendor
,
242 WICDecodeOptions metadataOptions
, IWICBitmapDecoder
**ppIDecoder
)
244 FIXME("(%p,%lx,%s,%u,%p): stub\n", iface
, hFile
, debugstr_guid(pguidVendor
),
245 metadataOptions
, ppIDecoder
);
249 static HRESULT WINAPI
ComponentFactory_CreateComponentInfo(IWICComponentFactory
*iface
,
250 REFCLSID clsidComponent
, IWICComponentInfo
**ppIInfo
)
252 TRACE("(%p,%s,%p)\n", iface
, debugstr_guid(clsidComponent
), ppIInfo
);
253 return CreateComponentInfo(clsidComponent
, ppIInfo
);
256 static HRESULT WINAPI
ComponentFactory_CreateDecoder(IWICComponentFactory
*iface
,
257 REFGUID guidContainerFormat
, const GUID
*pguidVendor
,
258 IWICBitmapDecoder
**ppIDecoder
)
260 IEnumUnknown
*enumdecoders
;
261 IUnknown
*unkdecoderinfo
;
262 IWICBitmapDecoderInfo
*decoderinfo
;
263 IWICBitmapDecoder
*decoder
= NULL
, *preferred_decoder
= NULL
;
268 TRACE("(%p,%s,%s,%p)\n", iface
, debugstr_guid(guidContainerFormat
),
269 debugstr_guid(pguidVendor
), ppIDecoder
);
271 if (!guidContainerFormat
|| !ppIDecoder
) return E_INVALIDARG
;
273 res
= CreateComponentEnumerator(WICDecoder
, WICComponentEnumerateDefault
, &enumdecoders
);
274 if (FAILED(res
)) return res
;
276 while (!preferred_decoder
)
278 res
= IEnumUnknown_Next(enumdecoders
, 1, &unkdecoderinfo
, &num_fetched
);
279 if (res
!= S_OK
) break;
281 res
= IUnknown_QueryInterface(unkdecoderinfo
, &IID_IWICBitmapDecoderInfo
, (void **)&decoderinfo
);
286 res
= IWICBitmapDecoderInfo_GetContainerFormat(decoderinfo
, &container_guid
);
287 if (SUCCEEDED(res
) && IsEqualIID(&container_guid
, guidContainerFormat
))
289 IWICBitmapDecoder
*new_decoder
;
291 res
= IWICBitmapDecoderInfo_CreateInstance(decoderinfo
, &new_decoder
);
296 res
= IWICBitmapDecoderInfo_GetVendorGUID(decoderinfo
, &vendor
);
297 if (SUCCEEDED(res
) && IsEqualIID(&vendor
, pguidVendor
))
299 preferred_decoder
= new_decoder
;
304 if (new_decoder
&& !decoder
)
306 decoder
= new_decoder
;
310 if (new_decoder
) IWICBitmapDecoder_Release(new_decoder
);
314 IWICBitmapDecoderInfo_Release(decoderinfo
);
317 IUnknown_Release(unkdecoderinfo
);
320 IEnumUnknown_Release(enumdecoders
);
322 if (preferred_decoder
)
324 *ppIDecoder
= preferred_decoder
;
325 if (decoder
) IWICBitmapDecoder_Release(decoder
);
331 *ppIDecoder
= decoder
;
336 return WINCODEC_ERR_COMPONENTNOTFOUND
;
339 static HRESULT WINAPI
ComponentFactory_CreateEncoder(IWICComponentFactory
*iface
,
340 REFGUID guidContainerFormat
, const GUID
*pguidVendor
,
341 IWICBitmapEncoder
**ppIEncoder
)
344 IEnumUnknown
*enumencoders
;
345 IUnknown
*unkencoderinfo
;
346 IWICBitmapEncoderInfo
*encoderinfo
;
347 IWICBitmapEncoder
*encoder
=NULL
;
350 GUID actual_containerformat
;
352 TRACE("(%p,%s,%s,%p)\n", iface
, debugstr_guid(guidContainerFormat
),
353 debugstr_guid(pguidVendor
), ppIEncoder
);
355 if (pguidVendor
&& !fixme
++)
356 FIXME("ignoring vendor GUID\n");
358 res
= CreateComponentEnumerator(WICEncoder
, WICComponentEnumerateDefault
, &enumencoders
);
359 if (FAILED(res
)) return res
;
363 res
= IEnumUnknown_Next(enumencoders
, 1, &unkencoderinfo
, &num_fetched
);
367 res
= IUnknown_QueryInterface(unkencoderinfo
, &IID_IWICBitmapEncoderInfo
, (void**)&encoderinfo
);
371 res
= IWICBitmapEncoderInfo_GetContainerFormat(encoderinfo
, &actual_containerformat
);
373 if (SUCCEEDED(res
) && IsEqualGUID(guidContainerFormat
, &actual_containerformat
))
375 res
= IWICBitmapEncoderInfo_CreateInstance(encoderinfo
, &encoder
);
380 IWICBitmapEncoderInfo_Release(encoderinfo
);
383 IUnknown_Release(unkencoderinfo
);
389 IEnumUnknown_Release(enumencoders
);
393 *ppIEncoder
= encoder
;
398 WARN("failed to create encoder\n");
400 return WINCODEC_ERR_COMPONENTNOTFOUND
;
404 static HRESULT WINAPI
ComponentFactory_CreatePalette(IWICComponentFactory
*iface
,
405 IWICPalette
**ppIPalette
)
407 TRACE("(%p,%p)\n", iface
, ppIPalette
);
408 return PaletteImpl_Create(ppIPalette
);
411 static HRESULT WINAPI
ComponentFactory_CreateFormatConverter(IWICComponentFactory
*iface
,
412 IWICFormatConverter
**ppIFormatConverter
)
414 return FormatConverter_CreateInstance(NULL
, &IID_IWICFormatConverter
, (void**)ppIFormatConverter
);
417 static HRESULT WINAPI
ComponentFactory_CreateBitmapScaler(IWICComponentFactory
*iface
,
418 IWICBitmapScaler
**ppIBitmapScaler
)
420 TRACE("(%p,%p)\n", iface
, ppIBitmapScaler
);
422 return BitmapScaler_Create(ppIBitmapScaler
);
425 static HRESULT WINAPI
ComponentFactory_CreateBitmapClipper(IWICComponentFactory
*iface
,
426 IWICBitmapClipper
**ppIBitmapClipper
)
428 FIXME("(%p,%p): stub\n", iface
, ppIBitmapClipper
);
432 static HRESULT WINAPI
ComponentFactory_CreateBitmapFlipRotator(IWICComponentFactory
*iface
,
433 IWICBitmapFlipRotator
**ppIBitmapFlipRotator
)
435 TRACE("(%p,%p)\n", iface
, ppIBitmapFlipRotator
);
436 return FlipRotator_Create(ppIBitmapFlipRotator
);
439 static HRESULT WINAPI
ComponentFactory_CreateStream(IWICComponentFactory
*iface
,
440 IWICStream
**ppIWICStream
)
442 TRACE("(%p,%p)\n", iface
, ppIWICStream
);
443 return StreamImpl_Create(ppIWICStream
);
446 static HRESULT WINAPI
ComponentFactory_CreateColorContext(IWICComponentFactory
*iface
,
447 IWICColorContext
**ppIColorContext
)
449 TRACE("(%p,%p)\n", iface
, ppIColorContext
);
450 return ColorContext_Create(ppIColorContext
);
453 static HRESULT WINAPI
ComponentFactory_CreateColorTransformer(IWICComponentFactory
*iface
,
454 IWICColorTransform
**ppIColorTransform
)
456 FIXME("(%p,%p): stub\n", iface
, ppIColorTransform
);
460 static HRESULT WINAPI
ComponentFactory_CreateBitmap(IWICComponentFactory
*iface
,
461 UINT uiWidth
, UINT uiHeight
, REFWICPixelFormatGUID pixelFormat
,
462 WICBitmapCreateCacheOption option
, IWICBitmap
**ppIBitmap
)
464 TRACE("(%p,%u,%u,%s,%u,%p)\n", iface
, uiWidth
, uiHeight
,
465 debugstr_guid(pixelFormat
), option
, ppIBitmap
);
466 return BitmapImpl_Create(uiWidth
, uiHeight
, pixelFormat
, option
, ppIBitmap
);
469 static HRESULT WINAPI
ComponentFactory_CreateBitmapFromSource(IWICComponentFactory
*iface
,
470 IWICBitmapSource
*piBitmapSource
, WICBitmapCreateCacheOption option
,
471 IWICBitmap
**ppIBitmap
)
474 IWICBitmapLock
*lock
;
475 IWICPalette
*palette
;
477 WICPixelFormatGUID pixelformat
= {0};
481 IWICComponentInfo
*info
;
482 IWICPixelFormatInfo2
*formatinfo
;
483 WICPixelFormatNumericRepresentation format_type
;
485 TRACE("(%p,%p,%u,%p)\n", iface
, piBitmapSource
, option
, ppIBitmap
);
487 if (!piBitmapSource
|| !ppIBitmap
)
490 hr
= IWICBitmapSource_GetSize(piBitmapSource
, &width
, &height
);
493 hr
= IWICBitmapSource_GetPixelFormat(piBitmapSource
, &pixelformat
);
496 hr
= CreateComponentInfo(&pixelformat
, &info
);
500 hr
= IWICComponentInfo_QueryInterface(info
, &IID_IWICPixelFormatInfo2
, (void**)&formatinfo
);
504 hr
= IWICPixelFormatInfo2_GetNumericRepresentation(formatinfo
, &format_type
);
506 IWICPixelFormatInfo2_Release(formatinfo
);
509 IWICComponentInfo_Release(info
);
513 hr
= BitmapImpl_Create(width
, height
, &pixelformat
, option
, &result
);
517 hr
= IWICBitmap_Lock(result
, NULL
, WICBitmapLockWrite
, &lock
);
520 UINT stride
, buffersize
;
526 hr
= IWICBitmapLock_GetStride(lock
, &stride
);
529 hr
= IWICBitmapLock_GetDataPointer(lock
, &buffersize
, &buffer
);
532 hr
= IWICBitmapSource_CopyPixels(piBitmapSource
, &rc
, stride
,
535 IWICBitmapLock_Release(lock
);
539 hr
= PaletteImpl_Create(&palette
);
541 if (SUCCEEDED(hr
) && (format_type
== WICPixelFormatNumericRepresentationUnspecified
||
542 format_type
== WICPixelFormatNumericRepresentationIndexed
))
544 hr
= IWICBitmapSource_CopyPalette(piBitmapSource
, palette
);
547 hr
= IWICBitmap_SetPalette(result
, palette
);
551 IWICPalette_Release(palette
);
556 hr
= IWICBitmapSource_GetResolution(piBitmapSource
, &dpix
, &dpiy
);
559 hr
= IWICBitmap_SetResolution(result
, dpix
, dpiy
);
567 IWICBitmap_Release(result
);
573 static HRESULT WINAPI
ComponentFactory_CreateBitmapFromSourceRect(IWICComponentFactory
*iface
,
574 IWICBitmapSource
*piBitmapSource
, UINT x
, UINT y
, UINT width
, UINT height
,
575 IWICBitmap
**ppIBitmap
)
577 FIXME("(%p,%p,%u,%u,%u,%u,%p): stub\n", iface
, piBitmapSource
, x
, y
, width
,
582 static HRESULT WINAPI
ComponentFactory_CreateBitmapFromMemory(IWICComponentFactory
*iface
,
583 UINT uiWidth
, UINT uiHeight
, REFWICPixelFormatGUID pixelFormat
, UINT cbStride
,
584 UINT cbBufferSize
, BYTE
*pbBuffer
, IWICBitmap
**ppIBitmap
)
586 FIXME("(%p,%u,%u,%s,%u,%u,%p,%p): stub\n", iface
, uiWidth
, uiHeight
,
587 debugstr_guid(pixelFormat
), cbStride
, cbBufferSize
, pbBuffer
, ppIBitmap
);
591 static HRESULT WINAPI
ComponentFactory_CreateBitmapFromHBITMAP(IWICComponentFactory
*iface
,
592 HBITMAP hBitmap
, HPALETTE hPalette
, WICBitmapAlphaChannelOption options
,
593 IWICBitmap
**ppIBitmap
)
595 FIXME("(%p,%p,%p,%u,%p): stub\n", iface
, hBitmap
, hPalette
, options
, ppIBitmap
);
599 static HRESULT WINAPI
ComponentFactory_CreateBitmapFromHICON(IWICComponentFactory
*iface
,
600 HICON hIcon
, IWICBitmap
**ppIBitmap
)
602 FIXME("(%p,%p,%p): stub\n", iface
, hIcon
, ppIBitmap
);
606 static HRESULT WINAPI
ComponentFactory_CreateComponentEnumerator(IWICComponentFactory
*iface
,
607 DWORD componentTypes
, DWORD options
, IEnumUnknown
**ppIEnumUnknown
)
609 TRACE("(%p,%u,%u,%p)\n", iface
, componentTypes
, options
, ppIEnumUnknown
);
610 return CreateComponentEnumerator(componentTypes
, options
, ppIEnumUnknown
);
613 static HRESULT WINAPI
ComponentFactory_CreateFastMetadataEncoderFromDecoder(
614 IWICComponentFactory
*iface
, IWICBitmapDecoder
*pIDecoder
,
615 IWICFastMetadataEncoder
**ppIFastEncoder
)
617 FIXME("(%p,%p,%p): stub\n", iface
, pIDecoder
, ppIFastEncoder
);
621 static HRESULT WINAPI
ComponentFactory_CreateFastMetadataEncoderFromFrameDecode(
622 IWICComponentFactory
*iface
, IWICBitmapFrameDecode
*pIFrameDecoder
,
623 IWICFastMetadataEncoder
**ppIFastEncoder
)
625 FIXME("(%p,%p,%p): stub\n", iface
, pIFrameDecoder
, ppIFastEncoder
);
629 static HRESULT WINAPI
ComponentFactory_CreateQueryWriter(IWICComponentFactory
*iface
,
630 REFGUID guidMetadataFormat
, const GUID
*pguidVendor
,
631 IWICMetadataQueryWriter
**ppIQueryWriter
)
633 FIXME("(%p,%s,%s,%p): stub\n", iface
, debugstr_guid(guidMetadataFormat
),
634 debugstr_guid(pguidVendor
), ppIQueryWriter
);
638 static HRESULT WINAPI
ComponentFactory_CreateQueryWriterFromReader(IWICComponentFactory
*iface
,
639 IWICMetadataQueryReader
*pIQueryReader
, const GUID
*pguidVendor
,
640 IWICMetadataQueryWriter
**ppIQueryWriter
)
642 FIXME("(%p,%p,%s,%p): stub\n", iface
, pIQueryReader
, debugstr_guid(pguidVendor
),
647 static HRESULT WINAPI
ComponentFactory_CreateMetadataReader(IWICComponentFactory
*iface
,
648 REFGUID format
, const GUID
*vendor
, DWORD options
, IStream
*stream
, IWICMetadataReader
**reader
)
650 FIXME("%p,%s,%s,%x,%p,%p: stub\n", iface
, debugstr_guid(format
), debugstr_guid(vendor
),
651 options
, stream
, reader
);
655 static HRESULT WINAPI
ComponentFactory_CreateMetadataReaderFromContainer(IWICComponentFactory
*iface
,
656 REFGUID format
, const GUID
*vendor
, DWORD options
, IStream
*stream
, IWICMetadataReader
**reader
)
658 FIXME("%p,%s,%s,%x,%p,%p: stub\n", iface
, debugstr_guid(format
), debugstr_guid(vendor
),
659 options
, stream
, reader
);
663 static HRESULT WINAPI
ComponentFactory_CreateMetadataWriter(IWICComponentFactory
*iface
,
664 REFGUID format
, const GUID
*vendor
, DWORD options
, IWICMetadataWriter
**writer
)
666 FIXME("%p,%s,%s,%x,%p: stub\n", iface
, debugstr_guid(format
), debugstr_guid(vendor
), options
, writer
);
670 static HRESULT WINAPI
ComponentFactory_CreateMetadataWriterFromReader(IWICComponentFactory
*iface
,
671 IWICMetadataReader
*reader
, const GUID
*vendor
, IWICMetadataWriter
**writer
)
673 FIXME("%p,%p,%s,%p: stub\n", iface
, reader
, debugstr_guid(vendor
), writer
);
677 static HRESULT WINAPI
ComponentFactory_CreateQueryReaderFromBlockReader(IWICComponentFactory
*iface
,
678 IWICMetadataBlockReader
*block_reader
, IWICMetadataQueryReader
**query_reader
)
680 FIXME("%p,%p,%p: stub\n", iface
, block_reader
, query_reader
);
684 static HRESULT WINAPI
ComponentFactory_CreateQueryWriterFromBlockWriter(IWICComponentFactory
*iface
,
685 IWICMetadataBlockWriter
*block_writer
, IWICMetadataQueryWriter
**query_writer
)
687 FIXME("%p,%p,%p: stub\n", iface
, block_writer
, query_writer
);
691 static HRESULT WINAPI
ComponentFactory_CreateEncoderPropertyBag(IWICComponentFactory
*iface
,
692 PROPBAG2
*options
, UINT count
, IPropertyBag2
**property
)
694 FIXME("%p,%p,%u,%p: stub\n", iface
, options
, count
, property
);
698 static const IWICComponentFactoryVtbl ComponentFactory_Vtbl
= {
699 ComponentFactory_QueryInterface
,
700 ComponentFactory_AddRef
,
701 ComponentFactory_Release
,
702 ComponentFactory_CreateDecoderFromFilename
,
703 ComponentFactory_CreateDecoderFromStream
,
704 ComponentFactory_CreateDecoderFromFileHandle
,
705 ComponentFactory_CreateComponentInfo
,
706 ComponentFactory_CreateDecoder
,
707 ComponentFactory_CreateEncoder
,
708 ComponentFactory_CreatePalette
,
709 ComponentFactory_CreateFormatConverter
,
710 ComponentFactory_CreateBitmapScaler
,
711 ComponentFactory_CreateBitmapClipper
,
712 ComponentFactory_CreateBitmapFlipRotator
,
713 ComponentFactory_CreateStream
,
714 ComponentFactory_CreateColorContext
,
715 ComponentFactory_CreateColorTransformer
,
716 ComponentFactory_CreateBitmap
,
717 ComponentFactory_CreateBitmapFromSource
,
718 ComponentFactory_CreateBitmapFromSourceRect
,
719 ComponentFactory_CreateBitmapFromMemory
,
720 ComponentFactory_CreateBitmapFromHBITMAP
,
721 ComponentFactory_CreateBitmapFromHICON
,
722 ComponentFactory_CreateComponentEnumerator
,
723 ComponentFactory_CreateFastMetadataEncoderFromDecoder
,
724 ComponentFactory_CreateFastMetadataEncoderFromFrameDecode
,
725 ComponentFactory_CreateQueryWriter
,
726 ComponentFactory_CreateQueryWriterFromReader
,
727 ComponentFactory_CreateMetadataReader
,
728 ComponentFactory_CreateMetadataReaderFromContainer
,
729 ComponentFactory_CreateMetadataWriter
,
730 ComponentFactory_CreateMetadataWriterFromReader
,
731 ComponentFactory_CreateQueryReaderFromBlockReader
,
732 ComponentFactory_CreateQueryWriterFromBlockWriter
,
733 ComponentFactory_CreateEncoderPropertyBag
736 HRESULT
ComponentFactory_CreateInstance(IUnknown
*pUnkOuter
, REFIID iid
, void** ppv
)
738 ComponentFactory
*This
;
741 TRACE("(%p,%s,%p)\n", pUnkOuter
, debugstr_guid(iid
), ppv
);
745 if (pUnkOuter
) return CLASS_E_NOAGGREGATION
;
747 This
= HeapAlloc(GetProcessHeap(), 0, sizeof(ComponentFactory
));
748 if (!This
) return E_OUTOFMEMORY
;
750 This
->IWICComponentFactory_iface
.lpVtbl
= &ComponentFactory_Vtbl
;
753 ret
= IWICComponentFactory_QueryInterface(&This
->IWICComponentFactory_iface
, iid
, ppv
);
754 IWICComponentFactory_Release(&This
->IWICComponentFactory_iface
);