windowscodecs: Implement GetSize for BMP decoder.
This commit is contained in:
parent
eca8ef6924
commit
7c7f70a317
@ -116,11 +116,36 @@ static ULONG WINAPI BmpFrameDecode_Release(IWICBitmapFrameDecode *iface)
|
|||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HRESULT BmpHeader_GetSize(BITMAPV5HEADER *bih, UINT *puiWidth, UINT *puiHeight)
|
||||||
|
{
|
||||||
|
switch (bih->bV5Size)
|
||||||
|
{
|
||||||
|
case sizeof(BITMAPCOREHEADER):
|
||||||
|
{
|
||||||
|
BITMAPCOREHEADER *bch = (BITMAPCOREHEADER*)bih;
|
||||||
|
*puiWidth = bch->bcWidth;
|
||||||
|
*puiHeight = bch->bcHeight;
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
case sizeof(BITMAPCOREHEADER2):
|
||||||
|
case sizeof(BITMAPINFOHEADER):
|
||||||
|
case sizeof(BITMAPV4HEADER):
|
||||||
|
case sizeof(BITMAPV5HEADER):
|
||||||
|
*puiWidth = bih->bV5Width;
|
||||||
|
*puiHeight = bih->bV5Height;
|
||||||
|
return S_OK;
|
||||||
|
default:
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI BmpFrameDecode_GetSize(IWICBitmapFrameDecode *iface,
|
static HRESULT WINAPI BmpFrameDecode_GetSize(IWICBitmapFrameDecode *iface,
|
||||||
UINT *puiWidth, UINT *puiHeight)
|
UINT *puiWidth, UINT *puiHeight)
|
||||||
{
|
{
|
||||||
FIXME("(%p,%p,%p): stub\n", iface, puiWidth, puiHeight);
|
BmpFrameDecode *This = (BmpFrameDecode*)iface;
|
||||||
return E_NOTIMPL;
|
TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
|
||||||
|
|
||||||
|
return BmpHeader_GetSize(&This->bih, puiWidth, puiHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI BmpFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface,
|
static HRESULT WINAPI BmpFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user