windowscodecs: Implemented GifFrameDecode_GetResolution.

This commit is contained in:
Joel Holdsworth 2010-10-07 00:21:10 +01:00 committed by Alexandre Julliard
parent e66a2f6d81
commit 57e00c851e
3 changed files with 12 additions and 3 deletions

View File

@ -123,8 +123,15 @@ static HRESULT WINAPI GifFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface
static HRESULT WINAPI GifFrameDecode_GetResolution(IWICBitmapFrameDecode *iface,
double *pDpiX, double *pDpiY)
{
FIXME("(%p,%p,%p): stub\n", iface, pDpiX, pDpiY);
return E_NOTIMPL;
GifFrameDecode *This = (GifFrameDecode*)iface;
const GifWord aspect_word = This->parent->gif->SAspectRatio;
const double aspect = (aspect_word > 0) ? ((aspect_word + 15.0) / 64.0) : 1.0;
TRACE("(%p,%p,%p)\n", iface, pDpiX, pDpiY);
*pDpiX = 96.0 / aspect;
*pDpiY = 96.0;
return S_OK;
}
static HRESULT WINAPI GifFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface,

View File

@ -285,6 +285,7 @@ DGifGetScreenDesc(GifFileType * GifFile) {
GifFile->SColorResolution = (((Buf[0] & 0x70) + 1) >> 4) + 1;
BitsPerPixel = (Buf[0] & 0x07) + 1;
GifFile->SBackGroundColor = Buf[1];
GifFile->SAspectRatio = Buf[2];
if (Buf[0] & 0x80) { /* Do we have global color map? */
GifFile->SColorMap = MakeMapObject(1 << BitsPerPixel, NULL);

View File

@ -100,7 +100,8 @@ typedef struct GifImageDesc {
typedef struct GifFileType {
GifWord SWidth, SHeight, /* Screen dimensions. */
SColorResolution, /* How many colors can we generate? */
SBackGroundColor; /* I hope you understand this one... */
SBackGroundColor, /* I hope you understand this one... */
SAspectRatio; /* Pixel aspect ratio, in 1/64 units, starting at 1:4. */
ColorMapObject *SColorMap; /* NULL if not exists. */
int ImageCount; /* Number of current image */
GifImageDesc Image; /* Block describing current image */