106 *
ppv = &
This->IWICBitmapFrameDecode_iface;
122 return IWICBitmapDecoder_AddRef(&
This->IWICBitmapDecoder_iface);
129 return IWICBitmapDecoder_Release(&
This->IWICBitmapDecoder_iface);
136 TRACE(
"(%p,%p,%p)\n", iface, puiWidth, puiHeight);
146 *puiWidth =
This->bih.bV5Width;
147 *puiHeight =
abs(
This->bih.bV5Height);
156 TRACE(
"(%p,%p)\n", iface, pPixelFormat);
165 LONG resx = 0, resy = 0;
167 switch (bih->bV5Size)
176 case sizeof(BITMAPV5HEADER):
177 resx = bih->bV5XPelsPerMeter;
178 resy = bih->bV5YPelsPerMeter;
189 *pDpiX = resx * 0.0254;
190 *pDpiY = resy * 0.0254;
197 double *pDpiX,
double *pDpiY)
200 TRACE(
"(%p,%p,%p)\n", iface, pDpiX, pDpiY);
214 TRACE(
"(%p,%p)\n", iface, pIPalette);
224 ULONG tablesize, bytesread;
232 if (!wiccolors || !bgrcolors)
242 hr = IStream_Read(
This->stream, bgrcolors, tablesize, &bytesread);
244 if (bytesread != tablesize) {
251 wiccolors[
i] = 0xff000000|
253 (bgrcolors[
i].rgbtGreen<<8)|
265 if (
This->bih.bV5BitCount <= 8)
267 ULONG tablesize, bytesread;
271 if (
This->bih.bV5ClrUsed == 0)
288 hr = IStream_Read(
This->stream, wiccolors, tablesize, &bytesread);
290 if (bytesread != tablesize) {
297 wiccolors[
i] |= 0xff000000;
311 hr = IWICPalette_InitializeCustom(pIPalette, wiccolors,
count);
327 if (!
This->imagedata)
339 prc, cbStride, cbBufferSize, pbBuffer);
345 TRACE(
"(%p,%p)\n", iface, ppIMetadataQueryReader);
352 TRACE(
"(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount);
359 TRACE(
"(%p,%p)\n", iface, ppIThumbnail);
384 bottomup = (
This->bih.bV5Height > 0);
388 bytesperrow = (((
width *
This->bitsperpixel)+31)/32)*4;
395 hr = IStream_Seek(
This->stream, offbits, STREAM_SEEK_SET,
NULL);
403 This->imagedatastart =
This->imagedata + (
height-1) * bytesperrow;
404 This->stride = -bytesperrow;
408 This->imagedatastart =
This->imagedata;
409 This->stride = bytesperrow;
425 hr = IWICBitmapFrameDecode_GetSize(&
This->IWICBitmapFrameDecode_iface, &
width, &
height);
446 if (*bytesread == 0 || *
cursor == *bytesread)
478 bytesperrow =
width * 4;
480 if (
This->bih.bV5ClrUsed &&
This->bih.bV5ClrUsed < 256)
481 palettesize = 4 *
This->bih.bV5ClrUsed;
483 palettesize = 4 * 256;
486 if (!
This->imagedata)
494 hr = IStream_Seek(
This->stream, offbits, STREAM_SEEK_SET,
NULL);
497 hr = IStream_Read(
This->stream,
palette, palettesize, &bytesread);
498 if (
FAILED(
hr) || bytesread != palettesize)
goto fail;
502 hr = IStream_Seek(
This->stream, offbits, STREAM_SEEK_SET,
NULL);
575 This->imagedatastart =
This->imagedata + (
height-1) * bytesperrow;
576 This->stride = -bytesperrow;
602 bytesperrow =
width * 4;
604 if (
This->bih.bV5ClrUsed &&
This->bih.bV5ClrUsed < 16)
605 palettesize = 4 *
This->bih.bV5ClrUsed;
607 palettesize = 4 * 16;
610 if (!
This->imagedata)
618 hr = IStream_Seek(
This->stream, offbits, STREAM_SEEK_SET,
NULL);
621 hr = IStream_Read(
This->stream,
palette, palettesize, &bytesread);
622 if (
FAILED(
hr) || bytesread != palettesize)
goto fail;
626 hr = IStream_Seek(
This->stream, offbits, STREAM_SEEK_SET,
NULL);
705 bgrdata[
y*
width +
x++] = color1;
707 bgrdata[
y*
width +
x++] = color2;
715 This->imagedatastart =
This->imagedata + (
height-1) * bytesperrow;
716 This->stride = -bytesperrow;
769 ULONG bytestoread, bytesread;
790 if (bytesread !=
sizeof(
DWORD) ||
795 This->bih.bV5Size !=
sizeof(BITMAPV5HEADER)))
return E_FAIL;
797 bytestoread =
This->bih.bV5Size-
sizeof(
DWORD);
798 hr = IStream_Read(
stream, &
This->bih.bV5Width, bytestoread, &bytesread);
800 if (bytestoread != bytesread)
return E_FAIL;
803 This->palette_offset =
This->bih.bV5Size;
816 This->bih.bV5Height /= 2;
825 hr = IStream_Read(
stream, &
This->bih.bV5RedMask, 12, &bytesread);
827 if (bytesread != 12)
return E_FAIL;
828 This->bih.bV5AlphaMask = 0;
829 This->palette_offset += 12;
842 This->pixelformat = &GUID_WICPixelFormat1bppIndexed;
845 This->pixelformat = &GUID_WICPixelFormat2bppIndexed;
848 This->pixelformat = &GUID_WICPixelFormat4bppIndexed;
851 This->pixelformat = &GUID_WICPixelFormat8bppIndexed;
854 This->pixelformat = &GUID_WICPixelFormat24bppBGR;
857 This->pixelformat = &GUID_WICPixelFormatUndefined;
858 WARN(
"unsupported bit depth %i for BITMAPCOREHEADER\n", bch->
bcBitCount);
864 TRACE(
"bitmap header=%i compression=%i depth=%i\n",
This->bih.bV5Size,
This->bih.bV5Compression,
This->bih.bV5BitCount);
865 switch(
This->bih.bV5Compression)
868 This->bitsperpixel =
This->bih.bV5BitCount;
870 switch(
This->bih.bV5BitCount)
873 This->pixelformat = &GUID_WICPixelFormat1bppIndexed;
876 This->pixelformat = &GUID_WICPixelFormat2bppIndexed;
879 This->pixelformat = &GUID_WICPixelFormat4bppIndexed;
882 This->pixelformat = &GUID_WICPixelFormat8bppIndexed;
885 This->pixelformat = &GUID_WICPixelFormat16bppBGR555;
888 This->pixelformat = &GUID_WICPixelFormat24bppBGR;
891 This->pixelformat = &GUID_WICPixelFormat32bppBGR;
894 This->pixelformat = &GUID_WICPixelFormatUndefined;
895 FIXME(
"unsupported bit depth %i for uncompressed RGB\n",
This->bih.bV5BitCount);
899 This->bitsperpixel = 32;
901 This->pixelformat = &GUID_WICPixelFormat32bppBGR;
904 This->bitsperpixel = 32;
906 This->pixelformat = &GUID_WICPixelFormat32bppBGR;
914 This->bitsperpixel = 0;
916 This->pixelformat = &GUID_WICPixelFormatUndefined;
917 FIXME(
"Huffman 1D compression is unsupported\n");
920 This->bitsperpixel =
This->bih.bV5BitCount;
923 if ((
format->bitcount ==
This->bih.bV5BitCount) &&
925 (
format->greenmask ==
This->bih.bV5GreenMask) &&
926 (
format->bluemask ==
This->bih.bV5BlueMask) &&
927 (
format->alphamask ==
This->bih.bV5AlphaMask))
929 This->read_data_func =
format->read_data_func;
937 This->pixelformat = &GUID_WICPixelFormatUndefined;
938 FIXME(
"unsupported bitfields type depth=%i red=%x green=%x blue=%x alpha=%x\n",
939 This->bih.bV5BitCount,
This->bih.bV5RedMask,
This->bih.bV5GreenMask,
This->bih.bV5BlueMask,
This->bih.bV5AlphaMask);
944 This->bitsperpixel = 0;
946 This->pixelformat = &GUID_WICPixelFormatUndefined;
947 FIXME(
"unsupported bitmap type header=%i compression=%i depth=%i\n",
This->bih.bV5Size,
This->bih.bV5Compression,
This->bih.bV5BitCount);
956 if (
This->bih.bV5ClrUsed)
957 palette_count =
This->bih.bV5ClrUsed;
958 else if (
This->bih.bV5BitCount <= 8)
959 palette_count = 1 <<
This->bih.bV5BitCount;
985 *
ppv = &
This->IWICBitmapDecoder_iface;
1002 TRACE(
"(%p) refcount=%u\n", iface,
ref);
1012 TRACE(
"(%p) refcount=%u\n", iface,
ref);
1016 if (
This->stream) IStream_Release(
This->stream);
1018 This->lock.DebugInfo->Spare[0] = 0;
1054 This->stream = pIStream;
1055 IStream_AddRef(pIStream);
1063 GUID *pguidContainerFormat)
1065 memcpy(pguidContainerFormat, &GUID_ContainerFormatBmp,
sizeof(
GUID));
1072 TRACE(
"(%p,%p)\n", iface, ppIDecoderInfo);
1080 TRACE(
"(%p,%p)\n", iface, pIPalette);
1088 TRACE(
"(%p,%p)\n", iface, ppIMetadataQueryReader);
1095 TRACE(
"(%p,%p)\n", iface, ppIBitmapSource);
1102 TRACE(
"(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount);
1109 TRACE(
"(%p,%p)\n", iface, ppIThumbnail);
1131 *ppIBitmapFrame = &
This->IWICBitmapFrameDecode_iface;
1132 IWICBitmapDecoder_AddRef(iface);
1168 This->lock.DebugInfo->Spare[0] = (
DWORD_PTR)(__FILE__
": BmpDecoder.lock");
1170 This->icoframe = icoframe;
1189 ret = IWICBitmapDecoder_QueryInterface(&
This->IWICBitmapDecoder_iface, iid,
ppv);
1190 IWICBitmapDecoder_Release(&
This->IWICBitmapDecoder_iface);
1212 *ppDecoder = &
This->IWICBitmapDecoder_iface;
1224 IWICBitmapFrameDecode_GetSize(&
This->IWICBitmapFrameDecode_iface, &
width, &
height);
1225 bytesperrow = (((
width *
This->bitsperpixel)+31)/32)*4;
1232 *topdown =
This->stride > 0;
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static ULONG WINAPI BmpDecoder_AddRef(IWICBitmapDecoder *iface)
static HRESULT WINAPI BmpFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, IWICPalette *pIPalette)
static HRESULT WINAPI BmpDecoder_GetContainerFormat(IWICBitmapDecoder *iface, GUID *pguidContainerFormat)
static HRESULT WINAPI BmpDecoder_GetColorContexts(IWICBitmapDecoder *iface, UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount)
static ULONG WINAPI BmpDecoder_Release(IWICBitmapDecoder *iface)
static HRESULT WINAPI BmpDecoder_QueryCapability(IWICBitmapDecoder *iface, IStream *stream, DWORD *capability)
HRESULT DibDecoder_CreateInstance(REFIID iid, void **ppv)
static HRESULT WINAPI BmpFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid, void **ppv)
HRESULT(* ReadDataFunc)(BmpDecoder *This)
static const IWICBitmapFrameDecodeVtbl BmpDecoder_FrameVtbl
static HRESULT BmpDecoder_Create(int packed, int icoframe, BmpDecoder **ppDecoder)
static HRESULT BmpFrameDecode_ReadRLE8(BmpDecoder *This)
static HRESULT WINAPI BmpDecoder_CopyPalette(IWICBitmapDecoder *iface, IWICPalette *pIPalette)
static BmpDecoder * impl_from_IWICBitmapFrameDecode(IWICBitmapFrameDecode *iface)
void BmpDecoder_GetWICDecoder(BmpDecoder *This, IWICBitmapDecoder **ppDecoder)
static HRESULT WINAPI BmpDecoder_GetFrame(IWICBitmapDecoder *iface, UINT index, IWICBitmapFrameDecode **ppIBitmapFrame)
void BmpDecoder_FindIconMask(BmpDecoder *This, ULONG *mask_offset, int *topdown)
static HRESULT BmpDecoder_Construct(int packed, int icoframe, REFIID iid, void **ppv)
static HRESULT WINAPI BmpDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, void **ppv)
static const struct bitfields_format bitfields_formats[]
static HRESULT BmpFrameDecode_ReadUnsupported(BmpDecoder *This)
static HRESULT WINAPI BmpDecoder_GetThumbnail(IWICBitmapDecoder *iface, IWICBitmapSource **ppIThumbnail)
static HRESULT WINAPI BmpDecoder_Initialize(IWICBitmapDecoder *iface, IStream *pIStream, WICDecodeOptions cacheOptions)
HRESULT BmpDecoder_CreateInstance(REFIID iid, void **ppv)
static HRESULT WINAPI BmpDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface, IWICMetadataQueryReader **ppIMetadataQueryReader)
static HRESULT WINAPI BmpDecoder_GetFrameCount(IWICBitmapDecoder *iface, UINT *pCount)
static HRESULT WINAPI BmpFrameDecode_GetResolution(IWICBitmapFrameDecode *iface, double *pDpiX, double *pDpiY)
static HRESULT BmpFrameDecode_ReadRGB8(BmpDecoder *This)
static HRESULT BmpFrameDecode_ReadUncompressed(BmpDecoder *This)
HRESULT IcoDibDecoder_CreateInstance(BmpDecoder **ppDecoder)
static const IWICBitmapDecoderVtbl BmpDecoder_Vtbl
static HRESULT BmpFrameDecode_ReadRLE4(BmpDecoder *This)
static HRESULT WINAPI BmpFrameDecode_GetThumbnail(IWICBitmapFrameDecode *iface, IWICBitmapSource **ppIThumbnail)
static HRESULT WINAPI BmpDecoder_GetDecoderInfo(IWICBitmapDecoder *iface, IWICBitmapDecoderInfo **ppIDecoderInfo)
static ULONG WINAPI BmpFrameDecode_Release(IWICBitmapFrameDecode *iface)
static HRESULT BmpDecoder_ReadHeaders(BmpDecoder *This, IStream *stream)
static HRESULT WINAPI BmpFrameDecode_GetMetadataQueryReader(IWICBitmapFrameDecode *iface, IWICMetadataQueryReader **ppIMetadataQueryReader)
static HRESULT ReadByte(IStream *stream, BYTE *buffer, ULONG buffer_size, ULONG *cursor, ULONG *bytesread, BYTE *result)
static HRESULT WINAPI BmpDecoder_GetPreview(IWICBitmapDecoder *iface, IWICBitmapSource **ppIBitmapSource)
static HRESULT WINAPI BmpFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface, WICPixelFormatGUID *pPixelFormat)
static BmpDecoder * impl_from_IWICBitmapDecoder(IWICBitmapDecoder *iface)
static HRESULT BmpHeader_GetResolution(BITMAPV5HEADER *bih, double *pDpiX, double *pDpiY)
static ULONG WINAPI BmpFrameDecode_AddRef(IWICBitmapFrameDecode *iface)
static HRESULT WINAPI BmpFrameDecode_GetColorContexts(IWICBitmapFrameDecode *iface, UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount)
static HRESULT WINAPI BmpFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
static HRESULT WINAPI BmpFrameDecode_GetSize(IWICBitmapFrameDecode *iface, UINT *puiWidth, UINT *puiHeight)
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
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
static unsigned int palette_size(DWORD flags)
#define HeapFree(x, y, z)
static GpStatus get_decoder_info(IStream *stream, const struct image_codec **result)
void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLuint GLsizei GLsizei * length
GLuint GLenum GLsizei GLsizei GLint GLint GLboolean packed
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 IsEqualIID(riid1, riid2)
int seek(void *fd, ulong off, int mode)
IWICBitmapDecoder IWICBitmapDecoder_iface
const WICPixelFormatGUID * pixelformat
ReadDataFunc read_data_func
IWICBitmapFrameDecode IWICBitmapFrameDecode_iface
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
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
@ WICBitmapDecoderCapabilityCanDecodeAllImages
static const char * debug_wic_rect(const WICRect *rect)
#define WINCODEC_ERR_WRONGSTATE
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
#define WINCODEC_ERR_PALETTEUNAVAILABLE
#define WINCODEC_ERR_CODECNOTHUMBNAIL
#define WINCODEC_ERR_FRAMEMISSING
struct tagBITMAPFILEHEADER BITMAPFILEHEADER
struct tagRGBTRIPLE RGBTRIPLE
struct tagBITMAPCOREHEADER BITMAPCOREHEADER