ReactOS 0.4.16-dev-976-g18fc5a1
icoformat.c
Go to the documentation of this file.
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#include <stdarg.h>
20
21#define COBJMACROS
22
23#include "windef.h"
24#include "winbase.h"
25#include "wingdi.h"
26#include "objbase.h"
27
28#include "wincodecs_private.h"
29
30#include "wine/debug.h"
31
33
34#include "pshpack1.h"
35
36typedef struct {
46
47typedef struct
48{
53
54#include "poppack.h"
55
56typedef struct {
62 CRITICAL_SECTION lock; /* must be held when accessing stream */
64
65typedef struct {
69 double dpiX, dpiY;
72
74{
75 return CONTAINING_RECORD(iface, IcoDecoder, IWICBitmapDecoder_iface);
76}
77
79{
80 return CONTAINING_RECORD(iface, IcoFrameDecode, IWICBitmapFrameDecode_iface);
81}
82
84 void **ppv)
85{
87 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
88
89 if (!ppv) return E_INVALIDARG;
90
91 if (IsEqualIID(&IID_IUnknown, iid) ||
92 IsEqualIID(&IID_IWICBitmapSource, iid) ||
93 IsEqualIID(&IID_IWICBitmapFrameDecode, iid))
94 {
95 *ppv = &This->IWICBitmapFrameDecode_iface;
96 }
97 else
98 {
99 *ppv = NULL;
100 return E_NOINTERFACE;
101 }
102
103 IUnknown_AddRef((IUnknown*)*ppv);
104 return S_OK;
105}
106
108{
111
112 TRACE("(%p) refcount=%lu\n", iface, ref);
113
114 return ref;
115}
116
118{
121
122 TRACE("(%p) refcount=%lu\n", iface, ref);
123
124 if (ref == 0)
125 {
126 free(This->bits);
127 free(This);
128 }
129
130 return ref;
131}
132
134 UINT *puiWidth, UINT *puiHeight)
135{
137
138 *puiWidth = This->width;
139 *puiHeight = This->height;
140
141 TRACE("(%p) -> (%i,%i)\n", iface, *puiWidth, *puiHeight);
142
143 return S_OK;
144}
145
147 WICPixelFormatGUID *pPixelFormat)
148{
149 memcpy(pPixelFormat, &GUID_WICPixelFormat32bppBGRA, sizeof(GUID));
150 return S_OK;
151}
152
154 double *pDpiX, double *pDpiY)
155{
157
158 *pDpiX = This->dpiX;
159 *pDpiY = This->dpiY;
160
161 TRACE("(%p) -> (%f,%f)\n", iface, *pDpiX, *pDpiY);
162
163 return S_OK;
164}
165
167 IWICPalette *pIPalette)
168{
169 TRACE("(%p,%p)\n", iface, pIPalette);
171}
172
174 const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
175{
177 TRACE("(%p,%s,%u,%u,%p)\n", iface, debug_wic_rect(prc), cbStride, cbBufferSize, pbBuffer);
178
179 return copy_pixels(32, This->bits, This->width, This->height, This->width * 4,
180 prc, cbStride, cbBufferSize, pbBuffer);
181}
182
184 IWICMetadataQueryReader **ppIMetadataQueryReader)
185{
186 TRACE("(%p,%p)\n", iface, ppIMetadataQueryReader);
188}
189
191 UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount)
192{
193 TRACE("(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount);
195}
196
198 IWICBitmapSource **ppIThumbnail)
199{
200 TRACE("(%p,%p)\n", iface, ppIThumbnail);
201 return IWICBitmapFrameDecode_QueryInterface(iface, &IID_IWICBitmapSource, (void **)ppIThumbnail);
202}
203
204static const IWICBitmapFrameDecodeVtbl IcoFrameDecode_Vtbl = {
216};
217
218static inline void pixel_set_trans(DWORD* pixel, BOOL transparent)
219{
220 if (transparent) *pixel = 0;
221 else *pixel |= 0xff000000;
222}
223
225{
226 HRESULT hr;
227 BmpDecoder *bmp_decoder;
229 IWICBitmapFrameDecode *framedecode;
232 BOOL has_alpha=FALSE; /* if TRUE, alpha data might be in the image data */
233 WICRect rc;
234
235 hr = IcoDibDecoder_CreateInstance(&bmp_decoder);
236 if (SUCCEEDED(hr))
237 {
238 BmpDecoder_GetWICDecoder(bmp_decoder, &decoder);
239 hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnLoad);
240
241 if (SUCCEEDED(hr))
242 hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode);
243
244 if (SUCCEEDED(hr))
245 {
246 hr = IWICBitmapFrameDecode_GetSize(framedecode, &result->width, &result->height);
247
248 if (SUCCEEDED(hr))
249 {
250 result->bits = malloc(result->width * result->height * 4);
251 if (!result->bits) hr = E_OUTOFMEMORY;
252 }
253
254 if (SUCCEEDED(hr))
255 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &pixelformat);
256
257 if (IsEqualGUID(&pixelformat, &GUID_WICPixelFormat32bppBGR) ||
258 IsEqualGUID(&pixelformat, &GUID_WICPixelFormat32bppBGRA))
259 {
260 source = (IWICBitmapSource*)framedecode;
261 IWICBitmapSource_AddRef(source);
262 has_alpha = TRUE;
263 }
264 else
265 {
266 hr = WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA,
267 (IWICBitmapSource*)framedecode, &source);
268 has_alpha = FALSE;
269 }
270
271 if (SUCCEEDED(hr))
272 {
273 rc.X = 0;
274 rc.Y = 0;
275 rc.Width = result->width;
276 rc.Height = result->height;
277 hr = IWICBitmapSource_CopyPixels(source, &rc, result->width * 4,
278 result->width * result->height * 4, result->bits);
279
280 IWICBitmapSource_Release(source);
281 }
282
283 if (SUCCEEDED(hr))
284 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &result->dpiX, &result->dpiY);
285
286 IWICBitmapFrameDecode_Release(framedecode);
287 }
288
289 if (SUCCEEDED(hr) && has_alpha)
290 {
291 /* If the alpha channel is fully transparent, we should ignore it. */
292 int nonzero_alpha = 0;
293 UINT i;
294
295 for (i=0; i<(result->height*result->width); i++)
296 {
297 if (result->bits[i*4+3] != 0)
298 {
299 nonzero_alpha = 1;
300 break;
301 }
302 }
303
304 if (!nonzero_alpha)
305 {
306 for (i=0; i<(result->height*result->width); i++)
307 result->bits[i*4+3] = 0xff;
308
309 has_alpha = FALSE;
310 }
311 }
312
313 if (SUCCEEDED(hr) && !has_alpha)
314 {
315 /* set alpha data based on the AND mask */
316 UINT andBytesPerRow = (result->width+31)/32*4;
317 UINT andBytes = andBytesPerRow * result->height;
318 INT andStride;
319 BYTE *tempdata=NULL;
320 BYTE *andRow;
321 BYTE *bitsRow;
322 UINT bitsStride = result->width * 4;
323 UINT x, y;
325 ULONG bytesread;
327 int topdown;
328
329 BmpDecoder_FindIconMask(bmp_decoder, &offset, &topdown);
330
331 if (offset)
332 {
333 seek.QuadPart = offset;
334
335 hr = IStream_Seek(stream, seek, STREAM_SEEK_SET, 0);
336
337 if (SUCCEEDED(hr))
338 {
339 tempdata = malloc(andBytes);
340 if (!tempdata) hr = E_OUTOFMEMORY;
341 }
342
343 if (SUCCEEDED(hr))
344 hr = IStream_Read(stream, tempdata, andBytes, &bytesread);
345
346 if (SUCCEEDED(hr) && bytesread == andBytes)
347 {
348 if (topdown)
349 {
350 andStride = andBytesPerRow;
351 andRow = tempdata;
352 }
353 else
354 {
355 andStride = -andBytesPerRow;
356 andRow = tempdata + (result->height-1)*andBytesPerRow;
357 }
358
359 bitsRow = result->bits;
360 for (y=0; y<result->height; y++) {
361 BYTE *andByte=andRow;
362 DWORD *bitsPixel=(DWORD*)bitsRow;
363 for (x=0; x<result->width; x+=8) {
364 BYTE andVal=*andByte++;
365 pixel_set_trans(bitsPixel++, andVal>>7&1);
366 if (x+1 < result->width) pixel_set_trans(bitsPixel++, andVal>>6&1);
367 if (x+2 < result->width) pixel_set_trans(bitsPixel++, andVal>>5&1);
368 if (x+3 < result->width) pixel_set_trans(bitsPixel++, andVal>>4&1);
369 if (x+4 < result->width) pixel_set_trans(bitsPixel++, andVal>>3&1);
370 if (x+5 < result->width) pixel_set_trans(bitsPixel++, andVal>>2&1);
371 if (x+6 < result->width) pixel_set_trans(bitsPixel++, andVal>>1&1);
372 if (x+7 < result->width) pixel_set_trans(bitsPixel++, andVal&1);
373 }
374 andRow += andStride;
375 bitsRow += bitsStride;
376 }
377 }
378
379 free(tempdata);
380 }
381 }
382
383 IWICBitmapDecoder_Release(decoder);
384 }
385
386 return hr;
387}
388
390{
392 IWICBitmapFrameDecode *sourceFrame = NULL;
393 IWICBitmapSource *sourceBitmap = NULL;
395 HRESULT hr;
396
397 hr = PngDecoder_CreateInstance(&IID_IWICBitmapDecoder, (void**)&decoder);
398 if (FAILED(hr))
399 goto end;
400 hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnLoad);
401 if (FAILED(hr))
402 goto end;
403 hr = IWICBitmapDecoder_GetFrame(decoder, 0, &sourceFrame);
404 if (FAILED(hr))
405 goto end;
406 hr = WICConvertBitmapSource(&GUID_WICPixelFormat32bppBGRA, (IWICBitmapSource*)sourceFrame, &sourceBitmap);
407 if (FAILED(hr))
408 goto end;
409 hr = IWICBitmapFrameDecode_GetSize(sourceFrame, &result->width, &result->height);
410 if (FAILED(hr))
411 goto end;
412 hr = IWICBitmapFrameDecode_GetResolution(sourceFrame, &result->dpiX, &result->dpiY);
413 if (FAILED(hr))
414 goto end;
415 result->bits = malloc(4 * result->width * result->height);
416 if (result->bits == NULL)
417 {
419 goto end;
420 }
421 rect.X = 0;
422 rect.Y = 0;
423 rect.Width = result->width;
424 rect.Height = result->height;
425 hr = IWICBitmapSource_CopyPixels(sourceBitmap, &rect, 4*result->width,
426 4*result->width*result->height, result->bits);
427
428end:
429 if (decoder != NULL)
430 IWICBitmapDecoder_Release(decoder);
431 if (sourceFrame != NULL)
432 IWICBitmapFrameDecode_Release(sourceFrame);
433 if (sourceBitmap != NULL)
434 IWICBitmapSource_Release(sourceBitmap);
435 return hr;
436}
437
439 void **ppv)
440{
442 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
443
444 if (!ppv) return E_INVALIDARG;
445
446 if (IsEqualIID(&IID_IUnknown, iid) ||
447 IsEqualIID(&IID_IWICBitmapDecoder, iid))
448 {
449 *ppv = &This->IWICBitmapDecoder_iface;
450 }
451 else
452 {
453 *ppv = NULL;
454 return E_NOINTERFACE;
455 }
456
457 IUnknown_AddRef((IUnknown*)*ppv);
458 return S_OK;
459}
460
462{
465
466 TRACE("(%p) refcount=%lu\n", iface, ref);
467
468 return ref;
469}
470
472{
475
476 TRACE("(%p) refcount=%lu\n", iface, ref);
477
478 if (ref == 0)
479 {
480 This->lock.DebugInfo->Spare[0] = 0;
482 if (This->stream) IStream_Release(This->stream);
483 free(This);
484 }
485
486 return ref;
487}
488
490 DWORD *capability)
491{
492 HRESULT hr;
493
494 TRACE("(%p,%p,%p)\n", iface, stream, capability);
495
496 if (!stream || !capability) return E_INVALIDARG;
497
498 hr = IWICBitmapDecoder_Initialize(iface, stream, WICDecodeMetadataCacheOnDemand);
499 if (hr != S_OK) return hr;
500
502 return S_OK;
503}
504
506 WICDecodeOptions cacheOptions)
507{
510 HRESULT hr;
511 ULONG bytesread;
512 STATSTG statstg;
513 unsigned int i;
514
515 TRACE("(%p,%p,%x)\n", iface, pIStream, cacheOptions);
516
518
519 if (This->initialized)
520 {
522 goto end;
523 }
524
525 seek.QuadPart = 0;
526 hr = IStream_Seek(pIStream, seek, STREAM_SEEK_SET, NULL);
527 if (FAILED(hr)) goto end;
528
529 hr = IStream_Read(pIStream, &This->header, sizeof(ICONHEADER), &bytesread);
530 if (FAILED(hr)) goto end;
531
532 if (bytesread != sizeof(ICONHEADER))
533 {
535 goto end;
536 }
537
538 if (This->header.idReserved != 0 ||
539 This->header.idType != 1)
540 {
541 hr = E_FAIL;
542 goto end;
543 }
544
545 hr = IStream_Stat(pIStream, &statstg, STATFLAG_NONAME);
546 if (FAILED(hr))
547 {
548 WARN("Stat() failed, hr %#lx.\n", hr);
549 goto end;
550 }
551
552 for (i = 0; i < This->header.idCount; i++)
553 {
554 ICONDIRENTRY direntry;
555
556 hr = IStream_Read(pIStream, &direntry, sizeof(direntry), &bytesread);
557 if (FAILED(hr)) goto end;
558
559 if (bytesread != sizeof(direntry) || (direntry.dwDIBSize + direntry.dwDIBOffset > statstg.cbSize.QuadPart))
560 {
562 goto end;
563 }
564 }
565
566 This->initialized = TRUE;
567 This->stream = pIStream;
568 IStream_AddRef(pIStream);
569
570end:
571
573
574 return hr;
575}
576
578 GUID *pguidContainerFormat)
579{
580 memcpy(pguidContainerFormat, &GUID_ContainerFormatIco, sizeof(GUID));
581 return S_OK;
582}
583
585 IWICBitmapDecoderInfo **ppIDecoderInfo)
586{
587 TRACE("(%p,%p)\n", iface, ppIDecoderInfo);
588
589 return get_decoder_info(&CLSID_WICIcoDecoder, ppIDecoderInfo);
590}
591
593 IWICPalette *pIPalette)
594{
595 TRACE("(%p,%p)\n", iface, pIPalette);
597}
598
600 IWICMetadataQueryReader **ppIMetadataQueryReader)
601{
602 TRACE("(%p,%p)\n", iface, ppIMetadataQueryReader);
604}
605
607 IWICBitmapSource **ppIBitmapSource)
608{
609 TRACE("(%p,%p)\n", iface, ppIBitmapSource);
611}
612
614 UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount)
615{
616 TRACE("(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount);
618}
619
621 IWICBitmapSource **ppIThumbnail)
622{
623 TRACE("(%p,%p)\n", iface, ppIThumbnail);
625}
626
628 UINT *pCount)
629{
631
632 if (!pCount) return E_INVALIDARG;
633
635 *pCount = This->initialized ? This->header.idCount : 0;
637
638 TRACE("(%p) <-- %d\n", iface, *pCount);
639
640 return S_OK;
641}
642
644 UINT index, IWICBitmapFrameDecode **ppIBitmapFrame)
645{
650 HRESULT hr;
651 ULONG bytesread;
653 IWICStream *substream=NULL;
654 DWORD magic;
655 TRACE("(%p,%u,%p)\n", iface, index, ppIBitmapFrame);
656
658
659 if (!This->initialized)
660 {
662 goto fail;
663 }
664
665 if (This->header.idCount < index)
666 {
668 goto fail;
669 }
670
671 result = malloc(sizeof(IcoFrameDecode));
672 if (!result)
673 {
675 goto fail;
676 }
677
678 result->IWICBitmapFrameDecode_iface.lpVtbl = &IcoFrameDecode_Vtbl;
679 result->ref = 1;
680 result->bits = NULL;
681
682 /* read the icon entry */
683 seek.QuadPart = sizeof(ICONHEADER) + sizeof(ICONDIRENTRY) * index;
684 hr = IStream_Seek(This->stream, seek, STREAM_SEEK_SET, 0);
685 if (FAILED(hr)) goto fail;
686
687 hr = IStream_Read(This->stream, &entry, sizeof(ICONDIRENTRY), &bytesread);
688 if (FAILED(hr) || bytesread != sizeof(ICONDIRENTRY)) goto fail;
689
690 /* create a stream object for this icon */
691 hr = StreamImpl_Create(&substream);
692 if (FAILED(hr)) goto fail;
693
694 offset.QuadPart = entry.dwDIBOffset;
695 length.QuadPart = entry.dwDIBSize;
696 hr = IWICStream_InitializeFromIStreamRegion(substream, This->stream, offset, length);
697 if (FAILED(hr)) goto fail;
698
699 /* read the bitmapinfo size or magic number */
700 hr = IWICStream_Read(substream, &magic, sizeof(magic), &bytesread);
701 if (FAILED(hr) || bytesread != sizeof(magic)) goto fail;
702
703 /* forward to the appropriate decoding function based on the magic number */
704 switch (magic)
705 {
706 case sizeof(BITMAPCOREHEADER):
707 case 64: /* sizeof(BITMAPCOREHEADER2) */
708 case sizeof(BITMAPINFOHEADER):
709 case sizeof(BITMAPV4HEADER):
710 case sizeof(BITMAPV5HEADER):
711 hr = ReadIcoDib((IStream*)substream, result);
712 break;
713 case 0x474e5089:
714 hr = ReadIcoPng((IStream*)substream, result);
715 break;
716 default:
717 FIXME("Unrecognized ICO frame magic: %lx\n", magic);
718 hr = E_FAIL;
719 break;
720 }
721 if (FAILED(hr)) goto fail;
722
723 *ppIBitmapFrame = &result->IWICBitmapFrameDecode_iface;
724
726
727 IWICStream_Release(substream);
728
729 return S_OK;
730
731fail:
733 free(result);
734 if (substream) IWICStream_Release(substream);
735 if (SUCCEEDED(hr)) hr = E_FAIL;
736 TRACE("<-- %lx\n", hr);
737 return hr;
738}
739
740static const IWICBitmapDecoderVtbl IcoDecoder_Vtbl = {
755};
756
758{
760 HRESULT ret;
761
762 TRACE("(%s,%p)\n", debugstr_guid(iid), ppv);
763
764 *ppv = NULL;
765
766 This = malloc(sizeof(IcoDecoder));
767 if (!This) return E_OUTOFMEMORY;
768
769 This->IWICBitmapDecoder_iface.lpVtbl = &IcoDecoder_Vtbl;
770 This->ref = 1;
771 This->stream = NULL;
772 This->initialized = FALSE;
773#ifdef __REACTOS__
775#else
777#endif
778 This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IcoDecoder.lock");
779
780 ret = IWICBitmapDecoder_QueryInterface(&This->IWICBitmapDecoder_iface, iid, ppv);
781 IWICBitmapDecoder_Release(&This->IWICBitmapDecoder_iface);
782
783 return ret;
784}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define index(s, c)
Definition: various.h:29
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
void BmpDecoder_GetWICDecoder(BmpDecoder *This, IWICBitmapDecoder **ppDecoder)
Definition: bmpdecode.c:1245
void BmpDecoder_FindIconMask(BmpDecoder *This, ULONG *mask_offset, int *topdown)
Definition: bmpdecode.c:1251
HRESULT IcoDibDecoder_CreateInstance(BmpDecoder **ppDecoder)
Definition: bmpdecode.c:1240
void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *size, const struct pixel_format_desc *format) DECLSPEC_HIDDEN
Definition: surface.c:1700
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
#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
static GpStatus get_decoder_info(IStream *stream, const struct image_codec **result)
Definition: image.c:4285
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
pixelformat
Definition: converter.c:37
static HRESULT WINAPI IcoFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface, WICPixelFormatGUID *pPixelFormat)
Definition: icoformat.c:146
static HRESULT WINAPI IcoDecoder_CopyPalette(IWICBitmapDecoder *iface, IWICPalette *pIPalette)
Definition: icoformat.c:592
static HRESULT WINAPI IcoDecoder_GetContainerFormat(IWICBitmapDecoder *iface, GUID *pguidContainerFormat)
Definition: icoformat.c:577
static HRESULT WINAPI IcoDecoder_GetThumbnail(IWICBitmapDecoder *iface, IWICBitmapSource **ppIThumbnail)
Definition: icoformat.c:620
static HRESULT WINAPI IcoDecoder_GetPreview(IWICBitmapDecoder *iface, IWICBitmapSource **ppIBitmapSource)
Definition: icoformat.c:606
static HRESULT WINAPI IcoFrameDecode_GetResolution(IWICBitmapFrameDecode *iface, double *pDpiX, double *pDpiY)
Definition: icoformat.c:153
static ULONG WINAPI IcoDecoder_AddRef(IWICBitmapDecoder *iface)
Definition: icoformat.c:461
static HRESULT WINAPI IcoDecoder_GetColorContexts(IWICBitmapDecoder *iface, UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount)
Definition: icoformat.c:613
static ULONG WINAPI IcoDecoder_Release(IWICBitmapDecoder *iface)
Definition: icoformat.c:471
static HRESULT WINAPI IcoDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, void **ppv)
Definition: icoformat.c:438
static HRESULT ReadIcoDib(IStream *stream, IcoFrameDecode *result)
Definition: icoformat.c:224
static const IWICBitmapFrameDecodeVtbl IcoFrameDecode_Vtbl
Definition: icoformat.c:204
static const IWICBitmapDecoderVtbl IcoDecoder_Vtbl
Definition: icoformat.c:740
static HRESULT WINAPI IcoDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface, IWICMetadataQueryReader **ppIMetadataQueryReader)
Definition: icoformat.c:599
static HRESULT WINAPI IcoFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, IWICPalette *pIPalette)
Definition: icoformat.c:166
static HRESULT WINAPI IcoFrameDecode_GetMetadataQueryReader(IWICBitmapFrameDecode *iface, IWICMetadataQueryReader **ppIMetadataQueryReader)
Definition: icoformat.c:183
static HRESULT WINAPI IcoDecoder_GetDecoderInfo(IWICBitmapDecoder *iface, IWICBitmapDecoderInfo **ppIDecoderInfo)
Definition: icoformat.c:584
static HRESULT WINAPI IcoFrameDecode_GetColorContexts(IWICBitmapFrameDecode *iface, UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount)
Definition: icoformat.c:190
static HRESULT WINAPI IcoDecoder_QueryCapability(IWICBitmapDecoder *iface, IStream *stream, DWORD *capability)
Definition: icoformat.c:489
static HRESULT WINAPI IcoDecoder_Initialize(IWICBitmapDecoder *iface, IStream *pIStream, WICDecodeOptions cacheOptions)
Definition: icoformat.c:505
static HRESULT WINAPI IcoFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid, void **ppv)
Definition: icoformat.c:83
static void pixel_set_trans(DWORD *pixel, BOOL transparent)
Definition: icoformat.c:218
static HRESULT WINAPI IcoFrameDecode_GetSize(IWICBitmapFrameDecode *iface, UINT *puiWidth, UINT *puiHeight)
Definition: icoformat.c:133
static IcoDecoder * impl_from_IWICBitmapDecoder(IWICBitmapDecoder *iface)
Definition: icoformat.c:73
static HRESULT ReadIcoPng(IStream *stream, IcoFrameDecode *result)
Definition: icoformat.c:389
static ULONG WINAPI IcoFrameDecode_Release(IWICBitmapFrameDecode *iface)
Definition: icoformat.c:117
static ULONG WINAPI IcoFrameDecode_AddRef(IWICBitmapFrameDecode *iface)
Definition: icoformat.c:107
static HRESULT WINAPI IcoFrameDecode_GetThumbnail(IWICBitmapFrameDecode *iface, IWICBitmapSource **ppIThumbnail)
Definition: icoformat.c:197
static IcoFrameDecode * impl_from_IWICBitmapFrameDecode(IWICBitmapFrameDecode *iface)
Definition: icoformat.c:78
static HRESULT WINAPI IcoFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
Definition: icoformat.c:173
static HRESULT WINAPI IcoDecoder_GetFrame(IWICBitmapDecoder *iface, UINT index, IWICBitmapFrameDecode **ppIBitmapFrame)
Definition: icoformat.c:643
static HRESULT WINAPI IcoDecoder_GetFrameCount(IWICBitmapDecoder *iface, UINT *pCount)
Definition: icoformat.c:627
HRESULT IcoDecoder_CreateInstance(REFIID iid, void **ppv)
Definition: icoformat.c:757
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
Definition: info.c:2437
HRESULT PngDecoder_CreateInstance(REFIID iid, void **ppv)
Definition: pngformat.c:399
HRESULT StreamImpl_Create(IWICStream **stream)
Definition: stream.c:1158
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint GLuint end
Definition: gl.h:1545
GLint GLint GLsizei width
Definition: gl.h:1546
GLintptr offset
Definition: glext.h:5920
GLuint index
Definition: glext.h:6031
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
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
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_guid
Definition: kernel32.h:35
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int UINT
Definition: ndis.h:50
_Out_ LPRECT prc
Definition: ntgdi.h:1658
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
int seek(void *fd, ulong off, int mode)
Definition: pe.c:51
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
& rect
Definition: startmenu.cpp:1413
BYTE bReserved
Definition: icoformat.c:40
WORD wPlanes
Definition: icoformat.c:41
DWORD dwDIBSize
Definition: icoformat.c:43
WORD wBitCount
Definition: icoformat.c:42
BYTE bColorCount
Definition: icoformat.c:39
BYTE bHeight
Definition: icoformat.c:38
DWORD dwDIBOffset
Definition: icoformat.c:44
BYTE bWidth
Definition: icoformat.c:37
WORD idReserved
Definition: icoformat.c:49
WORD idType
Definition: icoformat.c:50
WORD idCount
Definition: icoformat.c:51
ICONHEADER header
Definition: icoformat.c:61
LONG ref
Definition: icoformat.c:58
BOOL initialized
Definition: icoformat.c:59
IWICBitmapDecoder IWICBitmapDecoder_iface
Definition: icoformat.c:57
IStream * stream
Definition: icoformat.c:60
CRITICAL_SECTION lock
Definition: icoformat.c:62
BYTE * bits
Definition: icoformat.c:70
IWICBitmapFrameDecode IWICBitmapFrameDecode_iface
Definition: icoformat.c:66
double dpiX
Definition: icoformat.c:69
INT Height
Definition: wincodec.idl:335
INT Width
Definition: wincodec.idl:334
Definition: send.c:48
Definition: parse.h:23
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define DWORD_PTR
Definition: treelist.c:76
int32_t INT
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
WICDecodeOptions
Definition: wincodec.idl:28
@ WICDecodeMetadataCacheOnDemand
Definition: wincodec.idl:29
@ WICDecodeMetadataCacheOnLoad
Definition: wincodec.idl:30
@ WICBitmapDecoderCapabilityCanDecodeAllImages
Definition: wincodec.idl:50
static const char * debug_wic_rect(const WICRect *rect)
#define WINAPI
Definition: msvc.h:6
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3281
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
Definition: winerror.h:3308
#define E_NOINTERFACE
Definition: winerror.h:2364
#define WINCODEC_ERR_BADIMAGE
Definition: winerror.h:3299
#define WINCODEC_ERR_PALETTEUNAVAILABLE
Definition: winerror.h:3292
#define WINCODEC_ERR_CODECNOTHUMBNAIL
Definition: winerror.h:3291
#define WINCODEC_ERR_FRAMEMISSING
Definition: winerror.h:3301
#define WINCODEC_ERR_STREAMREAD
Definition: winerror.h:3305
struct tagBITMAPCOREHEADER BITMAPCOREHEADER
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1116
unsigned char BYTE
Definition: xxhash.c:193