Commit 78c3aa78 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

windowscodecs: Implement GetResolution for BMP decoder.

parent 7c7f70a3
...@@ -155,11 +155,33 @@ static HRESULT WINAPI BmpFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface ...@@ -155,11 +155,33 @@ static HRESULT WINAPI BmpFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT BmpHeader_GetResolution(BITMAPV5HEADER *bih, double *pDpiX, double *pDpiY)
{
switch (bih->bV5Size)
{
case sizeof(BITMAPCOREHEADER):
*pDpiX = 96.0;
*pDpiY = 96.0;
return S_OK;
case sizeof(BITMAPCOREHEADER2):
case sizeof(BITMAPINFOHEADER):
case sizeof(BITMAPV4HEADER):
case sizeof(BITMAPV5HEADER):
*pDpiX = bih->bV5XPelsPerMeter * 0.0254;
*pDpiY = bih->bV5YPelsPerMeter * 0.0254;
return S_OK;
default:
return E_FAIL;
}
}
static HRESULT WINAPI BmpFrameDecode_GetResolution(IWICBitmapFrameDecode *iface, static HRESULT WINAPI BmpFrameDecode_GetResolution(IWICBitmapFrameDecode *iface,
double *pDpiX, double *pDpiY) double *pDpiX, double *pDpiY)
{ {
FIXME("(%p,%p,%p): stub\n", iface, pDpiX, pDpiY); BmpFrameDecode *This = (BmpFrameDecode*)iface;
return E_NOTIMPL; TRACE("(%p,%p,%p)\n", iface, pDpiX, pDpiY);
return BmpHeader_GetResolution(&This->bih, pDpiX, pDpiY);
} }
static HRESULT WINAPI BmpFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, static HRESULT WINAPI BmpFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface,
......
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