/*
* Copyright 2010 Vincent Povirk for CodeWeavers
+ * Copyright 2016 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
if (!This->source)
{
- hr = WINCODEC_ERR_WRONGSTATE;
+ hr = WINCODEC_ERR_NOTINITIALIZED;
goto end;
}
void **ppv)
{
BitmapScaler *This = impl_from_IMILBitmapScaler(iface);
-
TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
-
- if (!ppv) return E_INVALIDARG;
-
- if (IsEqualIID(&IID_IUnknown, iid) ||
- IsEqualIID(&IID_IMILBitmapScaler, iid) ||
- IsEqualIID(&IID_IMILBitmapSource, iid))
- {
- IUnknown_AddRef(&This->IMILBitmapScaler_iface);
- *ppv = &This->IMILBitmapScaler_iface;
- return S_OK;
- }
- else if (IsEqualIID(&IID_IWICBitmapScaler, iid) ||
- IsEqualIID(&IID_IWICBitmapSource, iid))
- {
- IUnknown_AddRef(&This->IWICBitmapScaler_iface);
- *ppv = &This->IWICBitmapScaler_iface;
- return S_OK;
- }
-
- FIXME("unknown interface %s\n", debugstr_guid(iid));
- *ppv = NULL;
- return E_NOINTERFACE;
+ return IWICBitmapScaler_QueryInterface(&This->IWICBitmapScaler_iface, iid, ppv);
}
static ULONG WINAPI IMILBitmapScaler_AddRef(IMILBitmapScaler *iface)
UINT *width, UINT *height)
{
BitmapScaler *This = impl_from_IMILBitmapScaler(iface);
-
TRACE("(%p,%p,%p)\n", iface, width, height);
-
- if (!This->source)
- return WINCODEC_ERR_NOTINITIALIZED;
-
return IWICBitmapScaler_GetSize(&This->IWICBitmapScaler_iface, width, height);
}
double *dpix, double *dpiy)
{
BitmapScaler *This = impl_from_IMILBitmapScaler(iface);
-
TRACE("(%p,%p,%p)\n", iface, dpix, dpiy);
-
- if (!This->source)
- return WINCODEC_ERR_NOTINITIALIZED;
-
return IWICBitmapScaler_GetResolution(&This->IWICBitmapScaler_iface, dpix, dpiy);
}
const WICRect *rc, UINT stride, UINT size, BYTE *buffer)
{
BitmapScaler *This = impl_from_IMILBitmapScaler(iface);
-
TRACE("(%p,%p,%u,%u,%p)\n", iface, rc, stride, size, buffer);
-
- if (!This->source)
- return WINCODEC_ERR_NOTINITIALIZED;
-
return IWICBitmapScaler_CopyPixels(&This->IWICBitmapScaler_iface, rc, stride, size, buffer);
}