97 *
ppv = &
This->IWICBitmapFrameDecode_iface;
114 TRACE(
"(%p) refcount=%u\n", iface,
ref);
124 TRACE(
"(%p) refcount=%u\n", iface,
ref);
140 *puiWidth =
This->width;
141 *puiHeight =
This->height;
143 TRACE(
"(%p) -> (%i,%i)\n", iface, *puiWidth, *puiHeight);
151 memcpy(pPixelFormat, &GUID_WICPixelFormat32bppBGRA,
sizeof(
GUID));
156 double *pDpiX,
double *pDpiY)
163 TRACE(
"(%p) -> (%f,%f)\n", iface, *pDpiX, *pDpiY);
171 TRACE(
"(%p,%p)\n", iface, pIPalette);
182 prc, cbStride, cbBufferSize, pbBuffer);
188 TRACE(
"(%p,%p)\n", iface, ppIMetadataQueryReader);
195 TRACE(
"(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount);
202 TRACE(
"(%p,%p)\n", iface, ppIThumbnail);
203 return IWICBitmapFrameDecode_QueryInterface(iface, &IID_IWICBitmapSource, (
void **)ppIThumbnail);
222 if (transparent) *pixel = 0;
223 else *pixel |= 0xff000000;
244 hr = IWICBitmapDecoder_GetFrame(decoder, 0, &framedecode);
248 hr = IWICBitmapFrameDecode_GetSize(framedecode, &
result->width, &
result->height);
257 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &
pixelformat);
263 IWICBitmapSource_AddRef(
source);
282 IWICBitmapSource_Release(
source);
286 hr = IWICBitmapFrameDecode_GetResolution(framedecode, &
result->dpiX, &
result->dpiY);
288 IWICBitmapFrameDecode_Release(framedecode);
294 int nonzero_alpha = 0;
318 UINT andBytesPerRow = (
result->width+31)/32*4;
319 UINT andBytes = andBytesPerRow *
result->height;
346 hr = IStream_Read(
stream, tempdata, andBytes, &bytesread);
352 andStride = andBytesPerRow;
357 andStride = -andBytesPerRow;
358 andRow = tempdata + (
result->height-1)*andBytesPerRow;
363 BYTE *andByte=andRow;
366 BYTE andVal=*andByte++;
377 bitsRow += bitsStride;
385 IWICBitmapDecoder_Release(decoder);
405 hr = IWICBitmapDecoder_GetFrame(decoder, 0, &sourceFrame);
411 hr = IWICBitmapFrameDecode_GetSize(sourceFrame, &
result->width, &
result->height);
414 hr = IWICBitmapFrameDecode_GetResolution(sourceFrame, &
result->dpiX, &
result->dpiY);
427 hr = IWICBitmapSource_CopyPixels(sourceBitmap, &
rect, 4*
result->width,
432 IWICBitmapDecoder_Release(decoder);
433 if (sourceFrame !=
NULL)
434 IWICBitmapFrameDecode_Release(sourceFrame);
435 if (sourceBitmap !=
NULL)
436 IWICBitmapSource_Release(sourceBitmap);
451 *
ppv = &
This->IWICBitmapDecoder_iface;
468 TRACE(
"(%p) refcount=%u\n", iface,
ref);
478 TRACE(
"(%p) refcount=%u\n", iface,
ref);
482 This->lock.DebugInfo->Spare[0] = 0;
484 if (
This->stream) IStream_Release(
This->stream);
517 TRACE(
"(%p,%p,%x)\n", iface, pIStream, cacheOptions);
521 if (
This->initialized)
528 hr = IStream_Seek(pIStream,
seek, STREAM_SEEK_SET,
NULL);
540 if (
This->header.idReserved != 0 ||
541 This->header.idType != 1)
547 hr = IStream_Stat(pIStream, &statstg, STATFLAG_NONAME);
550 WARN(
"Stat() failed, hr %#x.\n",
hr);
554 for (
i = 0;
i <
This->header.idCount;
i++)
558 hr = IStream_Read(pIStream, &direntry,
sizeof(direntry), &bytesread);
561 if (bytesread !=
sizeof(direntry) || (direntry.
dwDIBSize + direntry.
dwDIBOffset > statstg.cbSize.QuadPart))
569 This->stream = pIStream;
570 IStream_AddRef(pIStream);
580 GUID *pguidContainerFormat)
582 memcpy(pguidContainerFormat, &GUID_ContainerFormatIco,
sizeof(
GUID));
589 TRACE(
"(%p,%p)\n", iface, ppIDecoderInfo);
597 TRACE(
"(%p,%p)\n", iface, pIPalette);
604 TRACE(
"(%p,%p)\n", iface, ppIMetadataQueryReader);
611 TRACE(
"(%p,%p)\n", iface, ppIBitmapSource);
618 TRACE(
"(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount);
625 TRACE(
"(%p,%p)\n", iface, ppIThumbnail);
637 *pCount =
This->initialized ?
This->header.idCount : 0;
640 TRACE(
"(%p) <-- %d\n", iface, *pCount);
657 TRACE(
"(%p,%u,%p)\n", iface,
index, ppIBitmapFrame);
661 if (!
This->initialized)
686 hr = IStream_Seek(
This->stream,
seek, STREAM_SEEK_SET, 0);
702 hr = IWICStream_Read(substream, &magic,
sizeof(magic), &bytesread);
703 if (
FAILED(
hr) || bytesread !=
sizeof(magic))
goto fail;
712 case sizeof(BITMAPV5HEADER):
719 FIXME(
"Unrecognized ICO frame magic: %x\n", magic);
725 *ppIBitmapFrame = &
result->IWICBitmapFrameDecode_iface;
729 IWICStream_Release(substream);
736 if (substream) IWICStream_Release(substream);
776 This->lock.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": IcoDecoder.lock");
778 ret = IWICBitmapDecoder_QueryInterface(&
This->IWICBitmapDecoder_iface, iid,
ppv);
779 IWICBitmapDecoder_Release(&
This->IWICBitmapDecoder_iface);
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void BmpDecoder_GetWICDecoder(BmpDecoder *This, IWICBitmapDecoder **ppDecoder)
void BmpDecoder_FindIconMask(BmpDecoder *This, ULONG *mask_offset, int *topdown)
HRESULT IcoDibDecoder_CreateInstance(BmpDecoder **ppDecoder)
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
#define HeapFree(x, y, z)
static GpStatus get_decoder_info(IStream *stream, const struct image_codec **result)
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
HRESULT StreamImpl_Create(IWICStream **stream)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei width
GLuint GLsizei GLsizei * length
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
#define memcpy(s1, s2, n)
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
int seek(void *fd, ulong off, int mode)
IWICBitmapDecoder IWICBitmapDecoder_iface
IWICBitmapFrameDecode IWICBitmapFrameDecode_iface
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
#define CONTAINING_RECORD(address, type, field)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
@ WICDecodeMetadataCacheOnDemand
@ WICDecodeMetadataCacheOnLoad
@ WICBitmapDecoderCapabilityCanDecodeAllImages
static const char * debug_wic_rect(const WICRect *rect)
#define WINCODEC_ERR_WRONGSTATE
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
#define WINCODEC_ERR_BADIMAGE
#define WINCODEC_ERR_PALETTEUNAVAILABLE
#define WINCODEC_ERR_CODECNOTHUMBNAIL
#define WINCODEC_ERR_FRAMEMISSING
#define WINCODEC_ERR_STREAMREAD
struct tagBITMAPCOREHEADER BITMAPCOREHEADER