Commit 64146fa9 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

windowscodecs: Support more formats in the BMP encoder.

parent 48cf4536
......@@ -47,6 +47,13 @@ struct bmp_pixelformat {
static const struct bmp_pixelformat formats[] = {
{&GUID_WICPixelFormat24bppBGR, 24, BI_RGB},
{&GUID_WICPixelFormat16bppBGR555, 16, BI_RGB},
{&GUID_WICPixelFormat16bppBGR565, 16, BI_BITFIELDS, 0xf800, 0x7e0, 0x1f, 0},
{&GUID_WICPixelFormat32bppBGR, 32, BI_RGB},
#if 0
/* Windows doesn't seem to support this one. */
{&GUID_WICPixelFormat32bppBGRA, 32, BI_BITFIELDS, 0xff0000, 0xff00, 0xff, 0xff000000},
#endif
{NULL}
};
......@@ -338,6 +345,19 @@ static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface)
bih.bV5ClrUsed = 0;
bih.bV5ClrImportant = 0;
if (This->format->compression == BI_BITFIELDS)
{
if (This->format->alphamask)
bih.bV5Size = info_size = sizeof(BITMAPV4HEADER);
else
info_size = sizeof(BITMAPINFOHEADER)+12;
bih.bV5RedMask = This->format->redmask;
bih.bV5GreenMask = This->format->greenmask;
bih.bV5BlueMask = This->format->bluemask;
bih.bV5AlphaMask = This->format->alphamask;
bih.bV5AlphaMask = LCS_DEVICE_RGB;
}
bfh.bfSize = sizeof(BITMAPFILEHEADER) + info_size + bih.bV5SizeImage;
bfh.bfOffBits = sizeof(BITMAPFILEHEADER) + info_size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment