Commit 6d39e6ab authored by Ziqing Hui's avatar Ziqing Hui Committed by Alexandre Julliard

windowscodecs: Add stub for IWICDdsEncoder.

parent dba8d3c3
...@@ -161,6 +161,7 @@ typedef struct DdsFrameDecode { ...@@ -161,6 +161,7 @@ typedef struct DdsFrameDecode {
typedef struct DdsEncoder { typedef struct DdsEncoder {
IWICBitmapEncoder IWICBitmapEncoder_iface; IWICBitmapEncoder IWICBitmapEncoder_iface;
IWICDdsEncoder IWICDdsEncoder_iface;
LONG ref; LONG ref;
CRITICAL_SECTION lock; CRITICAL_SECTION lock;
IStream *stream; IStream *stream;
...@@ -710,6 +711,11 @@ static inline DdsEncoder *impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface) ...@@ -710,6 +711,11 @@ static inline DdsEncoder *impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
return CONTAINING_RECORD(iface, DdsEncoder, IWICBitmapEncoder_iface); return CONTAINING_RECORD(iface, DdsEncoder, IWICBitmapEncoder_iface);
} }
static inline DdsEncoder *impl_from_IWICDdsEncoder(IWICDdsEncoder *iface)
{
return CONTAINING_RECORD(iface, DdsEncoder, IWICDdsEncoder_iface);
}
static inline DdsFrameEncode *impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface) static inline DdsFrameEncode *impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
{ {
return CONTAINING_RECORD(iface, DdsFrameEncode, IWICBitmapFrameEncode_iface); return CONTAINING_RECORD(iface, DdsFrameEncode, IWICBitmapFrameEncode_iface);
...@@ -1705,6 +1711,57 @@ HRESULT DdsDecoder_CreateInstance(REFIID iid, void** ppv) ...@@ -1705,6 +1711,57 @@ HRESULT DdsDecoder_CreateInstance(REFIID iid, void** ppv)
return ret; return ret;
} }
static HRESULT WINAPI DdsEncoder_Dds_QueryInterface(IWICDdsEncoder *iface, REFIID iid,
void **ppv)
{
DdsEncoder *This = impl_from_IWICDdsEncoder(iface);
return IWICBitmapEncoder_QueryInterface(&This->IWICBitmapEncoder_iface, iid, ppv);
}
static ULONG WINAPI DdsEncoder_Dds_AddRef(IWICDdsEncoder *iface)
{
DdsEncoder *This = impl_from_IWICDdsEncoder(iface);
return IWICBitmapEncoder_AddRef(&This->IWICBitmapEncoder_iface);
}
static ULONG WINAPI DdsEncoder_Dds_Release(IWICDdsEncoder *iface)
{
DdsEncoder *This = impl_from_IWICDdsEncoder(iface);
return IWICBitmapEncoder_Release(&This->IWICBitmapEncoder_iface);
}
static HRESULT WINAPI DdsEncoder_Dds_SetParameters(IWICDdsEncoder *iface,
WICDdsParameters *parameters)
{
FIXME("(%p,%p): stub.\n", iface, parameters);
return E_NOTIMPL;
}
static HRESULT WINAPI DdsEncoder_Dds_GetParameters(IWICDdsEncoder *iface,
WICDdsParameters *parameters)
{
FIXME("(%p,%p): stub.\n", iface, parameters);
return E_NOTIMPL;
}
static HRESULT WINAPI DdsEncoder_Dds_CreateNewFrame(IWICDdsEncoder *iface,
IWICBitmapFrameEncode **frameEncode,
UINT *arrayIndex, UINT *mipLevel, UINT *sliceIndex)
{
FIXME("(%p,%p,%p,%p,%p): stub.\n", iface, frameEncode, arrayIndex, mipLevel, sliceIndex);
return E_NOTIMPL;
}
static const IWICDdsEncoderVtbl DdsEncoder_Dds_Vtbl =
{
DdsEncoder_Dds_QueryInterface,
DdsEncoder_Dds_AddRef,
DdsEncoder_Dds_Release,
DdsEncoder_Dds_SetParameters,
DdsEncoder_Dds_GetParameters,
DdsEncoder_Dds_CreateNewFrame
};
static HRESULT WINAPI DdsEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID iid, static HRESULT WINAPI DdsEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID iid,
void **ppv) void **ppv)
{ {
...@@ -1716,8 +1773,9 @@ static HRESULT WINAPI DdsEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID ...@@ -1716,8 +1773,9 @@ static HRESULT WINAPI DdsEncoder_QueryInterface(IWICBitmapEncoder *iface, REFIID
if (IsEqualIID(&IID_IUnknown, iid) || if (IsEqualIID(&IID_IUnknown, iid) ||
IsEqualIID(&IID_IWICBitmapEncoder, iid)) { IsEqualIID(&IID_IWICBitmapEncoder, iid)) {
*ppv = &This->IWICBitmapEncoder_iface; *ppv = &This->IWICBitmapEncoder_iface;
} } else if (IsEqualIID(&IID_IWICDdsEncoder, iid)) {
else { *ppv = &This->IWICDdsEncoder_iface;
} else {
*ppv = NULL; *ppv = NULL;
return E_NOINTERFACE; return E_NOINTERFACE;
} }
...@@ -1929,6 +1987,7 @@ HRESULT DdsEncoder_CreateInstance( REFIID iid, void **ppv) ...@@ -1929,6 +1987,7 @@ HRESULT DdsEncoder_CreateInstance( REFIID iid, void **ppv)
if (!This) return E_OUTOFMEMORY; if (!This) return E_OUTOFMEMORY;
This->IWICBitmapEncoder_iface.lpVtbl = &DdsEncoder_Vtbl; This->IWICBitmapEncoder_iface.lpVtbl = &DdsEncoder_Vtbl;
This->IWICDdsEncoder_iface.lpVtbl = &DdsEncoder_Dds_Vtbl;
This->ref = 1; This->ref = 1;
This->stream = NULL; This->stream = NULL;
This->frame_count = 0; This->frame_count = 0;
......
...@@ -1198,6 +1198,25 @@ interface IWICDdsDecoder : IUnknown ...@@ -1198,6 +1198,25 @@ interface IWICDdsDecoder : IUnknown
[ [
object, object,
uuid(5cacdb4c-407e-41b3-b936-d0f010cd6732)
]
interface IWICDdsEncoder : IUnknown
{
HRESULT SetParameters(
[in] WICDdsParameters *parameters);
HRESULT GetParameters(
[out] WICDdsParameters *parameters);
HRESULT CreateNewFrame(
[out] IWICBitmapFrameEncode **frameEncode,
[out, optional] UINT *arrayIndex,
[out, optional] UINT *mipLevel,
[out, optional] UINT *sliceIndex);
};
[
object,
uuid(3d4c0c61-18a4-41e4-bd80-481a4fc9f464) uuid(3d4c0c61-18a4-41e4-bd80-481a4fc9f464)
] ]
interface IWICDdsFrameDecode : IUnknown interface IWICDdsFrameDecode : IUnknown
......
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