ReactOS 0.4.16-dev-974-g5022a45
imgfactory.c
Go to the documentation of this file.
1/*
2 * Copyright 2009 Vincent Povirk for CodeWeavers
3 * Copyright 2012 Dmitry Timoshkov
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#include <assert.h>
21#include <stdarg.h>
22
23#define COBJMACROS
24
25#include "windef.h"
26#include "winbase.h"
27#include "winreg.h"
28#include "objbase.h"
29#include "shellapi.h"
30
31#include "wincodecs_private.h"
32
33#include "wine/debug.h"
34
36
37typedef struct {
42
44{
45 return CONTAINING_RECORD(iface, ImagingFactory, IWICComponentFactory_iface);
46}
47
49{
50 return CONTAINING_RECORD(iface, ImagingFactory, IWICImagingFactory2_iface);
51}
52
54 void **ppv)
55{
57 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
58
59 if (!ppv) return E_INVALIDARG;
60
61 if (IsEqualIID(&IID_IUnknown, iid) ||
62 IsEqualIID(&IID_IWICImagingFactory, iid) ||
63 IsEqualIID(&IID_IWICComponentFactory, iid))
64 {
65 *ppv = &This->IWICComponentFactory_iface;
66 }
67 else if (IsEqualIID(&IID_IWICImagingFactory2, iid))
68 {
69 *ppv = &This->IWICImagingFactory2_iface;
70 }
71 else
72 {
73 *ppv = NULL;
74 return E_NOINTERFACE;
75 }
76
77 IUnknown_AddRef((IUnknown*)*ppv);
78 return S_OK;
79}
80
82{
85
86 TRACE("(%p) refcount=%lu\n", iface, ref);
87
88 return ref;
89}
90
92{
95
96 TRACE("(%p) refcount=%lu\n", iface, ref);
97
98 if (ref == 0)
99 free(This);
100
101 return ref;
102}
103
105 IWICImagingFactory2 *iface, LPCWSTR wzFilename, const GUID *pguidVendor,
106 DWORD dwDesiredAccess, WICDecodeOptions metadataOptions,
107 IWICBitmapDecoder **ppIDecoder)
108{
110 HRESULT hr;
111
112 TRACE("(%p,%s,%s,%lu,%u,%p)\n", iface, debugstr_w(wzFilename),
113 debugstr_guid(pguidVendor), dwDesiredAccess, metadataOptions, ppIDecoder);
114
116 if (SUCCEEDED(hr))
117 {
118 hr = IWICStream_InitializeFromFilename(stream, wzFilename, dwDesiredAccess);
119
120 if (SUCCEEDED(hr))
121 {
122 hr = IWICImagingFactory2_CreateDecoderFromStream(iface, (IStream*)stream,
123 pguidVendor, metadataOptions, ppIDecoder);
124 }
125
126 IWICStream_Release(stream);
127 }
128
129 return hr;
130}
131
132static HRESULT find_decoder(IStream *pIStream, const GUID *pguidVendor,
133 WICDecodeOptions metadataOptions, IWICBitmapDecoder **decoder)
134{
135 IEnumUnknown *enumdecoders = NULL;
136 IUnknown *unkdecoderinfo = NULL;
137 GUID vendor;
138 HRESULT res, res_wine;
139 ULONG num_fetched;
140 BOOL matches, found;
141
142 *decoder = NULL;
143
145 if (FAILED(res)) return res;
146
147 found = FALSE;
148 while (IEnumUnknown_Next(enumdecoders, 1, &unkdecoderinfo, &num_fetched) == S_OK)
149 {
150 IWICBitmapDecoderInfo *decoderinfo = NULL;
151 IWICWineDecoder *wine_decoder = NULL;
152
153 res = IUnknown_QueryInterface(unkdecoderinfo, &IID_IWICBitmapDecoderInfo, (void**)&decoderinfo);
154 if (FAILED(res)) goto next;
155
156 if (pguidVendor)
157 {
158 res = IWICBitmapDecoderInfo_GetVendorGUID(decoderinfo, &vendor);
159 if (FAILED(res) || !IsEqualIID(&vendor, pguidVendor)) goto next;
160 }
161
162 res = IWICBitmapDecoderInfo_MatchesPattern(decoderinfo, pIStream, &matches);
163 if (FAILED(res) || !matches) goto next;
164
165 res = IWICBitmapDecoderInfo_CreateInstance(decoderinfo, decoder);
166 if (FAILED(res)) goto next;
167
168 /* FIXME: should use QueryCapability to choose a decoder */
169
170 found = TRUE;
171 res = IWICBitmapDecoder_Initialize(*decoder, pIStream, metadataOptions);
172 if (FAILED(res))
173 {
174 res_wine = IWICBitmapDecoder_QueryInterface(*decoder, &IID_IWICWineDecoder, (void **)&wine_decoder);
175 if (FAILED(res_wine))
176 {
177 IWICBitmapDecoder_Release(*decoder);
178 *decoder = NULL;
179 goto next;
180 }
181
182 res_wine = IWICWineDecoder_Initialize(wine_decoder, pIStream, metadataOptions);
183 if (FAILED(res_wine))
184 {
185 IWICBitmapDecoder_Release(*decoder);
186 *decoder = NULL;
187 goto next;
188 }
189
190 res = res_wine;
191 }
192
193 next:
194 if (wine_decoder) IWICWineDecoder_Release(wine_decoder);
195 if (decoderinfo) IWICBitmapDecoderInfo_Release(decoderinfo);
196 IUnknown_Release(unkdecoderinfo);
197 if (found) break;
198 }
199
200 IEnumUnknown_Release(enumdecoders);
202 return res;
203}
204
206 IWICImagingFactory2 *iface, IStream *pIStream, const GUID *pguidVendor,
207 WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder)
208{
209 HRESULT res;
211
212 TRACE("(%p,%p,%s,%u,%p)\n", iface, pIStream, debugstr_guid(pguidVendor),
213 metadataOptions, ppIDecoder);
214
215 if (pguidVendor)
216 res = find_decoder(pIStream, pguidVendor, metadataOptions, &decoder);
217 if (!decoder)
218 res = find_decoder(pIStream, NULL, metadataOptions, &decoder);
219
220 if (decoder)
221 {
222 *ppIDecoder = decoder;
223 return S_OK;
224 }
225 else
226 {
227 if (WARN_ON(wincodecs))
228 {
230 BYTE data[4];
231 ULONG bytesread;
232
233 WARN("failed to load from a stream %#lx\n", res);
234
235 seek.QuadPart = 0;
236 if (IStream_Seek(pIStream, seek, STREAM_SEEK_SET, NULL) == S_OK)
237 {
238 if (IStream_Read(pIStream, data, 4, &bytesread) == S_OK)
239 WARN("first %li bytes of stream=%x %x %x %x\n", bytesread, data[0], data[1], data[2], data[3]);
240 }
241 }
242 *ppIDecoder = NULL;
243 return res;
244 }
245}
246
248 IWICImagingFactory2 *iface, ULONG_PTR hFile, const GUID *pguidVendor,
249 WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder)
250{
252 HRESULT hr;
253
254 TRACE("(%p,%Ix,%s,%u,%p)\n", iface, hFile, debugstr_guid(pguidVendor),
255 metadataOptions, ppIDecoder);
256
258 if (SUCCEEDED(hr))
259 {
261 if (SUCCEEDED(hr))
262 {
263 hr = IWICImagingFactory2_CreateDecoderFromStream(iface, (IStream*)stream,
264 pguidVendor, metadataOptions, ppIDecoder);
265 }
266 IWICStream_Release(stream);
267 }
268 return hr;
269}
270
272 REFCLSID clsidComponent, IWICComponentInfo **ppIInfo)
273{
274 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(clsidComponent), ppIInfo);
275 return CreateComponentInfo(clsidComponent, ppIInfo);
276}
277
279 REFGUID guidContainerFormat, const GUID *pguidVendor,
280 IWICBitmapDecoder **ppIDecoder)
281{
282 IEnumUnknown *enumdecoders;
283 IUnknown *unkdecoderinfo;
284 IWICBitmapDecoderInfo *decoderinfo;
285 IWICBitmapDecoder *decoder = NULL, *preferred_decoder = NULL;
286 GUID vendor;
287 HRESULT res;
288 ULONG num_fetched;
289
290 TRACE("(%p,%s,%s,%p)\n", iface, debugstr_guid(guidContainerFormat),
291 debugstr_guid(pguidVendor), ppIDecoder);
292
293 if (!guidContainerFormat || !ppIDecoder) return E_INVALIDARG;
294
296 if (FAILED(res)) return res;
297
298 while (!preferred_decoder)
299 {
300 res = IEnumUnknown_Next(enumdecoders, 1, &unkdecoderinfo, &num_fetched);
301 if (res != S_OK) break;
302
303 res = IUnknown_QueryInterface(unkdecoderinfo, &IID_IWICBitmapDecoderInfo, (void **)&decoderinfo);
304 if (SUCCEEDED(res))
305 {
306 GUID container_guid;
307
308 res = IWICBitmapDecoderInfo_GetContainerFormat(decoderinfo, &container_guid);
309 if (SUCCEEDED(res) && IsEqualIID(&container_guid, guidContainerFormat))
310 {
311 IWICBitmapDecoder *new_decoder;
312
313 res = IWICBitmapDecoderInfo_CreateInstance(decoderinfo, &new_decoder);
314 if (SUCCEEDED(res))
315 {
316 if (pguidVendor)
317 {
318 res = IWICBitmapDecoderInfo_GetVendorGUID(decoderinfo, &vendor);
319 if (SUCCEEDED(res) && IsEqualIID(&vendor, pguidVendor))
320 {
321 preferred_decoder = new_decoder;
322 new_decoder = NULL;
323 }
324 }
325
326 if (new_decoder && !decoder)
327 {
328 decoder = new_decoder;
329 new_decoder = NULL;
330 }
331
332 if (new_decoder) IWICBitmapDecoder_Release(new_decoder);
333 }
334 }
335
336 IWICBitmapDecoderInfo_Release(decoderinfo);
337 }
338
339 IUnknown_Release(unkdecoderinfo);
340 }
341
342 IEnumUnknown_Release(enumdecoders);
343
344 if (preferred_decoder)
345 {
346 *ppIDecoder = preferred_decoder;
347 if (decoder) IWICBitmapDecoder_Release(decoder);
348 return S_OK;
349 }
350
351 if (decoder)
352 {
353 *ppIDecoder = decoder;
354 return S_OK;
355 }
356
357 *ppIDecoder = NULL;
359}
360
362 REFGUID guidContainerFormat, const GUID *pguidVendor,
363 IWICBitmapEncoder **ppIEncoder)
364{
365 static int fixme=0;
366 IEnumUnknown *enumencoders;
367 IUnknown *unkencoderinfo;
368 IWICBitmapEncoderInfo *encoderinfo;
371 ULONG num_fetched;
372 GUID actual_containerformat;
373
374 TRACE("(%p,%s,%s,%p)\n", iface, debugstr_guid(guidContainerFormat),
375 debugstr_guid(pguidVendor), ppIEncoder);
376
377 if (pguidVendor && !fixme++)
378 FIXME("ignoring vendor GUID\n");
379
381 if (FAILED(res)) return res;
382
383 while (!encoder)
384 {
385 res = IEnumUnknown_Next(enumencoders, 1, &unkencoderinfo, &num_fetched);
386
387 if (res == S_OK)
388 {
389 res = IUnknown_QueryInterface(unkencoderinfo, &IID_IWICBitmapEncoderInfo, (void**)&encoderinfo);
390
391 if (SUCCEEDED(res))
392 {
393 res = IWICBitmapEncoderInfo_GetContainerFormat(encoderinfo, &actual_containerformat);
394
395 if (SUCCEEDED(res) && IsEqualGUID(guidContainerFormat, &actual_containerformat))
396 {
397 res = IWICBitmapEncoderInfo_CreateInstance(encoderinfo, &encoder);
398 if (FAILED(res))
399 encoder = NULL;
400 }
401
402 IWICBitmapEncoderInfo_Release(encoderinfo);
403 }
404
405 IUnknown_Release(unkencoderinfo);
406 }
407 else
408 break;
409 }
410
411 IEnumUnknown_Release(enumencoders);
412
413 if (encoder)
414 {
415 *ppIEncoder = encoder;
416 return S_OK;
417 }
418 else
419 {
420 WARN("failed to create encoder\n");
421 *ppIEncoder = NULL;
423 }
424}
425
427 IWICPalette **ppIPalette)
428{
429 TRACE("(%p,%p)\n", iface, ppIPalette);
430 return PaletteImpl_Create(ppIPalette);
431}
432
434 IWICFormatConverter **ppIFormatConverter)
435{
436 return FormatConverter_CreateInstance(&IID_IWICFormatConverter, (void**)ppIFormatConverter);
437}
438
440 IWICBitmapScaler **ppIBitmapScaler)
441{
442 TRACE("(%p,%p)\n", iface, ppIBitmapScaler);
443
444 return BitmapScaler_Create(ppIBitmapScaler);
445}
446
448 IWICBitmapClipper **ppIBitmapClipper)
449{
450 TRACE("(%p,%p)\n", iface, ppIBitmapClipper);
451 return BitmapClipper_Create(ppIBitmapClipper);
452}
453
455 IWICBitmapFlipRotator **ppIBitmapFlipRotator)
456{
457 TRACE("(%p,%p)\n", iface, ppIBitmapFlipRotator);
458 return FlipRotator_Create(ppIBitmapFlipRotator);
459}
460
462 IWICStream **ppIWICStream)
463{
464 TRACE("(%p,%p)\n", iface, ppIWICStream);
465 return StreamImpl_Create(ppIWICStream);
466}
467
469 IWICColorContext **ppIColorContext)
470{
471 TRACE("(%p,%p)\n", iface, ppIColorContext);
472 return ColorContext_Create(ppIColorContext);
473}
474
476 IWICColorTransform **ppIColorTransform)
477{
478 TRACE("(%p,%p)\n", iface, ppIColorTransform);
479 return ColorTransform_Create(ppIColorTransform);
480}
481
483 UINT uiWidth, UINT uiHeight, REFWICPixelFormatGUID pixelFormat,
485{
486 TRACE("(%p,%u,%u,%s,%u,%p)\n", iface, uiWidth, uiHeight,
487 debugstr_guid(pixelFormat), option, ppIBitmap);
488 return BitmapImpl_Create(uiWidth, uiHeight, 0, 0, NULL, 0, pixelFormat, option, ppIBitmap);
489}
490
493{
499 HRESULT hr;
500 WICRect rc;
501 double dpix, dpiy;
503 IWICPixelFormatInfo2 *formatinfo;
505
507
508 if (!piBitmapSource || !ppIBitmap)
509 return E_INVALIDARG;
510
511 if (option == WICBitmapNoCache && SUCCEEDED(IWICBitmapSource_QueryInterface(piBitmapSource,
512 &IID_IWICBitmap, (void **)&result)))
513 {
514 *ppIBitmap = result;
515 return S_OK;
516 }
517
518 hr = IWICBitmapSource_GetSize(piBitmapSource, &width, &height);
519
520 if (SUCCEEDED(hr) && rect)
521 {
522 if (rect->X >= width || rect->Y >= height || rect->Width == 0 || rect->Height == 0)
523 return E_INVALIDARG;
524
525 width = min(width - rect->X, rect->Width);
526 height = min(height - rect->Y, rect->Height);
527 }
528
529 if (SUCCEEDED(hr))
530 hr = IWICBitmapSource_GetPixelFormat(piBitmapSource, &pixelformat);
531
532 if (SUCCEEDED(hr))
534
535 if (SUCCEEDED(hr))
536 {
537 hr = IWICComponentInfo_QueryInterface(info, &IID_IWICPixelFormatInfo2, (void**)&formatinfo);
538
539 if (SUCCEEDED(hr))
540 {
541 hr = IWICPixelFormatInfo2_GetNumericRepresentation(formatinfo, &format_type);
542
543 IWICPixelFormatInfo2_Release(formatinfo);
544 }
545
546 IWICComponentInfo_Release(info);
547 }
548
549 if (SUCCEEDED(hr))
551
552 if (SUCCEEDED(hr))
553 {
554 hr = IWICBitmap_Lock(result, NULL, WICBitmapLockWrite, &lock);
555 if (SUCCEEDED(hr))
556 {
557 UINT stride, buffersize;
558 BYTE *buffer;
559
560 if (rect)
561 {
562 rc.X = rect->X;
563 rc.Y = rect->Y;
564 }
565 else
566 rc.X = rc.Y = 0;
567 rc.Width = width;
568 rc.Height = height;
569
570 hr = IWICBitmapLock_GetStride(lock, &stride);
571
572 if (SUCCEEDED(hr))
573 hr = IWICBitmapLock_GetDataPointer(lock, &buffersize, &buffer);
574
575 if (SUCCEEDED(hr))
576 hr = IWICBitmapSource_CopyPixels(piBitmapSource, &rc, stride,
577 buffersize, buffer);
578
579 IWICBitmapLock_Release(lock);
580 }
581
584 {
586
587 if (SUCCEEDED(hr))
588 {
589 hr = IWICBitmapSource_CopyPalette(piBitmapSource, palette);
590
591 if (SUCCEEDED(hr))
592 hr = IWICBitmap_SetPalette(result, palette);
593 else
594 hr = S_OK;
595
596 IWICPalette_Release(palette);
597 }
598 }
599
600 if (SUCCEEDED(hr))
601 {
602 hr = IWICBitmapSource_GetResolution(piBitmapSource, &dpix, &dpiy);
603
604 if (SUCCEEDED(hr))
605 hr = IWICBitmap_SetResolution(result, dpix, dpiy);
606 else
607 hr = S_OK;
608 }
609
610 if (SUCCEEDED(hr))
611 *ppIBitmap = result;
612 else
613 IWICBitmap_Release(result);
614 }
615
616 return hr;
617}
618
621 IWICBitmap **ppIBitmap)
622{
623 TRACE("(%p,%p,%u,%p)\n", iface, piBitmapSource, option, ppIBitmap);
624
625 return create_bitmap_from_source_rect(piBitmapSource, NULL, option, ppIBitmap);
626}
627
629 IWICBitmapSource *piBitmapSource, UINT x, UINT y, UINT width, UINT height,
630 IWICBitmap **ppIBitmap)
631{
633
634 TRACE("(%p,%p,%u,%u,%u,%u,%p)\n", iface, piBitmapSource, x, y, width,
635 height, ppIBitmap);
636
637 rect.X = x;
638 rect.Y = y;
639 rect.Width = width;
640 rect.Height = height;
641
642 return create_bitmap_from_source_rect(piBitmapSource, &rect, WICBitmapCacheOnLoad, ppIBitmap);
643}
644
648{
649 HRESULT hr;
650
651 TRACE("(%p,%u,%u,%s,%u,%u,%p,%p\n", iface, width, height,
653
654 if (!stride || !size || !buffer || !bitmap) return E_INVALIDARG;
655
657 if (SUCCEEDED(hr))
658 {
660
661 hr = IWICBitmap_Lock(*bitmap, NULL, WICBitmapLockWrite, &lock);
662 if (SUCCEEDED(hr))
663 {
664 UINT buffersize;
665 BYTE *data;
666
667 IWICBitmapLock_GetDataPointer(lock, &buffersize, &data);
668 memcpy(data, buffer, buffersize);
669
670 IWICBitmapLock_Release(lock);
671 }
672 else
673 {
674 IWICBitmap_Release(*bitmap);
675 *bitmap = NULL;
676 }
677 }
678 return hr;
679}
680
682{
683 BOOL ret = TRUE;
684 BITMAPV4HEADER bmh;
685 HDC hdc;
686
688
689 memset(&bmh, 0, sizeof(bmh));
690 bmh.bV4Size = sizeof(bmh);
691 bmh.bV4Width = 1;
692 bmh.bV4Height = 1;
694 bmh.bV4BitCount = 16;
695
696 GetDIBits(hdc, hbm, 0, 0, NULL, (BITMAPINFO *)&bmh, DIB_RGB_COLORS);
697
698 if (bmh.bV4RedMask == 0x7c00 &&
699 bmh.bV4GreenMask == 0x3e0 &&
700 bmh.bV4BlueMask == 0x1f)
701 {
702 *format = GUID_WICPixelFormat16bppBGR555;
703 }
704 else if (bmh.bV4RedMask == 0xf800 &&
705 bmh.bV4GreenMask == 0x7e0 &&
706 bmh.bV4BlueMask == 0x1f)
707 {
708 *format = GUID_WICPixelFormat16bppBGR565;
709 }
710 else
711 {
712 FIXME("unrecognized bitfields %lx,%lx,%lx\n", bmh.bV4RedMask,
713 bmh.bV4GreenMask, bmh.bV4BlueMask);
714 ret = FALSE;
715 }
716
717 DeleteDC(hdc);
718 return ret;
719}
720
723{
724 BITMAP bm;
725 HRESULT hr;
728 UINT size, num_palette_entries = 0;
729 PALETTEENTRY entry[256];
730
731 TRACE("(%p,%p,%p,%u,%p)\n", iface, hbm, hpal, option, bitmap);
732
733 if (!bitmap) return E_INVALIDARG;
734
735 if (GetObjectW(hbm, sizeof(bm), &bm) != sizeof(bm))
737
738 if (hpal)
739 {
740 num_palette_entries = GetPaletteEntries(hpal, 0, 256, entry);
741 if (!num_palette_entries)
743 }
744
745 /* TODO: Figure out the correct format for 16, 32, 64 bpp */
746 switch(bm.bmBitsPixel)
747 {
748 case 1:
749 format = GUID_WICPixelFormat1bppIndexed;
750 break;
751 case 4:
752 format = GUID_WICPixelFormat4bppIndexed;
753 break;
754 case 8:
755 format = GUID_WICPixelFormat8bppIndexed;
756 break;
757 case 16:
759 return E_INVALIDARG;
760 break;
761 case 24:
762 format = GUID_WICPixelFormat24bppBGR;
763 break;
764 case 32:
765 switch (option)
766 {
768 format = GUID_WICPixelFormat32bppBGRA;
769 break;
771 format = GUID_WICPixelFormat32bppPBGRA;
772 break;
774 format = GUID_WICPixelFormat32bppBGR;
775 break;
776 default:
777 return E_INVALIDARG;
778 }
779 break;
780 case 48:
781 format = GUID_WICPixelFormat48bppRGB;
782 break;
783 default:
784 FIXME("unsupported %d bpp\n", bm.bmBitsPixel);
785 return E_INVALIDARG;
786 }
787
788 hr = BitmapImpl_Create(bm.bmWidth, bm.bmHeight, bm.bmWidthBytes, 0, NULL, 0, &format,
790 if (hr != S_OK) return hr;
791
792 hr = IWICBitmap_Lock(*bitmap, NULL, WICBitmapLockWrite, &lock);
793 if (hr == S_OK)
794 {
795 BYTE *buffer;
796 HDC hdc;
797#ifdef __REACTOS__
798 char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors) + 256 * sizeof(RGBQUAD)];
799#else
800 char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
801#endif
802 BITMAPINFO *bmi = (BITMAPINFO *)bmibuf;
803
804 IWICBitmapLock_GetDataPointer(lock, &size, &buffer);
805
807
808 bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
809 bmi->bmiHeader.biBitCount = 0;
810 GetDIBits(hdc, hbm, 0, 0, NULL, bmi, DIB_RGB_COLORS);
811 bmi->bmiHeader.biHeight = -bm.bmHeight;
812 GetDIBits(hdc, hbm, 0, bm.bmHeight, buffer, bmi, DIB_RGB_COLORS);
813
814 DeleteDC(hdc);
815 IWICBitmapLock_Release(lock);
816
817 if (num_palette_entries)
818 {
820 WICColor colors[256];
821 UINT i;
822
824 if (hr == S_OK)
825 {
826 for (i = 0; i < num_palette_entries; i++)
827 colors[i] = 0xff000000 | entry[i].peRed << 16 |
828 entry[i].peGreen << 8 | entry[i].peBlue;
829
830 hr = IWICPalette_InitializeCustom(palette, colors, num_palette_entries);
831 if (hr == S_OK)
832 hr = IWICBitmap_SetPalette(*bitmap, palette);
833
834 IWICPalette_Release(palette);
835 }
836 }
837 }
838
839 if (hr != S_OK)
840 {
841 IWICBitmap_Release(*bitmap);
842 *bitmap = NULL;
843 }
844
845 return hr;
846}
847
849 HICON hicon, IWICBitmap **bitmap)
850{
853 BITMAP bm;
854 int width, height, x, y;
856 BYTE *buffer;
857 DWORD *bits;
858 BITMAPINFO bi;
859 HDC hdc;
860 BOOL has_alpha;
861 HRESULT hr;
862
863 TRACE("(%p,%p,%p)\n", iface, hicon, bitmap);
864
865 if (!bitmap) return E_INVALIDARG;
866
867 if (!GetIconInfo(hicon, &info))
869
870 GetObjectW(info.hbmColor ? info.hbmColor : info.hbmMask, sizeof(bm), &bm);
871
872 width = bm.bmWidth;
873 height = info.hbmColor ? abs(bm.bmHeight) : abs(bm.bmHeight) / 2;
874 stride = width * 4;
875 size = stride * height;
876
878 &GUID_WICPixelFormat32bppBGRA, WICBitmapCacheOnLoad, bitmap);
879 if (hr != S_OK) goto failed;
880
881 hr = IWICBitmap_Lock(*bitmap, NULL, WICBitmapLockWrite, &lock);
882 if (hr != S_OK)
883 {
884 IWICBitmap_Release(*bitmap);
885 goto failed;
886 }
887 IWICBitmapLock_GetDataPointer(lock, &size, &buffer);
888
890
891 memset(&bi, 0, sizeof(bi));
892 bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
894 bi.bmiHeader.biHeight = info.hbmColor ? -height: -height * 2;
895 bi.bmiHeader.biPlanes = 1;
896 bi.bmiHeader.biBitCount = 32;
898
899 has_alpha = FALSE;
900
901 if (info.hbmColor)
902 {
903 GetDIBits(hdc, info.hbmColor, 0, height, buffer, &bi, DIB_RGB_COLORS);
904
905 if (bm.bmBitsPixel == 32)
906 {
907 /* If any pixel has a non-zero alpha, ignore hbmMask */
908 DWORD *ptr = (DWORD *)buffer;
909 DWORD *end = ptr + width * height;
910 while (ptr != end)
911 {
912 if (*ptr++ & 0xff000000)
913 {
914 has_alpha = TRUE;
915 break;
916 }
917 }
918 }
919 }
920 else
921 GetDIBits(hdc, info.hbmMask, 0, height, buffer, &bi, DIB_RGB_COLORS);
922
923 if (!has_alpha)
924 {
925 DWORD *rgba;
926
927 if (info.hbmMask)
928 {
929 BYTE *mask;
930
931 mask = malloc(size);
932 if (!mask)
933 {
934 IWICBitmapLock_Release(lock);
935 IWICBitmap_Release(*bitmap);
936 DeleteDC(hdc);
938 goto failed;
939 }
940
941 /* read alpha data from the mask */
942 GetDIBits(hdc, info.hbmMask, info.hbmColor ? 0 : height, height, mask, &bi, DIB_RGB_COLORS);
943
944 for (y = 0; y < height; y++)
945 {
946 rgba = (DWORD *)(buffer + y * stride);
947 bits = (DWORD *)(mask + y * stride);
948
949 for (x = 0; x < width; x++, rgba++, bits++)
950 {
951 if (*bits)
952 *rgba = 0;
953 else
954 *rgba |= 0xff000000;
955 }
956 }
957
958 free(mask);
959 }
960 else
961 {
962 /* set constant alpha of 255 */
963 for (y = 0; y < height; y++)
964 {
965 rgba = (DWORD *)(buffer + y * stride);
966 for (x = 0; x < width; x++, rgba++)
967 *rgba |= 0xff000000;
968 }
969 }
970
971 }
972
973 IWICBitmapLock_Release(lock);
974 DeleteDC(hdc);
975
976failed:
977 DeleteObject(info.hbmColor);
978 DeleteObject(info.hbmMask);
979
980 return hr;
981}
982
984 DWORD componentTypes, DWORD options, IEnumUnknown **ppIEnumUnknown)
985{
986 TRACE("(%p,%lu,%lu,%p)\n", iface, componentTypes, options, ppIEnumUnknown);
987 return CreateComponentEnumerator(componentTypes, options, ppIEnumUnknown);
988}
989
991 IWICImagingFactory2 *iface, IWICBitmapDecoder *pIDecoder,
992 IWICFastMetadataEncoder **ppIFastEncoder)
993{
994 FIXME("(%p,%p,%p): stub\n", iface, pIDecoder, ppIFastEncoder);
995 return E_NOTIMPL;
996}
997
999 IWICImagingFactory2 *iface, IWICBitmapFrameDecode *pIFrameDecoder,
1000 IWICFastMetadataEncoder **ppIFastEncoder)
1001{
1002 FIXME("(%p,%p,%p): stub\n", iface, pIFrameDecoder, ppIFastEncoder);
1003 return E_NOTIMPL;
1004}
1005
1007 REFGUID guidMetadataFormat, const GUID *pguidVendor,
1008 IWICMetadataQueryWriter **ppIQueryWriter)
1009{
1010 FIXME("(%p,%s,%s,%p): stub\n", iface, debugstr_guid(guidMetadataFormat),
1011 debugstr_guid(pguidVendor), ppIQueryWriter);
1012 return E_NOTIMPL;
1013}
1014
1016 IWICMetadataQueryReader *pIQueryReader, const GUID *pguidVendor,
1017 IWICMetadataQueryWriter **ppIQueryWriter)
1018{
1019 FIXME("(%p,%p,%s,%p): stub\n", iface, pIQueryReader, debugstr_guid(pguidVendor),
1020 ppIQueryWriter);
1021 return E_NOTIMPL;
1022}
1023
1024#ifndef __REACTOS__
1026{
1027 FIXME("%p,%p,%p stub.\n", iface, device, encoder);
1028 return E_NOTIMPL;
1029}
1030#endif
1031
1032static const IWICImagingFactory2Vtbl ImagingFactory_Vtbl = {
1061#ifndef __REACTOS__
1063#endif
1064};
1065
1067{
1069 return IWICImagingFactory2_QueryInterface(&This->IWICImagingFactory2_iface, iid, ppv);
1070}
1071
1073{
1075 return IWICImagingFactory2_AddRef(&This->IWICImagingFactory2_iface);
1076}
1077
1079{
1081 return IWICImagingFactory2_Release(&This->IWICImagingFactory2_iface);
1082}
1083
1086{
1088 return IWICImagingFactory2_CreateDecoderFromFilename(&This->IWICImagingFactory2_iface, filename, vendor,
1089 desired_access, options, decoder);
1090}
1091
1094{
1096 return IWICImagingFactory2_CreateDecoderFromStream(&This->IWICImagingFactory2_iface, stream, vendor,
1097 options, decoder);
1098}
1099
1102{
1104 return IWICImagingFactory2_CreateDecoderFromFileHandle(&This->IWICImagingFactory2_iface, hFile, vendor,
1105 options, decoder);
1106}
1107
1110{
1112 return IWICImagingFactory2_CreateComponentInfo(&This->IWICImagingFactory2_iface, component, info);
1113}
1114
1117{
1119 return IWICImagingFactory2_CreateDecoder(&This->IWICImagingFactory2_iface, format, vendor, decoder);
1120}
1121
1124{
1126 return IWICImagingFactory2_CreateEncoder(&This->IWICImagingFactory2_iface, format, vendor, encoder);
1127}
1128
1130{
1132 return IWICImagingFactory2_CreatePalette(&This->IWICImagingFactory2_iface, palette);
1133}
1134
1136{
1138 return IWICImagingFactory2_CreateFormatConverter(&This->IWICImagingFactory2_iface, converter);
1139}
1140
1142{
1144 return IWICImagingFactory2_CreateBitmapScaler(&This->IWICImagingFactory2_iface, scaler);
1145}
1146
1148{
1150 return IWICImagingFactory2_CreateBitmapClipper(&This->IWICImagingFactory2_iface, clipper);
1151}
1152
1154{
1156 return IWICImagingFactory2_CreateBitmapFlipRotator(&This->IWICImagingFactory2_iface, fliprotator);
1157}
1158
1160{
1162 return IWICImagingFactory2_CreateStream(&This->IWICImagingFactory2_iface, stream);
1163}
1164
1166{
1168 return IWICImagingFactory2_CreateColorContext(&This->IWICImagingFactory2_iface, context);
1169}
1170
1172{
1174 return IWICImagingFactory2_CreateColorTransformer(&This->IWICImagingFactory2_iface, transformer);
1175}
1176
1179{
1181 return IWICImagingFactory2_CreateBitmap(&This->IWICImagingFactory2_iface, width, height, pixel_format, option, bitmap);
1182}
1183
1186{
1188 return IWICImagingFactory2_CreateBitmapFromSource(&This->IWICImagingFactory2_iface, source, option, bitmap);
1189}
1190
1193{
1195 return IWICImagingFactory2_CreateBitmapFromSourceRect(&This->IWICImagingFactory2_iface, source, x, y, width, height, bitmap);
1196}
1197
1200{
1202 return IWICImagingFactory2_CreateBitmapFromMemory(&This->IWICImagingFactory2_iface, width, height, format, stride,
1203 size, buffer, bitmap);
1204}
1205
1208{
1210 return IWICImagingFactory2_CreateBitmapFromHBITMAP(&This->IWICImagingFactory2_iface, hbm, hpal, option, bitmap);
1211}
1212
1214{
1216 return IWICImagingFactory2_CreateBitmapFromHICON(&This->IWICImagingFactory2_iface, hicon, bitmap);
1217}
1218
1220 DWORD options, IEnumUnknown **enumerator)
1221{
1223 return IWICImagingFactory2_CreateComponentEnumerator(&This->IWICImagingFactory2_iface, component_types,
1224 options, enumerator);
1225}
1226
1229{
1231 return IWICImagingFactory2_CreateFastMetadataEncoderFromDecoder(&This->IWICImagingFactory2_iface, decoder, encoder);
1232}
1233
1236{
1238 return IWICImagingFactory2_CreateFastMetadataEncoderFromFrameDecode(&This->IWICImagingFactory2_iface, frame_decode, encoder);
1239}
1240
1242 IWICMetadataQueryWriter **writer)
1243{
1245 return IWICImagingFactory2_CreateQueryWriter(&This->IWICImagingFactory2_iface, format, vendor, writer);
1246}
1247
1249 const GUID *vendor, IWICMetadataQueryWriter **writer)
1250{
1252 return IWICImagingFactory2_CreateQueryWriterFromReader(&This->IWICImagingFactory2_iface, reader, vendor, writer);
1253}
1254
1256{
1259};
1260
1262{
1263 const GUID *format;
1264 const GUID *vendor;
1267
1268 void **result;
1269};
1270
1272
1274 struct iterator_context *context)
1275{
1276 IWICPersistStream *persist_stream = NULL;
1277 IWICMetadataReaderInfo *readerinfo;
1279 LARGE_INTEGER zero = {{0}};
1280 BOOL matches;
1281 HRESULT hr;
1282 GUID guid;
1283
1284 if (FAILED(IUnknown_QueryInterface(item, &IID_IWICMetadataReaderInfo, (void **)&readerinfo)))
1285 return ITER_SKIP;
1286
1287 if (context->vendor)
1288 {
1289 hr = IWICMetadataReaderInfo_GetVendorGUID(readerinfo, &guid);
1290
1291 if (FAILED(hr) || !IsEqualIID(context->vendor, &guid))
1292 {
1293 IWICMetadataReaderInfo_Release(readerinfo);
1294 return ITER_SKIP;
1295 }
1296 }
1297
1298 hr = IWICMetadataReaderInfo_MatchesPattern(readerinfo, context->format, context->stream, &matches);
1299
1300 if (SUCCEEDED(hr) && matches)
1301 {
1302 hr = IStream_Seek(context->stream, zero, STREAM_SEEK_SET, NULL);
1303
1304 if (SUCCEEDED(hr))
1305 hr = IWICMetadataReaderInfo_CreateInstance(readerinfo, &reader);
1306
1307 if (SUCCEEDED(hr))
1308 hr = IWICMetadataReader_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist_stream);
1309
1310 if (SUCCEEDED(hr))
1311 hr = IWICPersistStream_LoadEx(persist_stream, context->stream, context->vendor,
1312 context->options & WICPersistOptionMask);
1313
1314 if (persist_stream)
1315 IWICPersistStream_Release(persist_stream);
1316
1317 if (SUCCEEDED(hr))
1318 {
1319 *context->result = reader;
1320 IWICMetadataReaderInfo_Release(readerinfo);
1321 return ITER_DONE;
1322 }
1323
1324 if (reader)
1325 IWICMetadataReader_Release(reader);
1326 }
1327
1328 IWICMetadataReaderInfo_Release(readerinfo);
1329
1330 return ITER_SKIP;
1331}
1332
1334 struct iterator_context *context)
1335{
1336 IWICPersistStream *persist_stream = NULL;
1337 IWICMetadataReaderInfo *readerinfo;
1339 LARGE_INTEGER zero = {{0}};
1340 HRESULT hr;
1341 GUID guid;
1342
1343 if (FAILED(IUnknown_QueryInterface(item, &IID_IWICMetadataReaderInfo, (void **)&readerinfo)))
1344 return ITER_SKIP;
1345
1346 if (context->vendor)
1347 {
1348 hr = IWICMetadataReaderInfo_GetVendorGUID(readerinfo, &guid);
1349
1350 if (FAILED(hr) || !IsEqualIID(context->vendor, &guid))
1351 {
1352 IWICMetadataReaderInfo_Release(readerinfo);
1353 return ITER_SKIP;
1354 }
1355 }
1356
1357 hr = IWICMetadataReaderInfo_GetMetadataFormat(readerinfo, &guid);
1358
1359 if (FAILED(hr) || !IsEqualIID(context->format, &guid))
1360 {
1361 IWICMetadataReaderInfo_Release(readerinfo);
1362 return ITER_SKIP;
1363 }
1364
1365 if (SUCCEEDED(hr))
1366 hr = IWICMetadataReaderInfo_CreateInstance(readerinfo, &reader);
1367
1368 IWICMetadataReaderInfo_Release(readerinfo);
1369
1370 if (context->stream)
1371 {
1372 if (SUCCEEDED(hr))
1373 hr = IStream_Seek(context->stream, zero, STREAM_SEEK_SET, NULL);
1374
1375 if (SUCCEEDED(hr))
1376 hr = IWICMetadataReader_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist_stream);
1377
1378 if (SUCCEEDED(hr))
1379 hr = IWICPersistStream_LoadEx(persist_stream, context->stream, context->vendor,
1380 context->options & WICPersistOptionMask);
1381
1382 if (persist_stream)
1383 IWICPersistStream_Release(persist_stream);
1384 }
1385
1386 if (SUCCEEDED(hr))
1387 {
1388 *context->result = reader;
1389 return ITER_DONE;
1390 }
1391
1392 if (reader)
1393 IWICMetadataReader_Release(reader);
1394
1395 return ITER_SKIP;
1396}
1397
1399{
1400 enum iterator_result ret;
1401 IEnumUnknown *enumerator;
1402 IUnknown *item;
1403 HRESULT hr;
1404
1406 return hr;
1407
1408 while (IEnumUnknown_Next(enumerator, 1, &item, NULL) == S_OK)
1409 {
1410 *context->result = NULL;
1411
1412 ret = func(item, context);
1413 IUnknown_Release(item);
1414
1415 if (ret == ITER_SKIP)
1416 continue;
1417
1418 break;
1419 }
1420
1421 IEnumUnknown_Release(enumerator);
1422
1423 return *context->result ? S_OK : WINCODEC_ERR_COMPONENTNOTFOUND;
1424}
1425
1427{
1428 IWICPersistStream *persist_stream = NULL;
1429 LARGE_INTEGER zero = {{0}};
1430 HRESULT hr;
1431
1432 hr = IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
1433
1434 if (SUCCEEDED(hr))
1435 hr = UnknownMetadataReader_CreateInstance(&IID_IWICMetadataReader, (void **)reader);
1436
1437 if (SUCCEEDED(hr))
1438 hr = IWICMetadataReader_QueryInterface(*reader, &IID_IWICPersistStream, (void **)&persist_stream);
1439
1440 if (SUCCEEDED(hr))
1441 hr = IWICPersistStream_LoadEx(persist_stream, stream, NULL, options & WICPersistOptionMask);
1442
1443 if (persist_stream)
1444 IWICPersistStream_Release(persist_stream);
1445
1446 if (FAILED(hr))
1447 {
1448 IWICMetadataReader_Release(*reader);
1449 *reader = NULL;
1450 }
1451
1452 return hr;
1453}
1454
1457{
1458 struct iterator_context context = { 0 };
1459 HRESULT hr;
1460
1461 TRACE("%p,%s,%s,%lx,%p,%p\n", iface, debugstr_guid(format), debugstr_guid(vendor),
1463
1464 if (!format || !reader)
1465 return E_INVALIDARG;
1466
1467 context.format = format;
1468 context.vendor = vendor;
1469 context.options = options;
1470 context.stream = stream;
1471 context.result = (void **)reader;
1472
1474
1475 if (FAILED(hr) && vendor)
1476 {
1477 context.vendor = NULL;
1479 }
1480
1481 if (FAILED(hr))
1482 WARN("Failed to create a metadata reader instance, hr %#lx.\n", hr);
1483
1486
1488}
1489
1492{
1493 struct iterator_context context = { 0 };
1494 HRESULT hr;
1495
1496 TRACE("%p,%s,%s,%lx,%p,%p\n", iface, debugstr_guid(format), debugstr_guid(vendor),
1498
1499 if (!format || !stream || !reader)
1500 return E_INVALIDARG;
1501
1502 context.format = format;
1503 context.vendor = vendor;
1504 context.options = options;
1505 context.stream = stream;
1506 context.result = (void **)reader;
1507
1509
1510 if (FAILED(hr) && vendor)
1511 {
1512 context.vendor = NULL;
1514 }
1515
1516 if (FAILED(hr))
1517 WARN("Failed to create a metadata reader instance, hr %#lx.\n", hr);
1518
1521
1523}
1524
1527{
1528 FIXME("%p,%s,%s,%lx,%p: stub\n", iface, debugstr_guid(format), debugstr_guid(vendor), options, writer);
1529 return E_NOTIMPL;
1530}
1531
1534{
1535 FIXME("%p,%p,%s,%p: stub\n", iface, reader, debugstr_guid(vendor), writer);
1536 return E_NOTIMPL;
1537}
1538
1540 IWICMetadataBlockReader *block_reader, IWICMetadataQueryReader **query_reader)
1541{
1542 TRACE("%p,%p,%p\n", iface, block_reader, query_reader);
1543
1544 if (!block_reader || !query_reader)
1545 return E_INVALIDARG;
1546
1547 return MetadataQueryReader_CreateInstance(block_reader, NULL, query_reader);
1548}
1549
1551 IWICMetadataBlockWriter *block_writer, IWICMetadataQueryWriter **query_writer)
1552{
1553 TRACE("%p,%p,%p\n", iface, block_writer, query_writer);
1554
1555 if (!block_writer || !query_writer)
1556 return E_INVALIDARG;
1557
1558 return MetadataQueryWriter_CreateInstance(block_writer, NULL, query_writer);
1559}
1560
1562 PROPBAG2 *options, UINT count, IPropertyBag2 **property)
1563{
1564 TRACE("(%p,%p,%u,%p)\n", iface, options, count, property);
1566}
1567
1568static const IWICComponentFactoryVtbl ComponentFactory_Vtbl = {
1604};
1605
1607{
1609 HRESULT ret;
1610
1611 TRACE("(%s,%p)\n", debugstr_guid(iid), ppv);
1612
1613 *ppv = NULL;
1614
1615 This = malloc(sizeof(*This));
1616 if (!This) return E_OUTOFMEMORY;
1617
1618 This->IWICImagingFactory2_iface.lpVtbl = &ImagingFactory_Vtbl;
1619 This->IWICComponentFactory_iface.lpVtbl = &ComponentFactory_Vtbl;
1620 This->ref = 1;
1621
1622 ret = IWICImagingFactory2_QueryInterface(&This->IWICImagingFactory2_iface, iid, ppv);
1623 IWICImagingFactory2_Release(&This->IWICImagingFactory2_iface);
1624
1625 return ret;
1626}
1627
1631{
1633 UINT bpp, access, size, view_offset, view_size;
1634 void *view;
1635 HRESULT hr;
1636
1637 TRACE("%u,%u,%s,%p,%u,%u,%#x,%p\n", width, height, debugstr_guid(format),
1638 section, stride, offset, wicaccess, bitmap);
1639
1640 if (!width || !height || !section || !bitmap) return E_INVALIDARG;
1641
1643 if (FAILED(hr)) return hr;
1644
1645 switch (wicaccess)
1646 {
1649 break;
1650
1653 break;
1654
1655 default:
1656 FIXME("unsupported access %#x\n", wicaccess);
1657 return E_INVALIDARG;
1658 }
1659
1660 if (!stride) stride = (((bpp * width) + 31) / 32) * 4;
1661 size = stride * height;
1662 if (size / height != stride) return E_INVALIDARG;
1663
1665 view_offset = offset - (offset % sysinfo.dwAllocationGranularity);
1666 view_size = size + (offset - view_offset);
1667
1668 view = MapViewOfFile(section, access, 0, view_offset, view_size);
1669 if (!view) return HRESULT_FROM_WIN32(GetLastError());
1670
1671 offset -= view_offset;
1674 return hr;
1675}
1676
1680{
1681 TRACE("%u,%u,%s,%p,%u,%u,%p\n", width, height, debugstr_guid(format),
1683
1686}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
HRESULT ColorContext_Create(IWICColorContext **colorcontext)
Definition: colorcontext.c:256
HRESULT ColorTransform_Create(IWICColorTransform **colortransform)
format_type
Definition: d3dx9_private.h:49
const WCHAR * vendor
Definition: db.cpp:872
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
DWORD bpp
Definition: surface.c:185
#define UnmapViewOfFile
Definition: compat.h:746
#define FILE_MAP_READ
Definition: compat.h:776
#define MapViewOfFile
Definition: compat.h:745
SYSTEM_INFO sysinfo
Definition: dbghelp.c:76
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:143
HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight, UINT stride, UINT datasize, void *view, UINT offset, REFWICPixelFormatGUID pixelFormat, WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap)
Definition: bitmap.c:790
HRESULT FormatConverter_CreateInstance(REFIID iid, void **ppv)
Definition: converter.c:1953
pixelformat
Definition: converter.c:37
HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo)
Definition: info.c:2030
HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnknown **ppIEnumUnknown)
Definition: info.c:2339
HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp)
Definition: main.c:62
HRESULT PaletteImpl_Create(IWICPalette **palette)
Definition: palette.c:897
HRESULT CreatePropertyBag2(const PROPBAG2 *options, UINT count, IPropertyBag2 **ppPropertyBag2)
Definition: propertybag.c:278
HRESULT stream_initialize_from_filehandle(IWICStream *iface, HANDLE file)
Definition: stream.c:1043
HRESULT StreamImpl_Create(IWICStream **stream)
Definition: stream.c:1158
#define assert(x)
Definition: debug.h:53
#define BI_RGB
Definition: precomp.h:56
ULONG RGBQUAD
Definition: precomp.h:59
#define abs(i)
Definition: fconv.c:206
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT FlipRotator_Create(IWICBitmapFlipRotator **fliprotator)
Definition: fliprotate.c:266
pKey DeleteObject()
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum func
Definition: glext.h:6028
GLsizei stride
Definition: glext.h:5848
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
GLenum GLint GLuint mask
Definition: glext.h:6028
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
GLuint64EXT * result
Definition: glext.h:11304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static HRESULT WINAPI ComponentFactory_CreateMetadataWriter(IWICComponentFactory *iface, REFGUID format, const GUID *vendor, DWORD options, IWICMetadataWriter **writer)
Definition: imgfactory.c:1525
static HRESULT WINAPI ImagingFactory_CreateQueryWriterFromReader(IWICImagingFactory2 *iface, IWICMetadataQueryReader *pIQueryReader, const GUID *pguidVendor, IWICMetadataQueryWriter **ppIQueryWriter)
Definition: imgfactory.c:1015
static HRESULT WINAPI ImagingFactory_CreateQueryWriter(IWICImagingFactory2 *iface, REFGUID guidMetadataFormat, const GUID *pguidVendor, IWICMetadataQueryWriter **ppIQueryWriter)
Definition: imgfactory.c:1006
static HRESULT WINAPI ImagingFactory_CreatePalette(IWICImagingFactory2 *iface, IWICPalette **ppIPalette)
Definition: imgfactory.c:426
static const IWICImagingFactory2Vtbl ImagingFactory_Vtbl
Definition: imgfactory.c:1032
static HRESULT WINAPI ImagingFactory_CreateBitmapScaler(IWICImagingFactory2 *iface, IWICBitmapScaler **ppIBitmapScaler)
Definition: imgfactory.c:439
static HRESULT create_bitmap_from_source_rect(IWICBitmapSource *piBitmapSource, const WICRect *rect, WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap)
Definition: imgfactory.c:491
static HRESULT find_decoder(IStream *pIStream, const GUID *pguidVendor, WICDecodeOptions metadataOptions, IWICBitmapDecoder **decoder)
Definition: imgfactory.c:132
static HRESULT WINAPI ImagingFactory_CreateFastMetadataEncoderFromFrameDecode(IWICImagingFactory2 *iface, IWICBitmapFrameDecode *pIFrameDecoder, IWICFastMetadataEncoder **ppIFastEncoder)
Definition: imgfactory.c:998
static HRESULT WINAPI ComponentFactory_CreateDecoderFromFilename(IWICComponentFactory *iface, LPCWSTR filename, const GUID *vendor, DWORD desired_access, WICDecodeOptions options, IWICBitmapDecoder **decoder)
Definition: imgfactory.c:1084
static HRESULT WINAPI ImagingFactory_CreateBitmapClipper(IWICImagingFactory2 *iface, IWICBitmapClipper **ppIBitmapClipper)
Definition: imgfactory.c:447
static HRESULT WINAPI ComponentFactory_CreateBitmapFlipRotator(IWICComponentFactory *iface, IWICBitmapFlipRotator **fliprotator)
Definition: imgfactory.c:1153
static HRESULT WINAPI ImagingFactory_CreateBitmapFromHBITMAP(IWICImagingFactory2 *iface, HBITMAP hbm, HPALETTE hpal, WICBitmapAlphaChannelOption option, IWICBitmap **bitmap)
Definition: imgfactory.c:721
static HRESULT WINAPI ComponentFactory_QueryInterface(IWICComponentFactory *iface, REFIID iid, void **ppv)
Definition: imgfactory.c:1066
static HRESULT WINAPI ComponentFactory_CreateBitmapClipper(IWICComponentFactory *iface, IWICBitmapClipper **clipper)
Definition: imgfactory.c:1147
static BOOL get_16bpp_format(HBITMAP hbm, WICPixelFormatGUID *format)
Definition: imgfactory.c:681
static HRESULT WINAPI ComponentFactory_CreateQueryWriterFromBlockWriter(IWICComponentFactory *iface, IWICMetadataBlockWriter *block_writer, IWICMetadataQueryWriter **query_writer)
Definition: imgfactory.c:1550
static const IWICComponentFactoryVtbl ComponentFactory_Vtbl
Definition: imgfactory.c:1568
iterator_result
Definition: imgfactory.c:1256
@ ITER_SKIP
Definition: imgfactory.c:1257
@ ITER_DONE
Definition: imgfactory.c:1258
static HRESULT WINAPI ImagingFactory_CreateColorContext(IWICImagingFactory2 *iface, IWICColorContext **ppIColorContext)
Definition: imgfactory.c:468
static HRESULT WINAPI ComponentFactory_CreateComponentEnumerator(IWICComponentFactory *iface, DWORD component_types, DWORD options, IEnumUnknown **enumerator)
Definition: imgfactory.c:1219
static HRESULT WINAPI ComponentFactory_CreateColorTransformer(IWICComponentFactory *iface, IWICColorTransform **transformer)
Definition: imgfactory.c:1171
static HRESULT WINAPI ComponentFactory_CreateDecoder(IWICComponentFactory *iface, REFGUID format, const GUID *vendor, IWICBitmapDecoder **decoder)
Definition: imgfactory.c:1115
HRESULT WINAPI WICCreateBitmapFromSection(UINT width, UINT height, REFWICPixelFormatGUID format, HANDLE section, UINT stride, UINT offset, IWICBitmap **bitmap)
Definition: imgfactory.c:1677
static HRESULT WINAPI ComponentFactory_CreateColorContext(IWICComponentFactory *iface, IWICColorContext **context)
Definition: imgfactory.c:1165
static HRESULT WINAPI ImagingFactory_CreateBitmapFromHICON(IWICImagingFactory2 *iface, HICON hicon, IWICBitmap **bitmap)
Definition: imgfactory.c:848
static ULONG WINAPI ComponentFactory_Release(IWICComponentFactory *iface)
Definition: imgfactory.c:1078
static HRESULT WINAPI ImagingFactory_CreateEncoder(IWICImagingFactory2 *iface, REFGUID guidContainerFormat, const GUID *pguidVendor, IWICBitmapEncoder **ppIEncoder)
Definition: imgfactory.c:361
static enum iterator_result create_metadata_reader_from_container_iterator(IUnknown *item, struct iterator_context *context)
Definition: imgfactory.c:1273
static HRESULT WINAPI ComponentFactory_CreateBitmapFromSource(IWICComponentFactory *iface, IWICBitmapSource *source, WICBitmapCreateCacheOption option, IWICBitmap **bitmap)
Definition: imgfactory.c:1184
static HRESULT WINAPI ImagingFactory_CreateComponentInfo(IWICImagingFactory2 *iface, REFCLSID clsidComponent, IWICComponentInfo **ppIInfo)
Definition: imgfactory.c:271
static HRESULT WINAPI ComponentFactory_CreateBitmapFromMemory(IWICComponentFactory *iface, UINT width, UINT height, REFWICPixelFormatGUID format, UINT stride, UINT size, BYTE *buffer, IWICBitmap **bitmap)
Definition: imgfactory.c:1198
static HRESULT WINAPI ComponentFactory_CreateQueryWriterFromReader(IWICComponentFactory *iface, IWICMetadataQueryReader *reader, const GUID *vendor, IWICMetadataQueryWriter **writer)
Definition: imgfactory.c:1248
static HRESULT WINAPI ComponentFactory_CreateQueryReaderFromBlockReader(IWICComponentFactory *iface, IWICMetadataBlockReader *block_reader, IWICMetadataQueryReader **query_reader)
Definition: imgfactory.c:1539
static HRESULT WINAPI ImagingFactory_QueryInterface(IWICImagingFactory2 *iface, REFIID iid, void **ppv)
Definition: imgfactory.c:53
static HRESULT WINAPI ComponentFactory_CreateFastMetadataEncoderFromFrameDecode(IWICComponentFactory *iface, IWICBitmapFrameDecode *frame_decode, IWICFastMetadataEncoder **encoder)
Definition: imgfactory.c:1234
HRESULT WINAPI WICCreateBitmapFromSectionEx(UINT width, UINT height, REFWICPixelFormatGUID format, HANDLE section, UINT stride, UINT offset, WICSectionAccessLevel wicaccess, IWICBitmap **bitmap)
Definition: imgfactory.c:1628
static HRESULT WINAPI ImagingFactory_CreateDecoderFromFileHandle(IWICImagingFactory2 *iface, ULONG_PTR hFile, const GUID *pguidVendor, WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder)
Definition: imgfactory.c:247
static HRESULT WINAPI ImagingFactory_CreateBitmapFlipRotator(IWICImagingFactory2 *iface, IWICBitmapFlipRotator **ppIBitmapFlipRotator)
Definition: imgfactory.c:454
static HRESULT WINAPI ComponentFactory_CreateBitmap(IWICComponentFactory *iface, UINT width, UINT height, REFWICPixelFormatGUID pixel_format, WICBitmapCreateCacheOption option, IWICBitmap **bitmap)
Definition: imgfactory.c:1177
static HRESULT WINAPI ImagingFactory_CreateBitmapFromSource(IWICImagingFactory2 *iface, IWICBitmapSource *piBitmapSource, WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap)
Definition: imgfactory.c:619
static HRESULT WINAPI ImagingFactory_CreateStream(IWICImagingFactory2 *iface, IWICStream **ppIWICStream)
Definition: imgfactory.c:461
static HRESULT create_unknown_metadata_reader(IStream *stream, DWORD options, IWICMetadataReader **reader)
Definition: imgfactory.c:1426
static HRESULT WINAPI ComponentFactory_CreatePalette(IWICComponentFactory *iface, IWICPalette **palette)
Definition: imgfactory.c:1129
static HRESULT WINAPI ImagingFactory_CreateDecoder(IWICImagingFactory2 *iface, REFGUID guidContainerFormat, const GUID *pguidVendor, IWICBitmapDecoder **ppIDecoder)
Definition: imgfactory.c:278
static HRESULT WINAPI ComponentFactory_CreateEncoder(IWICComponentFactory *iface, REFGUID format, const GUID *vendor, IWICBitmapEncoder **encoder)
Definition: imgfactory.c:1122
static ULONG WINAPI ImagingFactory_Release(IWICImagingFactory2 *iface)
Definition: imgfactory.c:91
static HRESULT WINAPI ComponentFactory_CreateMetadataReaderFromContainer(IWICComponentFactory *iface, REFGUID format, const GUID *vendor, DWORD options, IStream *stream, IWICMetadataReader **reader)
Definition: imgfactory.c:1490
static enum iterator_result create_metadata_reader_iterator(IUnknown *item, struct iterator_context *context)
Definition: imgfactory.c:1333
static HRESULT WINAPI ImagingFactory_CreateColorTransformer(IWICImagingFactory2 *iface, IWICColorTransform **ppIColorTransform)
Definition: imgfactory.c:475
static ULONG WINAPI ImagingFactory_AddRef(IWICImagingFactory2 *iface)
Definition: imgfactory.c:81
static HRESULT WINAPI ComponentFactory_CreateFastMetadataEncoderFromDecoder(IWICComponentFactory *iface, IWICBitmapDecoder *decoder, IWICFastMetadataEncoder **encoder)
Definition: imgfactory.c:1227
static HRESULT WINAPI ComponentFactory_CreateMetadataReader(IWICComponentFactory *iface, REFGUID format, const GUID *vendor, DWORD options, IStream *stream, IWICMetadataReader **reader)
Definition: imgfactory.c:1455
static HRESULT WINAPI ComponentFactory_CreateComponentInfo(IWICComponentFactory *iface, REFCLSID component, IWICComponentInfo **info)
Definition: imgfactory.c:1108
static ImagingFactory * impl_from_IWICImagingFactory2(IWICImagingFactory2 *iface)
Definition: imgfactory.c:48
static HRESULT WINAPI ImagingFactory_CreateDecoderFromFilename(IWICImagingFactory2 *iface, LPCWSTR wzFilename, const GUID *pguidVendor, DWORD dwDesiredAccess, WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder)
Definition: imgfactory.c:104
static HRESULT WINAPI ComponentFactory_CreateBitmapFromHICON(IWICComponentFactory *iface, HICON hicon, IWICBitmap **bitmap)
Definition: imgfactory.c:1213
static ULONG WINAPI ComponentFactory_AddRef(IWICComponentFactory *iface)
Definition: imgfactory.c:1072
static HRESULT WINAPI ComponentFactory_CreateQueryWriter(IWICComponentFactory *iface, REFGUID format, const GUID *vendor, IWICMetadataQueryWriter **writer)
Definition: imgfactory.c:1241
static HRESULT WINAPI ComponentFactory_CreateDecoderFromStream(IWICComponentFactory *iface, IStream *stream, const GUID *vendor, WICDecodeOptions options, IWICBitmapDecoder **decoder)
Definition: imgfactory.c:1092
enum iterator_result(* iterator_func)(IUnknown *item, struct iterator_context *context)
Definition: imgfactory.c:1271
static HRESULT WINAPI ImagingFactory_CreateBitmap(IWICImagingFactory2 *iface, UINT uiWidth, UINT uiHeight, REFWICPixelFormatGUID pixelFormat, WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap)
Definition: imgfactory.c:482
static HRESULT WINAPI ComponentFactory_CreateStream(IWICComponentFactory *iface, IWICStream **stream)
Definition: imgfactory.c:1159
static HRESULT WINAPI ComponentFactory_CreateBitmapScaler(IWICComponentFactory *iface, IWICBitmapScaler **scaler)
Definition: imgfactory.c:1141
static HRESULT WINAPI ImagingFactory_CreateComponentEnumerator(IWICImagingFactory2 *iface, DWORD componentTypes, DWORD options, IEnumUnknown **ppIEnumUnknown)
Definition: imgfactory.c:983
static ImagingFactory * impl_from_IWICComponentFactory(IWICComponentFactory *iface)
Definition: imgfactory.c:43
static HRESULT WINAPI ImagingFactory_CreateBitmapFromSourceRect(IWICImagingFactory2 *iface, IWICBitmapSource *piBitmapSource, UINT x, UINT y, UINT width, UINT height, IWICBitmap **ppIBitmap)
Definition: imgfactory.c:628
static HRESULT WINAPI ImagingFactory_CreateImageEncoder(IWICImagingFactory2 *iface, ID2D1Device *device, IWICImageEncoder **encoder)
Definition: imgfactory.c:1025
static HRESULT WINAPI ImagingFactory_CreateBitmapFromMemory(IWICImagingFactory2 *iface, UINT width, UINT height, REFWICPixelFormatGUID format, UINT stride, UINT size, BYTE *buffer, IWICBitmap **bitmap)
Definition: imgfactory.c:645
static HRESULT WINAPI ComponentFactory_CreateDecoderFromFileHandle(IWICComponentFactory *iface, ULONG_PTR hFile, const GUID *vendor, WICDecodeOptions options, IWICBitmapDecoder **decoder)
Definition: imgfactory.c:1100
static HRESULT WINAPI ImagingFactory_CreateFormatConverter(IWICImagingFactory2 *iface, IWICFormatConverter **ppIFormatConverter)
Definition: imgfactory.c:433
static HRESULT foreach_component(DWORD mask, iterator_func func, struct iterator_context *context)
Definition: imgfactory.c:1398
static HRESULT WINAPI ComponentFactory_CreateBitmapFromHBITMAP(IWICComponentFactory *iface, HBITMAP hbm, HPALETTE hpal, WICBitmapAlphaChannelOption option, IWICBitmap **bitmap)
Definition: imgfactory.c:1206
static HRESULT WINAPI ComponentFactory_CreateEncoderPropertyBag(IWICComponentFactory *iface, PROPBAG2 *options, UINT count, IPropertyBag2 **property)
Definition: imgfactory.c:1561
static HRESULT WINAPI ImagingFactory_CreateDecoderFromStream(IWICImagingFactory2 *iface, IStream *pIStream, const GUID *pguidVendor, WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder)
Definition: imgfactory.c:205
HRESULT ImagingFactory_CreateInstance(REFIID iid, void **ppv)
Definition: imgfactory.c:1606
static HRESULT WINAPI ImagingFactory_CreateFastMetadataEncoderFromDecoder(IWICImagingFactory2 *iface, IWICBitmapDecoder *pIDecoder, IWICFastMetadataEncoder **ppIFastEncoder)
Definition: imgfactory.c:990
static HRESULT WINAPI ComponentFactory_CreateBitmapFromSourceRect(IWICComponentFactory *iface, IWICBitmapSource *source, UINT x, UINT y, UINT width, UINT height, IWICBitmap **bitmap)
Definition: imgfactory.c:1191
static HRESULT WINAPI ComponentFactory_CreateFormatConverter(IWICComponentFactory *iface, IWICFormatConverter **converter)
Definition: imgfactory.c:1135
static HRESULT WINAPI ComponentFactory_CreateMetadataWriterFromReader(IWICComponentFactory *iface, IWICMetadataReader *reader, const GUID *vendor, IWICMetadataWriter **writer)
Definition: imgfactory.c:1532
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define bits
Definition: infblock.c:15
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
const char * filename
Definition: ioapi.h:137
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
HRESULT UnknownMetadataReader_CreateInstance(REFIID iid, void **ppv)
HRESULT MetadataQueryWriter_CreateInstance(IWICMetadataBlockWriter *mbw, const WCHAR *root, IWICMetadataQueryWriter **out)
HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *mbr, const WCHAR *root, IWICMetadataQueryReader **out)
const GUID * guid
#define matches(FN)
Definition: match.h:70
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define BI_BITFIELDS
Definition: mmreg.h:507
#define WARN_ON(c)
Definition: module.h:257
static PVOID ptr
Definition: dispmode.c:27
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static HICON
Definition: imagelist.c:80
static HPALETTE palette
Definition: clipboard.c:1345
static ATOM item
Definition: dde.c:856
#define min(a, b)
Definition: monoChain.cc:55
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
_In_ HBITMAP hbm
Definition: ntgdi.h:2776
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
static unsigned __int64 next
Definition: rand_nt.c:6
HRESULT BitmapScaler_Create(IWICBitmapScaler **scaler)
Definition: scaler.c:513
int seek(void *fd, ulong off, int mode)
Definition: pe.c:51
#define memset(x, y, z)
Definition: compat.h:39
int zero
Definition: sehframes.cpp:29
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
DWORD bV4GreenMask
Definition: wingdi.h:1504
DWORD bV4V4Compression
Definition: wingdi.h:1497
LONG bV4Height
Definition: wingdi.h:1494
DWORD bV4RedMask
Definition: wingdi.h:1503
LONG bV4Width
Definition: wingdi.h:1493
WORD bV4BitCount
Definition: wingdi.h:1496
DWORD bV4BlueMask
Definition: wingdi.h:1505
DWORD bV4Size
Definition: wingdi.h:1492
IWICComponentFactory IWICComponentFactory_iface
Definition: imgfactory.c:39
IWICImagingFactory2 IWICImagingFactory2_iface
Definition: imgfactory.c:38
INT Height
Definition: wincodec.idl:335
INT Width
Definition: wincodec.idl:334
Definition: bl.h:1331
Definition: scsiwmi.h:51
DWORD dwAllocationGranularity
Definition: winbase.h:1210
Definition: uimain.c:89
Definition: http.c:7252
Definition: devices.h:37
Definition: format.c:58
const GUID * vendor
Definition: imgfactory.c:1264
IStream * stream
Definition: imgfactory.c:1266
const GUID * format
Definition: imgfactory.c:1263
Definition: getopt.h:109
Definition: reader.h:84
Definition: send.c:48
Definition: parser.c:56
Definition: parse.h:23
USHORT biBitCount
Definition: precomp.h:46
ULONG biCompression
Definition: precomp.h:47
BITMAPINFOHEADER bmiHeader
Definition: wingdi.h:1476
rwlock_t lock
Definition: tcpcore.h:0
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
HRESULT BitmapClipper_Create(IWICBitmapClipper **clipper)
Definition: clipper.c:243
UINT WINAPI GetPaletteEntries(HPALETTE hpal, UINT iStartIndex, UINT cEntries, LPPALETTEENTRY ppe)
Definition: palette.c:64
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define FILE_MAP_WRITE
Definition: winbase.h:155
@ WICBitmapLockWrite
Definition: wincodec.idl:87
WICSectionAccessLevel
Definition: wincodec.idl:191
@ WICSectionAccessLevelRead
Definition: wincodec.idl:192
@ WICSectionAccessLevelReadWrite
Definition: wincodec.idl:193
WICDecodeOptions
Definition: wincodec.idl:28
WICBitmapCreateCacheOption
Definition: wincodec.idl:34
@ WICBitmapNoCache
Definition: wincodec.idl:35
@ WICBitmapCacheOnLoad
Definition: wincodec.idl:37
@ WICComponentEnumerateDefault
Definition: wincodec.idl:143
WICPixelFormatNumericRepresentation
Definition: wincodec.idl:158
@ WICPixelFormatNumericRepresentationUnspecified
Definition: wincodec.idl:159
@ WICPixelFormatNumericRepresentationIndexed
Definition: wincodec.idl:160
UINT32 WICColor
Definition: wincodec.idl:364
WICBitmapAlphaChannelOption
Definition: wincodec.idl:41
@ WICBitmapIgnoreAlpha
Definition: wincodec.idl:44
@ WICBitmapUseAlpha
Definition: wincodec.idl:42
@ WICBitmapUsePremultipliedAlpha
Definition: wincodec.idl:43
@ WICDecoder
Definition: wincodec.idl:126
@ WICMetadataReader
Definition: wincodec.idl:129
@ WICEncoder
Definition: wincodec.idl:127
@ WICMetadataCreationFailUnknown
Definition: wincodecsdk.idl:35
@ WICPersistOptionMask
Definition: wincodecsdk.idl:29
#define WINAPI
Definition: msvc.h:6
#define WINCODEC_ERR_COMPONENTNOTFOUND
Definition: winerror.h:3296
#define WINCODEC_ERR_WIN32ERROR
Definition: winerror.h:3319
#define E_NOINTERFACE
Definition: winerror.h:2364
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define DIB_RGB_COLORS
Definition: wingdi.h:367
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDIBits(_In_ HDC hdc, _In_ HBITMAP hbm, _In_ UINT start, _In_ UINT cLines, _Out_opt_ LPVOID lpvBits, _At_((LPBITMAPINFOHEADER) lpbmi, _Inout_) LPBITMAPINFO lpbmi, _In_ UINT usage)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI DeleteDC(_In_ HDC)
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2383
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193