Commit afe89eae authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wincodecs: Create default encoder options for BMP encoder.

parent 1c65b993
...@@ -72,6 +72,8 @@ typedef struct BmpFrameEncode { ...@@ -72,6 +72,8 @@ typedef struct BmpFrameEncode {
BOOL committed; BOOL committed;
} BmpFrameEncode; } BmpFrameEncode;
static const WCHAR wszEnableV5Header32bppBGRA[] = {'E','n','a','b','l','e','V','5','H','e','a','d','e','r','3','2','b','p','p','B','G','R','A',0};
static inline BmpFrameEncode *impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface) static inline BmpFrameEncode *impl_from_IWICBitmapFrameEncode(IWICBitmapFrameEncode *iface)
{ {
return CONTAINING_RECORD(iface, BmpFrameEncode, IWICBitmapFrameEncode_iface); return CONTAINING_RECORD(iface, BmpFrameEncode, IWICBitmapFrameEncode_iface);
...@@ -135,6 +137,9 @@ static HRESULT WINAPI BmpFrameEncode_Initialize(IWICBitmapFrameEncode *iface, ...@@ -135,6 +137,9 @@ static HRESULT WINAPI BmpFrameEncode_Initialize(IWICBitmapFrameEncode *iface,
if (This->initialized) return WINCODEC_ERR_WRONGSTATE; if (This->initialized) return WINCODEC_ERR_WRONGSTATE;
if (pIEncoderOptions)
WARN("ignoring encoder options.\n");
This->initialized = TRUE; This->initialized = TRUE;
return S_OK; return S_OK;
...@@ -501,6 +506,10 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface, ...@@ -501,6 +506,10 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
BmpEncoder *This = impl_from_IWICBitmapEncoder(iface); BmpEncoder *This = impl_from_IWICBitmapEncoder(iface);
BmpFrameEncode *encode; BmpFrameEncode *encode;
HRESULT hr; HRESULT hr;
static const PROPBAG2 opts[1] =
{
{ PROPBAG2_TYPE_DATA, VT_BOOL, 0, 0, (LPOLESTR)wszEnableV5Header32bppBGRA },
};
TRACE("(%p,%p,%p)\n", iface, ppIFrameEncode, ppIEncoderOptions); TRACE("(%p,%p,%p)\n", iface, ppIFrameEncode, ppIEncoderOptions);
...@@ -510,7 +519,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface, ...@@ -510,7 +519,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
if (ppIEncoderOptions) if (ppIEncoderOptions)
{ {
hr = CreatePropertyBag2(NULL, 0, ppIEncoderOptions); hr = CreatePropertyBag2(opts, sizeof(opts)/sizeof(opts[0]), ppIEncoderOptions);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
} }
......
...@@ -467,6 +467,7 @@ static const WCHAR wszLuminance[] = {'L','u','m','i','n','a','n','c','e',0}; ...@@ -467,6 +467,7 @@ static const WCHAR wszLuminance[] = {'L','u','m','i','n','a','n','c','e',0};
static const WCHAR wszChrominance[] = {'C','h','r','o','m','i','n','a','n','c','e',0}; static const WCHAR wszChrominance[] = {'C','h','r','o','m','i','n','a','n','c','e',0};
static const WCHAR wszJpegYCrCbSubsampling[] = {'J','p','e','g','Y','C','r','C','b','S','u','b','s','a','m','p','l','i','n','g',0}; static const WCHAR wszJpegYCrCbSubsampling[] = {'J','p','e','g','Y','C','r','C','b','S','u','b','s','a','m','p','l','i','n','g',0};
static const WCHAR wszSuppressApp0[] = {'S','u','p','p','r','e','s','s','A','p','p','0',0}; static const WCHAR wszSuppressApp0[] = {'S','u','p','p','r','e','s','s','A','p','p','0',0};
static const WCHAR wszEnableV5Header32bppBGRA[] = {'E','n','a','b','l','e','V','5','H','e','a','d','e','r','3','2','b','p','p','B','G','R','A',0};
static const struct property_opt_test_data testdata_tiff_props[] = { static const struct property_opt_test_data testdata_tiff_props[] = {
{ wszTiffCompressionMethod, VT_UI1, VT_UI1, WICTiffCompressionDontCare }, { wszTiffCompressionMethod, VT_UI1, VT_UI1, WICTiffCompressionDontCare },
...@@ -490,6 +491,11 @@ static const struct property_opt_test_data testdata_jpeg_props[] = { ...@@ -490,6 +491,11 @@ static const struct property_opt_test_data testdata_jpeg_props[] = {
{ NULL } { NULL }
}; };
static const struct property_opt_test_data testdata_bmp_props[] = {
{ wszEnableV5Header32bppBGRA, VT_BOOL, VT_BOOL, VARIANT_FALSE, 0.0f, TRUE }, /* Supported since Win7 */
{ NULL }
};
static int find_property_index(const WCHAR* name, PROPBAG2* all_props, int all_prop_cnt) static int find_property_index(const WCHAR* name, PROPBAG2* all_props, int all_prop_cnt)
{ {
int i; int i;
...@@ -616,6 +622,8 @@ static void test_encoder_properties(const CLSID* clsid_encoder, IPropertyBag2 *o ...@@ -616,6 +622,8 @@ static void test_encoder_properties(const CLSID* clsid_encoder, IPropertyBag2 *o
test_specific_encoder_properties(options, testdata_png_props, all_props, cProperties2); test_specific_encoder_properties(options, testdata_png_props, all_props, cProperties2);
else if (IsEqualCLSID(clsid_encoder, &CLSID_WICJpegEncoder)) else if (IsEqualCLSID(clsid_encoder, &CLSID_WICJpegEncoder))
test_specific_encoder_properties(options, testdata_jpeg_props, all_props, cProperties2); test_specific_encoder_properties(options, testdata_jpeg_props, all_props, cProperties2);
else if (IsEqualCLSID(clsid_encoder, &CLSID_WICBmpEncoder))
test_specific_encoder_properties(options, testdata_bmp_props, all_props, cProperties2);
for (i=0; i < cProperties2; i++) for (i=0; i < cProperties2; i++)
{ {
......
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