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;
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
static HRESULT BmpFrameDecode_ReadRLE4(BmpDecoder *This)
static HRESULT BmpFrameDecode_ReadUncompressed(BmpDecoder *This)
static const struct bitfields_format bitfields_formats[]
struct tagRGBTRIPLE RGBTRIPLE
int seek(void *fd, ulong off, int mode)
static unsigned int palette_size(DWORD flags)
static HRESULT BmpFrameDecode_ReadRLE8(BmpDecoder *This)
static HRESULT BmpFrameDecode_ReadUnsupported(BmpDecoder *This)
#define WINCODEC_ERR_WRONGSTATE
struct tagBITMAPFILEHEADER BITMAPFILEHEADER