ReactOS 0.4.16-dev-753-g705a985
converter.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <math.h>
#include "windef.h"
#include "objbase.h"
#include "wincodec.h"
#include "wincodecsdk.h"
#include "wine/test.h"
#include "pshpack1.h"
#include "poppack.h"
Include dependency graph for converter.c:

Go to the source code of this file.

Classes

struct  bitmap_data
 
struct  BitmapTestSrc
 
struct  property_opt_test_data
 
struct  setting
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define TO_16bppBGRA5551(b, g, r, a)
 
#define EXPECT_REF(obj, ref)   _expect_ref((IUnknown*)obj, ref, __LINE__)
 

Typedefs

typedef struct bitmap_data bitmap_data
 
typedef struct BitmapTestSrc BitmapTestSrc
 
typedef struct property_opt_test_data property_opt_test_data
 

Functions

HRESULT STDMETHODCALLTYPE IWICBitmapFrameEncode_WriteSource_Proxy (IWICBitmapFrameEncode *This, IWICBitmapSource *pIBitmapSource, WICRect *prc)
 
static BOOL near_equal (float a, float b)
 
static BitmapTestSrcimpl_from_IWICBitmapSource (IWICBitmapSource *iface)
 
static HRESULT WINAPI BitmapTestSrc_QueryInterface (IWICBitmapSource *iface, REFIID iid, void **ppv)
 
static ULONG WINAPI BitmapTestSrc_AddRef (IWICBitmapSource *iface)
 
static ULONG WINAPI BitmapTestSrc_Release (IWICBitmapSource *iface)
 
static HRESULT WINAPI BitmapTestSrc_GetSize (IWICBitmapSource *iface, UINT *puiWidth, UINT *puiHeight)
 
static HRESULT WINAPI BitmapTestSrc_GetPixelFormat (IWICBitmapSource *iface, WICPixelFormatGUID *pPixelFormat)
 
static HRESULT WINAPI BitmapTestSrc_GetResolution (IWICBitmapSource *iface, double *pDpiX, double *pDpiY)
 
static HRESULT WINAPI BitmapTestSrc_CopyPalette (IWICBitmapSource *iface, IWICPalette *palette)
 
static HRESULT WINAPI BitmapTestSrc_CopyPixels (IWICBitmapSource *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
 
static void CreateTestBitmap (const bitmap_data *data, BitmapTestSrc **This)
 
static void DeleteTestBitmap (BitmapTestSrc *This)
 
static BOOL compare_bits (const struct bitmap_data *expect, UINT buffersize, const BYTE *converted_bits)
 
static BOOL is_indexed_format (const GUID *format)
 
static void compare_bitmap_data (const struct bitmap_data *src, const struct bitmap_data *expect, IWICBitmapSource *source, const char *name)
 
static void test_conversion (const struct bitmap_data *src, const struct bitmap_data *dst, const char *name, BOOL todo)
 
static void test_invalid_conversion (void)
 
static void test_default_converter (void)
 
static void test_converter_4bppGray (void)
 
static void test_converter_8bppGray (void)
 
static int find_property_index (const WCHAR *name, PROPBAG2 *all_props, int all_prop_cnt)
 
static void test_specific_encoder_properties (IPropertyBag2 *options, const property_opt_test_data *data, PROPBAG2 *all_props, int all_prop_cnt)
 
static void test_encoder_properties (const CLSID *clsid_encoder, IPropertyBag2 *options)
 
static void load_stream (IUnknown *reader, IStream *stream)
 
static void check_tiff_format (IStream *stream, const WICPixelFormatGUID *format)
 
static void check_bmp_format (IStream *stream, const WICPixelFormatGUID *format)
 
static unsigned be_uint (unsigned val)
 
static void check_png_format (IStream *stream, const WICPixelFormatGUID *format)
 
static void check_gif_format (IStream *stream, const WICPixelFormatGUID *format)
 
static void check_bitmap_format (IStream *stream, const CLSID *encoder, const WICPixelFormatGUID *format)
 
static void _expect_ref (IUnknown *obj, ULONG ref, int line)
 
static void test_set_frame_palette (IWICBitmapFrameEncode *frameencode)
 
static void test_multi_encoder_impl (const struct bitmap_data **srcs, const CLSID *clsid_encoder, const struct bitmap_data **dsts, const CLSID *clsid_decoder, WICRect *rc, const struct setting *settings, const char *name, IWICPalette *palette, BOOL set_size)
 
static void test_multi_encoder (const struct bitmap_data **srcs, const CLSID *clsid_encoder, const struct bitmap_data **dsts, const CLSID *clsid_decoder, WICRect *rc, const struct setting *settings, const char *name, IWICPalette *palette)
 
static void test_encoder (const struct bitmap_data *src, const CLSID *clsid_encoder, const struct bitmap_data *dst, const CLSID *clsid_decoder, const char *name)
 
static void test_encoder_rects (void)
 
static void test_converter_8bppIndexed (void)
 
 START_TEST (converter)
 

Variables

static IWICImagingFactoryfactory
 
static const IWICBitmapSourceVtbl BitmapTestSrc_Vtbl
 
static const BYTE bits_1bpp []
 
static const struct bitmap_data testdata_BlackWhite
 
static const struct bitmap_data testdata_1bppIndexed
 
static const BYTE bits_2bpp []
 
static const struct bitmap_data testdata_2bppIndexed
 
static const BYTE bits_4bpp []
 
static const struct bitmap_data testdata_4bppIndexed
 
static const BYTE bits_8bpp_BW []
 
static const struct bitmap_data testdata_8bppIndexed_BW
 
static const BYTE bits_8bpp_4colors []
 
static const struct bitmap_data testdata_8bppIndexed_4colors
 
static const BYTE bits_8bpp []
 
static const struct bitmap_data testdata_8bppIndexed
 
static const BYTE bits_24bppBGR []
 
static const struct bitmap_data testdata_24bppBGR
 
static const BYTE bits_24bppRGB []
 
static const struct bitmap_data testdata_24bppRGB
 
static const BYTE bits_32bppBGR []
 
static const struct bitmap_data testdata_32bppBGR
 
static const struct bitmap_data testdata_32bppBGRA80
 
static const struct bitmap_data testdata_32bppRGBA80
 
static const BYTE bits_32bppBGRA []
 
static const BYTE bits_32bppRGBA []
 
static const struct bitmap_data testdata_32bppBGRA
 
static const struct bitmap_data testdata_32bppRGBA
 
static const struct bitmap_data testdata_32bppRGB
 
static const BYTE bits_32bppPBGRA []
 
static const struct bitmap_data testdata_32bppPBGRA
 
static const struct bitmap_data testdata_32bppPRGBA
 
static const BYTE bits_64bppRGBA []
 
static const struct bitmap_data testdata_64bppRGBA
 
static const float bits_32bppGrayFloat_xp []
 
static const struct bitmap_data testdata_32bppGrayFloat_xp
 
static const float bits_32bppGrayFloat []
 
static const struct bitmap_data testdata_32bppGrayFloat
 
static const BYTE bits_4bppGray_xp []
 
static const struct bitmap_data testdata_4bppGray_xp
 
static const BYTE bits_4bppGray []
 
static const struct bitmap_data testdata_4bppGray
 
static const BYTE bits_8bppGray_xp []
 
static const struct bitmap_data testdata_8bppGray_xp
 
static const BYTE bits_8bppGray []
 
static const struct bitmap_data testdata_8bppGray
 
static const BYTE bits_24bppBGR_gray []
 
static const struct bitmap_data testdata_24bppBGR_gray
 
static const WORD bits_16bppBGRA5551 []
 
static const struct bitmap_data testdata_16bppBGRA5551
 
static const WORD bits_48bppRGB []
 
static const struct bitmap_data testdata_48bppRGB
 
static const WORD bits_64bppRGBA_2 []
 
static const struct bitmap_data testdata_64bppRGBA_2
 
static const WCHAR wszTiffCompressionMethod [] = {'T','i','f','f','C','o','m','p','r','e','s','s','i','o','n','M','e','t','h','o','d',0}
 
static const WCHAR wszCompressionQuality [] = {'C','o','m','p','r','e','s','s','i','o','n','Q','u','a','l','i','t','y',0}
 
static const WCHAR wszInterlaceOption [] = {'I','n','t','e','r','l','a','c','e','O','p','t','i','o','n',0}
 
static const WCHAR wszFilterOption [] = {'F','i','l','t','e','r','O','p','t','i','o','n',0}
 
static const WCHAR wszImageQuality [] = {'I','m','a','g','e','Q','u','a','l','i','t','y',0}
 
static const WCHAR wszBitmapTransform [] = {'B','i','t','m','a','p','T','r','a','n','s','f','o','r','m',0}
 
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 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 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_png_props []
 
static const struct property_opt_test_data testdata_jpeg_props []
 
static const struct property_opt_test_data testdata_bmp_props []
 
static const struct bitmap_datamultiple_frames [3]
 
static const struct bitmap_datasingle_frame [2]
 
static const struct setting png_interlace_settings []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file converter.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 25 of file converter.c.

◆ EXPECT_REF

#define EXPECT_REF (   obj,
  ref 
)    _expect_ref((IUnknown*)obj, ref, __LINE__)

Definition at line 1331 of file converter.c.

◆ TO_16bppBGRA5551

#define TO_16bppBGRA5551 (   b,
  g,
  r,
  a 
)
Value:
( \
((a >> 7) << 15) | \
((r >> 3) << 10) | \
((g >> 3) << 5) | \
((b >> 3)) \
)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean g
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Definition at line 605 of file converter.c.

Typedef Documentation

◆ bitmap_data

◆ BitmapTestSrc

◆ property_opt_test_data

Function Documentation

◆ _expect_ref()

static void _expect_ref ( IUnknown obj,
ULONG  ref,
int  line 
)
static

Definition at line 1332 of file converter.c.

1333{
1334 ULONG rc;
1335 IUnknown_AddRef(obj);
1336 rc = IUnknown_Release(obj);
1337 ok_(__FILE__,line)(rc == ref, "expected refcount %ld, got %ld\n", ref, rc);
1338}
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: parser.c:49
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ be_uint()

static unsigned be_uint ( unsigned  val)
static

Definition at line 1164 of file converter.c.

1165{
1166 union
1167 {
1168 unsigned val;
1169 char c[4];
1170 } u;
1171
1172 u.val = val;
1173 return (u.c[0] << 24) | (u.c[1] << 16) | (u.c[2] << 8) | u.c[3];
1174}
const GLubyte * c
Definition: glext.h:8905
GLuint GLfloat * val
Definition: glext.h:7180
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240

Referenced by check_png_format().

◆ BitmapTestSrc_AddRef()

static ULONG WINAPI BitmapTestSrc_AddRef ( IWICBitmapSource iface)
static

Definition at line 80 of file converter.c.

81{
84 return ref;
85}
#define InterlockedIncrement
Definition: armddk.h:53
static BitmapTestSrc * impl_from_IWICBitmapSource(IWICBitmapSource *iface)
Definition: converter.c:60

◆ BitmapTestSrc_CopyPalette()

static HRESULT WINAPI BitmapTestSrc_CopyPalette ( IWICBitmapSource iface,
IWICPalette palette 
)
static

Definition at line 120 of file converter.c.

122{
124
125 if (IsEqualGUID(This->data->format, &GUID_WICPixelFormat1bppIndexed) ||
126 IsEqualGUID(This->data->format, &GUID_WICPixelFormat2bppIndexed) ||
127 IsEqualGUID(This->data->format, &GUID_WICPixelFormat4bppIndexed) ||
128 IsEqualGUID(This->data->format, &GUID_WICPixelFormat8bppIndexed))
129 {
130 WICColor colors[8];
131
132 colors[0] = 0xff0000ff;
133 colors[1] = 0xff00ff00;
134 colors[2] = 0xffff0000;
135 colors[3] = 0xff000000;
136 colors[4] = 0xffffff00;
137 colors[5] = 0xffff00ff;
138 colors[6] = 0xff00ffff;
139 colors[7] = 0xffffffff;
140 return IWICPalette_InitializeCustom(palette, colors, 8);
141 }
142
143 /* unique error marker */
144 return 0xdeadbeef;
145}
static HPALETTE palette
Definition: clipboard.c:1345
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
UINT32 WICColor
Definition: wincodec.idl:364

◆ BitmapTestSrc_CopyPixels()

static HRESULT WINAPI BitmapTestSrc_CopyPixels ( IWICBitmapSource iface,
const WICRect prc,
UINT  cbStride,
UINT  cbBufferSize,
BYTE pbBuffer 
)
static

Definition at line 147 of file converter.c.

149{
151 UINT bytesperrow;
152 UINT srcstride;
153 UINT row_offset;
154 WICRect rc;
155
156 if (!prc)
157 {
158 rc.X = 0;
159 rc.Y = 0;
160 rc.Width = This->data->width;
161 rc.Height = This->data->height;
162 prc = &rc;
163 }
164 else
165 {
166 if (prc->X < 0 || prc->Y < 0 || prc->X+prc->Width > This->data->width || prc->Y+prc->Height > This->data->height)
167 return E_INVALIDARG;
168 }
169
170 bytesperrow = ((This->data->bpp * prc->Width)+7)/8;
171 srcstride = ((This->data->bpp * This->data->width)+7)/8;
172
173 if (cbStride < bytesperrow)
174 return E_INVALIDARG;
175
176 if ((cbStride * prc->Height) > cbBufferSize)
177 return E_INVALIDARG;
178
179 row_offset = prc->X * This->data->bpp;
180
181 if (row_offset % 8 == 0)
182 {
183 UINT row;
184 const BYTE *src;
185 BYTE *dst;
186
187 src = This->data->bits + (row_offset / 8) + prc->Y * srcstride;
188 dst = pbBuffer;
189 for (row=0; row < prc->Height; row++)
190 {
191 memcpy(dst, src, bytesperrow);
192 src += srcstride;
193 dst += cbStride;
194 }
195 return S_OK;
196 }
197 else
198 {
199 ok(0, "bitmap %p was asked to copy pixels not aligned on a byte boundary\n", iface);
200 return E_FAIL;
201 }
202}
#define ok(value,...)
Definition: atltest.h:57
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_FAIL
Definition: ddrawi.h:102
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:52
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define for
Definition: utility.h:88
unsigned int UINT
Definition: ndis.h:50
_Out_ LPRECT prc
Definition: ntgdi.h:1658
INT Height
Definition: wincodec.idl:335
INT Width
Definition: wincodec.idl:334
unsigned char BYTE
Definition: xxhash.c:193

◆ BitmapTestSrc_GetPixelFormat()

static HRESULT WINAPI BitmapTestSrc_GetPixelFormat ( IWICBitmapSource iface,
WICPixelFormatGUID pPixelFormat 
)
static

Definition at line 103 of file converter.c.

105{
107 memcpy(pPixelFormat, This->data->format, sizeof(GUID));
108 return S_OK;
109}

◆ BitmapTestSrc_GetResolution()

static HRESULT WINAPI BitmapTestSrc_GetResolution ( IWICBitmapSource iface,
double pDpiX,
double pDpiY 
)
static

Definition at line 111 of file converter.c.

113{
115 *pDpiX = This->data->xres;
116 *pDpiY = This->data->yres;
117 return S_OK;
118}

◆ BitmapTestSrc_GetSize()

static HRESULT WINAPI BitmapTestSrc_GetSize ( IWICBitmapSource iface,
UINT puiWidth,
UINT puiHeight 
)
static

Definition at line 94 of file converter.c.

96{
98 *puiWidth = This->data->width;
99 *puiHeight = This->data->height;
100 return S_OK;
101}

◆ BitmapTestSrc_QueryInterface()

static HRESULT WINAPI BitmapTestSrc_QueryInterface ( IWICBitmapSource iface,
REFIID  iid,
void **  ppv 
)
static

Definition at line 65 of file converter.c.

67{
68 if (!ppv) return E_INVALIDARG;
69
70 if (IsEqualIID(&IID_IUnknown, iid) ||
71 IsEqualIID(&IID_IWICBitmapSource, iid))
72 *ppv = iface;
73 else
74 return E_NOINTERFACE;
75
76 IUnknown_AddRef((IUnknown*)*ppv);
77 return S_OK;
78}
const GUID IID_IUnknown
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ BitmapTestSrc_Release()

static ULONG WINAPI BitmapTestSrc_Release ( IWICBitmapSource iface)
static

Definition at line 87 of file converter.c.

88{
91 return ref;
92}
#define InterlockedDecrement
Definition: armddk.h:52

◆ check_bitmap_format()

static void check_bitmap_format ( IStream stream,
const CLSID encoder,
const WICPixelFormatGUID format 
)
static

Definition at line 1300 of file converter.c.

1301{
1302 HRESULT hr;
1304
1305 pos.QuadPart = 0;
1306 hr = IStream_Seek(stream, pos, SEEK_SET, (ULARGE_INTEGER *)&pos);
1307 ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
1308
1309 if (IsEqualGUID(encoder, &CLSID_WICPngEncoder))
1311 else if (IsEqualGUID(encoder, &CLSID_WICBmpEncoder))
1313 else if (IsEqualGUID(encoder, &CLSID_WICTiffEncoder))
1315 else if (IsEqualGUID(encoder, &CLSID_WICGifEncoder))
1317 else
1318 ok(0, "unknown encoder %s\n", wine_dbgstr_guid(encoder));
1319
1320 hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
1321 ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
1322}
#define NULL
Definition: types.h:112
#define SEEK_SET
Definition: jmemansi.c:26
static void check_gif_format(IStream *stream, const WICPixelFormatGUID *format)
Definition: converter.c:1266
static void check_tiff_format(IStream *stream, const WICPixelFormatGUID *format)
Definition: converter.c:975
static void check_png_format(IStream *stream, const WICPixelFormatGUID *format)
Definition: converter.c:1176
static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format)
Definition: converter.c:1096
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
HRESULT hr
Definition: shlfolder.c:183
Definition: format.c:58
Definition: parse.h:23

Referenced by test_multi_encoder_impl().

◆ check_bmp_format()

static void check_bmp_format ( IStream stream,
const WICPixelFormatGUID format 
)
static

Definition at line 1096 of file converter.c.

1097{
1098 HRESULT hr;
1099 BITMAPFILEHEADER bfh;
1100 BITMAPV5HEADER bih;
1101
1102 hr = IStream_Read(stream, &bfh, sizeof(bfh), NULL);
1103 ok(hr == S_OK, "IStream_Read error %#lx\n", hr);
1104
1105 ok(bfh.bfType == 0x4d42, "wrong BMP signature %02x\n", bfh.bfType);
1106 ok(bfh.bfReserved1 == 0, "wrong bfReserved1 %02x\n", bfh.bfReserved1);
1107 ok(bfh.bfReserved2 == 0, "wrong bfReserved2 %02x\n", bfh.bfReserved2);
1108
1109 hr = IStream_Read(stream, &bih, sizeof(bih), NULL);
1110 ok(hr == S_OK, "IStream_Read error %#lx\n", hr);
1111
1112 if (IsEqualGUID(format, &GUID_WICPixelFormat1bppIndexed))
1113 {
1114 ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %08lx\n", bfh.bfOffBits);
1115
1116 ok(bih.bV5Width == 32, "wrong width %lu\n", bih.bV5Width);
1117 ok(bih.bV5Height == 2, "wrong height %lu\n", bih.bV5Height);
1118
1119 ok(bih.bV5Planes == 1, "wrong Planes %d\n", bih.bV5Planes);
1120 ok(bih.bV5BitCount == 1, "wrong BitCount %d\n", bih.bV5BitCount);
1121 ok(bih.bV5ClrUsed == 256, "wrong ClrUsed %ld\n", bih.bV5ClrUsed);
1122 ok(bih.bV5ClrImportant == 256, "wrong ClrImportant %ld\n", bih.bV5ClrImportant);
1123 }
1124 else if (IsEqualGUID(format, &GUID_WICPixelFormat4bppIndexed))
1125 {
1126 ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %08lx\n", bfh.bfOffBits);
1127
1128 ok(bih.bV5Width == 32, "wrong width %lu\n", bih.bV5Width);
1129 ok(bih.bV5Height == 2, "wrong height %lu\n", bih.bV5Height);
1130
1131 ok(bih.bV5Planes == 1, "wrong Planes %d\n", bih.bV5Planes);
1132 ok(bih.bV5BitCount == 4, "wrong BitCount %d\n", bih.bV5BitCount);
1133 ok(bih.bV5ClrUsed == 256, "wrong ClrUsed %ld\n", bih.bV5ClrUsed);
1134 ok(bih.bV5ClrImportant == 256, "wrong ClrImportant %ld\n", bih.bV5ClrImportant);
1135 }
1136 else if (IsEqualGUID(format, &GUID_WICPixelFormat8bppIndexed))
1137 {
1138 ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %08lx\n", bfh.bfOffBits);
1139
1140 ok(bih.bV5Width == 32, "wrong width %lu\n", bih.bV5Width);
1141 ok(bih.bV5Height == 2, "wrong height %lu\n", bih.bV5Height);
1142
1143 ok(bih.bV5Planes == 1, "wrong Planes %d\n", bih.bV5Planes);
1144 ok(bih.bV5BitCount == 8, "wrong BitCount %d\n", bih.bV5BitCount);
1145 ok(bih.bV5ClrUsed == 256, "wrong ClrUsed %ld\n", bih.bV5ClrUsed);
1146 ok(bih.bV5ClrImportant == 256, "wrong ClrImportant %ld\n", bih.bV5ClrImportant);
1147 }
1148 else if (IsEqualGUID(format, &GUID_WICPixelFormat32bppBGR))
1149 {
1150 ok(bfh.bfOffBits == 0x0036, "wrong bfOffBits %08lx\n", bfh.bfOffBits);
1151
1152 ok(bih.bV5Width == 32, "wrong width %lu\n", bih.bV5Width);
1153 ok(bih.bV5Height == 2, "wrong height %lu\n", bih.bV5Height);
1154
1155 ok(bih.bV5Planes == 1, "wrong Planes %d\n", bih.bV5Planes);
1156 ok(bih.bV5BitCount == 32, "wrong BitCount %d\n", bih.bV5BitCount);
1157 ok(bih.bV5ClrUsed == 0, "wrong ClrUsed %ld\n", bih.bV5ClrUsed);
1158 ok(bih.bV5ClrImportant == 0, "wrong ClrImportant %ld\n", bih.bV5ClrImportant);
1159 }
1160 else
1161 ok(0, "unknown BMP pixel format %s\n", wine_dbgstr_guid(format));
1162}

Referenced by check_bitmap_format().

◆ check_gif_format()

static void check_gif_format ( IStream stream,
const WICPixelFormatGUID format 
)
static

Definition at line 1266 of file converter.c.

1267{
1268#include "pshpack1.h"
1270 {
1271 char signature[6];
1272 USHORT width;
1273 USHORT height;
1274 BYTE packed;
1275 /* global_color_table_flag : 1;
1276 * color_resolution : 3;
1277 * sort_flag : 1;
1278 * global_color_table_size : 3;
1279 */
1282 } lsd;
1283#include "poppack.h"
1284 UINT color_resolution;
1285 HRESULT hr;
1286
1287 memset(&lsd, 0, sizeof(lsd));
1288 hr = IStream_Read(stream, &lsd, sizeof(lsd), NULL);
1289 ok(hr == S_OK, "IStream_Read error %#lx\n", hr);
1290
1291 ok(!memcmp(lsd.signature, "GIF89a", 6), "wrong GIF signature %.6s\n", lsd.signature);
1292
1293 ok(lsd.width == 32, "wrong width %u\n", lsd.width);
1294 ok(lsd.height == 2, "wrong height %u\n", lsd.height);
1295 color_resolution = 1 << (((lsd.packed >> 4) & 0x07) + 1);
1296 ok(color_resolution == 256, "wrong color resolution %u\n", color_resolution);
1297 ok(lsd.pixel_aspect_ratio == 0, "wrong pixel_aspect_ratio %u\n", lsd.pixel_aspect_ratio);
1298}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
unsigned short USHORT
Definition: pedump.c:61
#define memset(x, y, z)
Definition: compat.h:39

Referenced by check_bitmap_format().

◆ check_png_format()

static void check_png_format ( IStream stream,
const WICPixelFormatGUID format 
)
static

Definition at line 1176 of file converter.c.

1177{
1178 static const char png_sig[8] = {0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a};
1179 static const char png_IHDR[8] = {0,0,0,0x0d,'I','H','D','R'};
1180 HRESULT hr;
1181 struct
1182 {
1183 char png_sig[8];
1184 char ihdr_sig[8];
1185 unsigned width, height;
1186 char bit_depth, color_type, compression, filter, interlace;
1187 } png;
1188
1189 memset(&png, 0, sizeof(png));
1190 hr = IStream_Read(stream, &png, sizeof(png), NULL);
1191 ok(hr == S_OK, "IStream_Read error %#lx\n", hr);
1192
1193 ok(!memcmp(png.png_sig, png_sig, sizeof(png_sig)), "expected PNG signature\n");
1194 ok(!memcmp(png.ihdr_sig, png_IHDR, sizeof(png_IHDR)), "expected PNG IHDR\n");
1195
1196 if (IsEqualGUID(format, &GUID_WICPixelFormatBlackWhite))
1197 {
1198 ok(be_uint(png.width) == 32, "wrong width %u\n", be_uint(png.width));
1199 ok(be_uint(png.height) == 2, "wrong height %u\n", be_uint(png.height));
1200
1201 ok(png.bit_depth == 1, "wrong bit_depth %d\n", png.bit_depth);
1202 ok(png.color_type == 0, "wrong color_type %d\n", png.color_type);
1203 ok(png.compression == 0, "wrong compression %d\n", png.compression);
1204 ok(png.filter == 0, "wrong filter %d\n", png.filter);
1205 ok(png.interlace == 0, "wrong interlace %d\n", png.interlace);
1206 }
1207 else if (IsEqualGUID(format, &GUID_WICPixelFormat1bppIndexed))
1208 {
1209 ok(be_uint(png.width) == 32, "wrong width %u\n", be_uint(png.width));
1210 ok(be_uint(png.height) == 2, "wrong height %u\n", be_uint(png.height));
1211
1212 ok(png.bit_depth == 1, "wrong bit_depth %d\n", png.bit_depth);
1213 ok(png.color_type == 3, "wrong color_type %d\n", png.color_type);
1214 ok(png.compression == 0, "wrong compression %d\n", png.compression);
1215 ok(png.filter == 0, "wrong filter %d\n", png.filter);
1216 ok(png.interlace == 0, "wrong interlace %d\n", png.interlace);
1217 }
1218 else if (IsEqualGUID(format, &GUID_WICPixelFormat2bppIndexed))
1219 {
1220 ok(be_uint(png.width) == 32, "wrong width %u\n", be_uint(png.width));
1221 ok(be_uint(png.height) == 2, "wrong height %u\n", be_uint(png.height));
1222
1223 ok(png.bit_depth == 2, "wrong bit_depth %d\n", png.bit_depth);
1224 ok(png.color_type == 3, "wrong color_type %d\n", png.color_type);
1225 ok(png.compression == 0, "wrong compression %d\n", png.compression);
1226 ok(png.filter == 0, "wrong filter %d\n", png.filter);
1227 ok(png.interlace == 0, "wrong interlace %d\n", png.interlace);
1228 }
1229 else if (IsEqualGUID(format, &GUID_WICPixelFormat4bppIndexed))
1230 {
1231 ok(be_uint(png.width) == 32, "wrong width %u\n", be_uint(png.width));
1232 ok(be_uint(png.height) == 2, "wrong height %u\n", be_uint(png.height));
1233
1234 ok(png.bit_depth == 4, "wrong bit_depth %d\n", png.bit_depth);
1235 ok(png.color_type == 3, "wrong color_type %d\n", png.color_type);
1236 ok(png.compression == 0, "wrong compression %d\n", png.compression);
1237 ok(png.filter == 0, "wrong filter %d\n", png.filter);
1238 ok(png.interlace == 0, "wrong interlace %d\n", png.interlace);
1239 }
1240 else if (IsEqualGUID(format, &GUID_WICPixelFormat8bppIndexed))
1241 {
1242 ok(be_uint(png.width) == 32, "wrong width %u\n", be_uint(png.width));
1243 ok(be_uint(png.height) == 2, "wrong height %u\n", be_uint(png.height));
1244
1245 ok(png.bit_depth == 8, "wrong bit_depth %d\n", png.bit_depth);
1246 ok(png.color_type == 3, "wrong color_type %d\n", png.color_type);
1247 ok(png.compression == 0, "wrong compression %d\n", png.compression);
1248 ok(png.filter == 0, "wrong filter %d\n", png.filter);
1249 ok(png.interlace == 0, "wrong interlace %d\n", png.interlace);
1250 }
1251 else if (IsEqualGUID(format, &GUID_WICPixelFormat24bppBGR))
1252 {
1253 ok(be_uint(png.width) == 32, "wrong width %u\n", be_uint(png.width));
1254 ok(be_uint(png.height) == 2, "wrong height %u\n", be_uint(png.height));
1255
1256 ok(png.bit_depth == 8, "wrong bit_depth %d\n", png.bit_depth);
1257 ok(png.color_type == 2, "wrong color_type %d\n", png.color_type);
1258 ok(png.compression == 0, "wrong compression %d\n", png.compression);
1259 ok(png.filter == 0, "wrong filter %d\n", png.filter);
1260 ok(png.interlace == 0 || png.interlace == 1, "wrong interlace %d\n", png.interlace);
1261 }
1262 else
1263 ok(0, "unknown PNG pixel format %s\n", wine_dbgstr_guid(format));
1264}
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
Definition: btrfs_drv.h:1365
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
static unsigned be_uint(unsigned val)
Definition: converter.c:1164
#define png_IHDR
Definition: pngpriv.h:841

Referenced by check_bitmap_format().

◆ check_tiff_format()

static void check_tiff_format ( IStream stream,
const WICPixelFormatGUID format 
)
static

Definition at line 975 of file converter.c.

976{
977 HRESULT hr;
979 PROPVARIANT id, value;
980 struct
981 {
982 USHORT byte_order;
984 ULONG dir_offset;
985 } tiff;
987 UINT count, i;
988 int width, height, bps, photo, samples, colormap;
989 struct
990 {
991 int id, *value;
992 } tag[] =
993 {
994 { 0x100, &width }, { 0x101, &height }, { 0x102, &bps },
995 { 0x106, &photo }, { 0x115, &samples }, { 0x140, &colormap }
996 };
997
998 memset(&tiff, 0, sizeof(tiff));
999 hr = IStream_Read(stream, &tiff, sizeof(tiff), NULL);
1000 ok(hr == S_OK, "IStream_Read error %#lx\n", hr);
1001 ok(tiff.byte_order == MAKEWORD('I','I') || tiff.byte_order == MAKEWORD('M','M'),
1002 "wrong TIFF byte order mark %02x\n", tiff.byte_order);
1003 ok(tiff.version == 42, "wrong TIFF version %u\n", tiff.version);
1004
1005 pos.QuadPart = tiff.dir_offset;
1006 hr = IStream_Seek(stream, pos, SEEK_SET, NULL);
1007 ok(hr == S_OK, "IStream_Seek error %#lx\n", hr);
1008
1009 hr = CoCreateInstance(&CLSID_WICIfdMetadataReader, NULL, CLSCTX_INPROC_SERVER,
1010 &IID_IWICMetadataReader, (void **)&reader);
1011 ok(hr == S_OK, "CoCreateInstance error %#lx\n", hr);
1012
1014
1015 hr = IWICMetadataReader_GetCount(reader, &count);
1016 ok(hr == S_OK, "GetCount error %#lx\n", hr);
1017 ok(count != 0, "wrong count %u\n", count);
1018
1019 for (i = 0; i < ARRAY_SIZE(tag); i++)
1020 {
1021 PropVariantInit(&id);
1022 PropVariantInit(&value);
1023
1024 id.vt = VT_UI2;
1025 id.uiVal = tag[i].id;
1026 hr = IWICMetadataReader_GetValue(reader, NULL, &id, &value);
1027 ok(hr == S_OK || (tag[i].id == 0x140 && hr == WINCODEC_ERR_PROPERTYNOTFOUND),
1028 "GetValue(%04x) error %#lx\n", tag[i].id, hr);
1029 if (hr == S_OK)
1030 {
1031 ok(value.vt == VT_UI2 || value.vt == VT_UI4 || value.vt == (VT_UI2 | VT_VECTOR), "wrong vt: %d\n", value.vt);
1032 tag[i].value[0] = value.uiVal;
1033 }
1034 else
1035 tag[i].value[0] = -1;
1036
1038 }
1039
1040 IWICMetadataReader_Release(reader);
1041
1042 if (IsEqualGUID(format, &GUID_WICPixelFormatBlackWhite))
1043 {
1044 ok(width == 32, "wrong width %u\n", width);
1045 ok(height == 2, "wrong height %u\n", height);
1046
1047 ok(bps == 1, "wrong bps %d\n", bps);
1048 ok(photo == 1, "wrong photometric %d\n", photo);
1049 ok(samples == 1, "wrong samples %d\n", samples);
1050 ok(colormap == -1, "wrong colormap %d\n", colormap);
1051 }
1052 else if (IsEqualGUID(format, &GUID_WICPixelFormat1bppIndexed))
1053 {
1054 ok(width == 32, "wrong width %u\n", width);
1055 ok(height == 2, "wrong height %u\n", height);
1056
1057 ok(bps == 1, "wrong bps %d\n", bps);
1058 ok(photo == 3, "wrong photometric %d\n", photo);
1059 ok(samples == 1, "wrong samples %d\n", samples);
1060 ok(colormap == 6, "wrong colormap %d\n", colormap);
1061 }
1062 else if (IsEqualGUID(format, &GUID_WICPixelFormat4bppIndexed))
1063 {
1064 ok(width == 32, "wrong width %u\n", width);
1065 ok(height == 2, "wrong height %u\n", height);
1066
1067 ok(bps == 4, "wrong bps %d\n", bps);
1068 ok(photo == 3, "wrong photometric %d\n", photo);
1069 ok(samples == 1, "wrong samples %d\n", samples);
1070 ok(colormap == 48, "wrong colormap %d\n", colormap);
1071 }
1072 else if (IsEqualGUID(format, &GUID_WICPixelFormat8bppIndexed))
1073 {
1074 ok(width == 32, "wrong width %u\n", width);
1075 ok(height == 2, "wrong height %u\n", height);
1076
1077 ok(bps == 8, "wrong bps %d\n", bps);
1078 ok(photo == 3, "wrong photometric %d\n", photo);
1079 ok(samples == 1, "wrong samples %d\n", samples);
1080 ok(colormap == 768, "wrong colormap %d\n", colormap);
1081 }
1082 else if (IsEqualGUID(format, &GUID_WICPixelFormat24bppBGR))
1083 {
1084 ok(width == 32, "wrong width %u\n", width);
1085 ok(height == 2, "wrong height %u\n", height);
1086
1087 ok(bps == 3, "wrong bps %d\n", bps);
1088 ok(photo == 2, "wrong photometric %d\n", photo);
1089 ok(samples == 3, "wrong samples %d\n", samples);
1090 ok(colormap == -1, "wrong colormap %d\n", colormap);
1091 }
1092 else
1093 ok(0, "unknown TIFF pixel format %s\n", wine_dbgstr_guid(format));
1094}
#define ARRAY_SIZE(A)
Definition: main.h:20
@ VT_UI2
Definition: compat.h:2312
@ VT_UI4
Definition: compat.h:2313
@ VT_VECTOR
Definition: compat.h:2340
static const WCHAR version[]
Definition: asmname.c:66
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
Definition: ole2.c:2968
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei samples
Definition: glext.h:7006
GLuint id
Definition: glext.h:5910
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static void load_stream(IUnknown *reader, IStream *stream)
Definition: converter.c:961
Definition: reader.h:84
Definition: ecma_167.h:138
Definition: tiffiop.h:115
#define MAKEWORD(a, b)
Definition: typedefs.h:248
Definition: pdh_main.c:94
#define WINCODEC_ERR_PROPERTYNOTFOUND
Definition: winerror.h:3287

Referenced by check_bitmap_format().

◆ compare_bitmap_data()

static void compare_bitmap_data ( const struct bitmap_data src,
const struct bitmap_data expect,
IWICBitmapSource source,
const char name 
)
static

Definition at line 326 of file converter.c.

328{
329 BYTE *converted_bits;
331 double xres, yres;
332 WICRect prc;
333 UINT stride, buffersize;
334 GUID dst_pixelformat;
335 HRESULT hr;
336
337 hr = IWICBitmapSource_GetSize(source, &width, &height);
338 ok(SUCCEEDED(hr), "GetSize(%s) failed, hr=%lx\n", name, hr);
339 ok(width == expect->width, "expecting %u, got %u (%s)\n", expect->width, width, name);
340 ok(height == expect->height, "expecting %u, got %u (%s)\n", expect->height, height, name);
341
342 hr = IWICBitmapSource_GetResolution(source, &xres, &yres);
343 ok(SUCCEEDED(hr), "GetResolution(%s) failed, hr=%lx\n", name, hr);
344 ok(fabs(xres - expect->xres) < 0.02, "expecting %0.2f, got %0.2f (%s)\n", expect->xres, xres, name);
345 ok(fabs(yres - expect->yres) < 0.02, "expecting %0.2f, got %0.2f (%s)\n", expect->yres, yres, name);
346
347 hr = IWICBitmapSource_GetPixelFormat(source, &dst_pixelformat);
348 ok(SUCCEEDED(hr), "GetPixelFormat(%s) failed, hr=%lx\n", name, hr);
349 ok(IsEqualGUID(&dst_pixelformat, expect->format), "got unexpected pixel format %s (%s)\n", wine_dbgstr_guid(&dst_pixelformat), name);
350
351 prc.X = 0;
352 prc.Y = 0;
353 prc.Width = expect->width;
354 prc.Height = expect->height;
355
356 stride = (expect->bpp * expect->width + 7) / 8;
357 buffersize = stride * expect->height;
358
359 converted_bits = HeapAlloc(GetProcessHeap(), 0, buffersize);
360 memset(converted_bits, 0xaa, buffersize);
361 hr = IWICBitmapSource_CopyPixels(source, &prc, stride, buffersize, converted_bits);
362 ok(SUCCEEDED(hr), "CopyPixels(%s) failed, hr=%lx\n", name, hr);
363
364 /* The result of conversion of color to indexed formats depends on
365 * optimized palette generation implementation. We either need to
366 * assign our own palette, or just skip the comparison.
367 */
368 if (!(!is_indexed_format(src->format) && is_indexed_format(expect->format)))
369 ok(compare_bits(expect, buffersize, converted_bits), "unexpected pixel data (%s)\n", name);
370
371 /* Test with NULL rectangle - should copy the whole bitmap */
372 memset(converted_bits, 0xaa, buffersize);
373 hr = IWICBitmapSource_CopyPixels(source, NULL, stride, buffersize, converted_bits);
374 ok(SUCCEEDED(hr), "CopyPixels(%s,rc=NULL) failed, hr=%lx\n", name, hr);
375 /* see comment above */
376 if (!(!is_indexed_format(src->format) && is_indexed_format(expect->format)))
377 ok(compare_bits(expect, buffersize, converted_bits), "unexpected pixel data (%s)\n", name);
378
379 HeapFree(GetProcessHeap(), 0, converted_bits);
380}
#define expect(EXPECTED, GOT)
Definition: SystemMenu.c:483
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
GLsizei stride
Definition: glext.h:5848
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
Definition: fabs.c:17
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static BOOL is_indexed_format(const GUID *format)
Definition: converter.c:315
static BOOL compare_bits(const struct bitmap_data *expect, UINT buffersize, const BYTE *converted_bits)
Definition: converter.c:234
Definition: name.c:39

Referenced by test_conversion(), test_converter_4bppGray(), test_converter_8bppGray(), test_default_converter(), and test_multi_encoder_impl().

◆ compare_bits()

static BOOL compare_bits ( const struct bitmap_data expect,
UINT  buffersize,
const BYTE converted_bits 
)
static

Definition at line 234 of file converter.c.

235{
236 BOOL equal;
237
238 if (IsEqualGUID(expect->format, &GUID_WICPixelFormat32bppBGR))
239 {
240 /* ignore the padding byte when comparing data */
241 UINT i;
242 const DWORD *a=(const DWORD*)expect->bits, *b=(const DWORD*)converted_bits;
243 equal=TRUE;
244 for (i=0; i<(buffersize/4); i++)
245 if ((a[i]&0xffffff) != (b[i]&0xffffff))
246 {
247 equal = FALSE;
248 break;
249 }
250 }
251 else if (IsEqualGUID(expect->format, &GUID_WICPixelFormat32bppGrayFloat))
252 {
253 UINT i;
254 const float *a=(const float*)expect->bits, *b=(const float*)converted_bits;
255 equal=TRUE;
256 for (i=0; i<(buffersize/4); i++)
257 if (!near_equal(a[i], b[i]))
258 {
259 equal = FALSE;
260 break;
261 }
262 }
263 else if (IsEqualGUID(expect->format, &GUID_WICPixelFormatBlackWhite) ||
264 IsEqualGUID(expect->format, &GUID_WICPixelFormat1bppIndexed))
265 {
266 UINT i;
267 const BYTE *a=(const BYTE*)expect->bits, *b=(const BYTE*)converted_bits;
268 equal=TRUE;
269 for (i=0; i<buffersize; i++)
270 if (a[i] != b[i] && b[i] != 0xff /* BMP encoder B&W */)
271 {
272 equal = FALSE;
273 break;
274 }
275 }
276 else if (IsEqualGUID(expect->format, &GUID_WICPixelFormat2bppIndexed) ||
277 IsEqualGUID(expect->format, &GUID_WICPixelFormat4bppIndexed) ||
278 IsEqualGUID(expect->format, &GUID_WICPixelFormat8bppIndexed))
279 {
280 UINT i;
281 const BYTE *a=(const BYTE*)expect->bits, *b=(const BYTE*)converted_bits;
282 equal=TRUE;
283
284 for (i=0; i<buffersize; i++)
285 if (a[i] != b[i])
286 {
287 equal = FALSE;
288 break;
289 }
290 }
291 else
292 equal = (memcmp(expect->bits, converted_bits, buffersize) == 0);
293
294 if (!equal && expect->alt_data)
295 equal = compare_bits(expect->alt_data, buffersize, converted_bits);
296
297 if (!equal && winetest_debug > 1)
298 {
299 UINT i, bps;
300 bps = expect->bpp / 8;
301 if (!bps) bps = buffersize;
302 printf("converted_bits (%u bytes):\n ", buffersize);
303 for (i = 0; i < buffersize; i++)
304 {
305 printf("%u,", converted_bits[i]);
306 if (!((i + 1) % 32)) printf("\n ");
307 else if (!((i+1) % bps)) printf(" ");
308 }
309 printf("\n");
310 }
311
312 return equal;
313}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define printf
Definition: freeldr.h:97
static BOOL near_equal(float a, float b)
Definition: converter.c:55
#define equal(x, y)
Definition: reader.cc:56
int winetest_debug

Referenced by compare_bitmap_data(), and compare_bits().

◆ CreateTestBitmap()

static void CreateTestBitmap ( const bitmap_data data,
BitmapTestSrc **  This 
)
static

Definition at line 215 of file converter.c.

216{
217 *This = HeapAlloc(GetProcessHeap(), 0, sizeof(**This));
218
219 if (*This)
220 {
221 (*This)->IWICBitmapSource_iface.lpVtbl = &BitmapTestSrc_Vtbl;
222 (*This)->ref = 1;
223 (*This)->data = data;
224 }
225}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static const IWICBitmapSourceVtbl BitmapTestSrc_Vtbl
Definition: converter.c:204

Referenced by test_conversion(), test_converter_4bppGray(), test_converter_8bppGray(), test_converter_8bppIndexed(), test_default_converter(), test_invalid_conversion(), and test_multi_encoder_impl().

◆ DeleteTestBitmap()

static void DeleteTestBitmap ( BitmapTestSrc This)
static

Definition at line 227 of file converter.c.

228{
229 ok(This->IWICBitmapSource_iface.lpVtbl == &BitmapTestSrc_Vtbl, "test bitmap %p deleted with incorrect vtable\n", This);
230 ok(This->ref == 1, "test bitmap %p deleted with %li references instead of 1\n", This, This->ref);
232}

Referenced by test_conversion(), test_converter_4bppGray(), test_converter_8bppGray(), test_converter_8bppIndexed(), test_default_converter(), test_invalid_conversion(), and test_multi_encoder_impl().

◆ find_property_index()

static int find_property_index ( const WCHAR name,
PROPBAG2 *  all_props,
int  all_prop_cnt 
)
static

Definition at line 825 of file converter.c.

826{
827 int i;
828 for (i=0; i < all_prop_cnt; i++)
829 {
830 if (lstrcmpW(name, all_props[i].pstrName) == 0)
831 return i;
832 }
833 return -1;
834}
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243

Referenced by test_specific_encoder_properties().

◆ impl_from_IWICBitmapSource()

static BitmapTestSrc * impl_from_IWICBitmapSource ( IWICBitmapSource iface)
inlinestatic

Definition at line 60 of file converter.c.

61{
62 return CONTAINING_RECORD(iface, BitmapTestSrc, IWICBitmapSource_iface);
63}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by BitmapTestSrc_AddRef(), BitmapTestSrc_CopyPalette(), BitmapTestSrc_CopyPixels(), BitmapTestSrc_GetPixelFormat(), BitmapTestSrc_GetResolution(), BitmapTestSrc_GetSize(), and BitmapTestSrc_Release().

◆ is_indexed_format()

static BOOL is_indexed_format ( const GUID format)
static

Definition at line 315 of file converter.c.

316{
317 if (IsEqualGUID(format, &GUID_WICPixelFormat1bppIndexed) ||
318 IsEqualGUID(format, &GUID_WICPixelFormat2bppIndexed) ||
319 IsEqualGUID(format, &GUID_WICPixelFormat4bppIndexed) ||
320 IsEqualGUID(format, &GUID_WICPixelFormat8bppIndexed))
321 return TRUE;
322
323 return FALSE;
324}

Referenced by compare_bitmap_data().

◆ IWICBitmapFrameEncode_WriteSource_Proxy()

HRESULT STDMETHODCALLTYPE IWICBitmapFrameEncode_WriteSource_Proxy ( IWICBitmapFrameEncode This,
IWICBitmapSource pIBitmapSource,
WICRect prc 
)

Referenced by test_multi_encoder_impl().

◆ load_stream()

static void load_stream ( IUnknown reader,
IStream stream 
)
static

Definition at line 961 of file converter.c.

962{
963 HRESULT hr;
964 IWICPersistStream *persist;
965
966 hr = IUnknown_QueryInterface(reader, &IID_IWICPersistStream, (void **)&persist);
967 ok(hr == S_OK, "QueryInterface failed, hr=%lx\n", hr);
968
969 hr = IWICPersistStream_LoadEx(persist, stream, NULL, 0);
970 ok(hr == S_OK, "LoadEx failed, hr=%lx\n", hr);
971
972 IWICPersistStream_Release(persist);
973}

Referenced by check_tiff_format().

◆ near_equal()

static BOOL near_equal ( float  a,
float  b 
)
static

Definition at line 55 of file converter.c.

56{
57 return fabsf(a - b) < 0.001;
58}
_Check_return_ __CRT_INLINE float __CRTDECL fabsf(_In_ float x)
Definition: math.h:193

Referenced by compare_bits().

◆ START_TEST()

START_TEST ( converter  )

Definition at line 2032 of file converter.c.

2033{
2034 HRESULT hr;
2035
2037
2038 hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
2039 &IID_IWICImagingFactory, (void **)&factory);
2040 ok(hr == S_OK, "failed to create factory: %#lx\n", hr);
2041
2042 test_conversion(&testdata_24bppRGB, &testdata_1bppIndexed, "24bppRGB -> 1bppIndexed", TRUE);
2043 test_conversion(&testdata_24bppRGB, &testdata_2bppIndexed, "24bppRGB -> 2bppIndexed", TRUE);
2044 test_conversion(&testdata_24bppRGB, &testdata_4bppIndexed, "24bppRGB -> 4bppIndexed", TRUE);
2045 test_conversion(&testdata_24bppRGB, &testdata_8bppIndexed, "24bppRGB -> 8bppIndexed", FALSE);
2046
2047 test_conversion(&testdata_BlackWhite, &testdata_8bppIndexed_BW, "BlackWhite -> 8bppIndexed", TRUE);
2048 test_conversion(&testdata_1bppIndexed, &testdata_8bppIndexed_BW, "1bppIndexed -> 8bppIndexed", TRUE);
2049 test_conversion(&testdata_2bppIndexed, &testdata_8bppIndexed_4colors, "2bppIndexed -> 8bppIndexed", TRUE);
2050 test_conversion(&testdata_4bppIndexed, &testdata_8bppIndexed, "4bppIndexed -> 8bppIndexed", TRUE);
2051
2056
2061
2062 test_conversion(&testdata_24bppBGR, &testdata_24bppBGR, "24bppBGR -> 24bppBGR", FALSE);
2063 test_conversion(&testdata_24bppBGR, &testdata_24bppRGB, "24bppBGR -> 24bppRGB", FALSE);
2064
2065 test_conversion(&testdata_24bppRGB, &testdata_24bppRGB, "24bppRGB -> 24bppRGB", FALSE);
2066 test_conversion(&testdata_24bppRGB, &testdata_24bppBGR, "24bppRGB -> 24bppBGR", FALSE);
2067
2068 test_conversion(&testdata_32bppBGR, &testdata_24bppRGB, "32bppBGR -> 24bppRGB", FALSE);
2069 test_conversion(&testdata_24bppRGB, &testdata_32bppBGR, "24bppRGB -> 32bppBGR", FALSE);
2070 test_conversion(&testdata_32bppBGRA, &testdata_24bppRGB, "32bppBGRA -> 24bppRGB", FALSE);
2071 test_conversion(&testdata_32bppRGBA, &testdata_24bppBGR, "32bppRGBA -> 24bppBGR", FALSE);
2072
2073 test_conversion(&testdata_32bppRGBA, &testdata_32bppBGRA, "32bppRGBA -> 32bppBGRA", FALSE);
2074 test_conversion(&testdata_32bppBGRA, &testdata_32bppRGBA, "32bppBGRA -> 32bppRGBA", FALSE);
2075
2076 test_conversion(&testdata_64bppRGBA, &testdata_32bppRGBA, "64bppRGBA -> 32bppRGBA", FALSE);
2077 test_conversion(&testdata_64bppRGBA, &testdata_32bppRGB, "64bppRGBA -> 32bppRGB", FALSE);
2078
2079 test_conversion(&testdata_24bppRGB, &testdata_32bppGrayFloat, "24bppRGB -> 32bppGrayFloat", FALSE);
2080 test_conversion(&testdata_32bppBGR, &testdata_32bppGrayFloat, "32bppBGR -> 32bppGrayFloat", FALSE);
2081
2082 test_conversion(&testdata_24bppBGR, &testdata_8bppGray, "24bppBGR -> 8bppGray", FALSE);
2083 test_conversion(&testdata_32bppBGR, &testdata_8bppGray, "32bppBGR -> 8bppGray", FALSE);
2084 test_conversion(&testdata_32bppGrayFloat, &testdata_24bppBGR_gray, "32bppGrayFloat -> 24bppBGR gray", FALSE);
2085 test_conversion(&testdata_32bppGrayFloat, &testdata_8bppGray, "32bppGrayFloat -> 8bppGray", FALSE);
2086 test_conversion(&testdata_32bppBGRA, &testdata_16bppBGRA5551, "32bppBGRA -> 16bppBGRA5551", FALSE);
2087 test_conversion(&testdata_48bppRGB, &testdata_64bppRGBA_2, "48bppRGB -> 64bppRGBA", FALSE);
2088
2094
2095 test_encoder(&testdata_8bppIndexed, &CLSID_WICGifEncoder,
2096 &testdata_8bppIndexed, &CLSID_WICGifDecoder, "GIF encoder 8bppIndexed");
2097
2098 test_encoder(&testdata_BlackWhite, &CLSID_WICPngEncoder,
2099 &testdata_BlackWhite, &CLSID_WICPngDecoder, "PNG encoder BlackWhite");
2100 test_encoder(&testdata_1bppIndexed, &CLSID_WICPngEncoder,
2101 &testdata_1bppIndexed, &CLSID_WICPngDecoder, "PNG encoder 1bppIndexed");
2102 test_encoder(&testdata_2bppIndexed, &CLSID_WICPngEncoder,
2103 &testdata_2bppIndexed, &CLSID_WICPngDecoder, "PNG encoder 2bppIndexed");
2104 test_encoder(&testdata_4bppIndexed, &CLSID_WICPngEncoder,
2105 &testdata_4bppIndexed, &CLSID_WICPngDecoder, "PNG encoder 4bppIndexed");
2106 test_encoder(&testdata_8bppIndexed, &CLSID_WICPngEncoder,
2107 &testdata_8bppIndexed, &CLSID_WICPngDecoder, "PNG encoder 8bppIndexed");
2108 test_encoder(&testdata_24bppBGR, &CLSID_WICPngEncoder,
2109 &testdata_24bppBGR, &CLSID_WICPngDecoder, "PNG encoder 24bppBGR");
2110if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in Wine */
2111{
2112 test_encoder(&testdata_32bppBGR, &CLSID_WICPngEncoder,
2113 &testdata_24bppBGR, &CLSID_WICPngDecoder, "PNG encoder 32bppBGR");
2114}
2115
2116 test_encoder(&testdata_BlackWhite, &CLSID_WICBmpEncoder,
2117 &testdata_1bppIndexed, &CLSID_WICBmpDecoder, "BMP encoder BlackWhite");
2118 test_encoder(&testdata_1bppIndexed, &CLSID_WICBmpEncoder,
2119 &testdata_1bppIndexed, &CLSID_WICBmpDecoder, "BMP encoder 1bppIndexed");
2120 test_encoder(&testdata_2bppIndexed, &CLSID_WICBmpEncoder,
2121 &testdata_4bppIndexed, &CLSID_WICBmpDecoder, "BMP encoder 2bppIndexed");
2122 test_encoder(&testdata_4bppIndexed, &CLSID_WICBmpEncoder,
2123 &testdata_4bppIndexed, &CLSID_WICBmpDecoder, "BMP encoder 4bppIndexed");
2124 test_encoder(&testdata_8bppIndexed, &CLSID_WICBmpEncoder,
2125 &testdata_8bppIndexed, &CLSID_WICBmpDecoder, "BMP encoder 8bppIndexed");
2126 test_encoder(&testdata_32bppBGR, &CLSID_WICBmpEncoder,
2127 &testdata_32bppBGR, &CLSID_WICBmpDecoder, "BMP encoder 32bppBGR");
2128
2129 test_encoder(&testdata_BlackWhite, &CLSID_WICTiffEncoder,
2130 &testdata_BlackWhite, &CLSID_WICTiffDecoder, "TIFF encoder BlackWhite");
2131 test_encoder(&testdata_1bppIndexed, &CLSID_WICTiffEncoder,
2132 &testdata_1bppIndexed, &CLSID_WICTiffDecoder, "TIFF encoder 1bppIndexed");
2133 test_encoder(&testdata_2bppIndexed, &CLSID_WICTiffEncoder,
2134 &testdata_4bppIndexed, &CLSID_WICTiffDecoder, "TIFF encoder 2bppIndexed");
2135 test_encoder(&testdata_4bppIndexed, &CLSID_WICTiffEncoder,
2136 &testdata_4bppIndexed, &CLSID_WICTiffDecoder, "TIFF encoder 4bppIndexed");
2137 test_encoder(&testdata_8bppIndexed, &CLSID_WICTiffEncoder,
2138 &testdata_8bppIndexed, &CLSID_WICTiffDecoder, "TIFF encoder 8bppIndexed");
2139 test_encoder(&testdata_24bppBGR, &CLSID_WICTiffEncoder,
2140 &testdata_24bppBGR, &CLSID_WICTiffDecoder, "TIFF encoder 24bppBGR");
2141
2142 test_encoder(&testdata_24bppBGR, &CLSID_WICJpegEncoder,
2143 &testdata_24bppBGR, NULL, "JPEG encoder 24bppBGR");
2144
2145 test_multi_encoder(multiple_frames, &CLSID_WICTiffEncoder,
2146 multiple_frames, &CLSID_WICTiffDecoder, NULL, NULL, "TIFF encoder multi-frame", NULL);
2147
2149
2150 test_multi_encoder(single_frame, &CLSID_WICPngEncoder,
2151 single_frame, &CLSID_WICPngDecoder, NULL, png_interlace_settings, "PNG encoder interlaced", NULL);
2152
2153 IWICImagingFactory_Release(factory);
2154
2156}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static const struct bitmap_data testdata_8bppGray
Definition: converter.c:590
static const struct bitmap_data testdata_48bppRGB
Definition: converter.c:629
static void test_converter_4bppGray(void)
Definition: converter.c:710
static const struct setting png_interlace_settings[]
Definition: converter.c:1822
static const struct bitmap_data testdata_32bppRGBA
Definition: converter.c:501
static const struct bitmap_data testdata_32bppPBGRA
Definition: converter.c:523
static const struct bitmap_data testdata_BlackWhite
Definition: converter.c:386
static const struct bitmap_data testdata_4bppIndexed
Definition: converter.c:403
static const struct bitmap_data testdata_8bppIndexed_BW
Definition: converter.c:409
static const struct bitmap_data testdata_24bppBGR_gray
Definition: converter.c:602
static const struct bitmap_data testdata_32bppPRGBA
Definition: converter.c:525
static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID *clsid_encoder, const struct bitmap_data **dsts, const CLSID *clsid_decoder, WICRect *rc, const struct setting *settings, const char *name, IWICPalette *palette)
Definition: converter.c:1741
static const struct bitmap_data testdata_32bppBGR
Definition: converter.c:465
static const struct bitmap_data testdata_32bppGrayFloat
Definition: converter.c:562
static const struct bitmap_data testdata_64bppRGBA
Definition: converter.c:537
static void test_default_converter(void)
Definition: converter.c:677
static void test_encoder_rects(void)
Definition: converter.c:1781
static const struct bitmap_data testdata_8bppIndexed
Definition: converter.c:421
static const struct bitmap_data * single_frame[2]
Definition: converter.c:1818
static const struct bitmap_data testdata_8bppIndexed_4colors
Definition: converter.c:415
static const struct bitmap_data * multiple_frames[3]
Definition: converter.c:1813
static void test_conversion(const struct bitmap_data *src, const struct bitmap_data *dst, const char *name, BOOL todo)
Definition: converter.c:639
static void test_converter_8bppGray(void)
Definition: converter.c:743
static const struct bitmap_data testdata_32bppBGRA80
Definition: converter.c:467
static void test_invalid_conversion(void)
Definition: converter.c:662
static const struct bitmap_data testdata_24bppRGB
Definition: converter.c:445
static const struct bitmap_data testdata_16bppBGRA5551
Definition: converter.c:622
static const struct bitmap_data testdata_2bppIndexed
Definition: converter.c:395
static const struct bitmap_data testdata_32bppBGRA
Definition: converter.c:499
static const struct bitmap_data testdata_32bppRGB
Definition: converter.c:503
static const struct bitmap_data testdata_1bppIndexed
Definition: converter.c:388
static void test_encoder(const struct bitmap_data *src, const CLSID *clsid_encoder, const struct bitmap_data *dst, const CLSID *clsid_decoder, const char *name)
Definition: converter.c:1749
static const struct bitmap_data testdata_24bppBGR
Definition: converter.c:433
static const struct bitmap_data testdata_32bppRGBA80
Definition: converter.c:469
static void test_converter_8bppIndexed(void)
Definition: converter.c:1827
static const struct bitmap_data testdata_64bppRGBA_2
Definition: converter.c:636
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278
const char * winetest_platform
Definition: main.c:439

◆ test_conversion()

static void test_conversion ( const struct bitmap_data src,
const struct bitmap_data dst,
const char name,
BOOL  todo 
)
static

Definition at line 639 of file converter.c.

640{
641 BitmapTestSrc *src_obj;
642 IWICBitmapSource *dst_bitmap;
643 HRESULT hr;
644
645 CreateTestBitmap(src, &src_obj);
646
647 hr = WICConvertBitmapSource(dst->format, &src_obj->IWICBitmapSource_iface, &dst_bitmap);
649 ok(hr == S_OK ||
650 broken(hr == E_INVALIDARG || hr == WINCODEC_ERR_COMPONENTNOTFOUND) /* XP */, "WICConvertBitmapSource(%s) failed, hr=%lx\n", name, hr);
651
652 if (hr == S_OK)
653 {
654 compare_bitmap_data(src, dst, dst_bitmap, name);
655
656 IWICBitmapSource_Release(dst_bitmap);
657 }
658
659 DeleteTestBitmap(src_obj);
660}
#define broken(x)
Definition: atltest.h:178
HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst)
Definition: info.c:2437
BOOL todo
Definition: filedlg.c:313
#define todo_wine_if(is_todo)
Definition: custom.c:86
static void CreateTestBitmap(const bitmap_data *data, BitmapTestSrc **This)
Definition: converter.c:215
static void compare_bitmap_data(const struct bitmap_data *src, const struct bitmap_data *expect, IWICBitmapSource *source, const char *name)
Definition: converter.c:326
static void DeleteTestBitmap(BitmapTestSrc *This)
Definition: converter.c:227
IWICBitmapSource IWICBitmapSource_iface
Definition: converter.c:47
#define WINCODEC_ERR_COMPONENTNOTFOUND
Definition: winerror.h:3296

Referenced by START_TEST().

◆ test_converter_4bppGray()

static void test_converter_4bppGray ( void  )
static

Definition at line 710 of file converter.c.

711{
712 BitmapTestSrc *src_obj;
713 IWICFormatConverter *converter;
714 BOOL can_convert = TRUE;
715 HRESULT hr;
716
718
719 hr = CoCreateInstance(&CLSID_WICDefaultFormatConverter, NULL, CLSCTX_INPROC_SERVER,
720 &IID_IWICFormatConverter, (void**)&converter);
721 ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
722 if (SUCCEEDED(hr))
723 {
724 hr = IWICFormatConverter_CanConvert(converter, &GUID_WICPixelFormat32bppBGRA,
725 &GUID_WICPixelFormat4bppGray, &can_convert);
726 ok(SUCCEEDED(hr), "CanConvert returned %lx\n", hr);
727 todo_wine ok(can_convert, "expected TRUE, got %i\n", can_convert);
728
729 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
730 &GUID_WICPixelFormat4bppGray, WICBitmapDitherTypeNone, NULL, 0.0,
732 todo_wine ok(SUCCEEDED(hr), "Initialize returned %lx\n", hr);
733
734 if (SUCCEEDED(hr))
735 compare_bitmap_data(&testdata_32bppBGRA, &testdata_4bppGray, (IWICBitmapSource*)converter, "4bppGray converter");
736
737 IWICFormatConverter_Release(converter);
738 }
739
740 DeleteTestBitmap(src_obj);
741}
#define todo_wine
Definition: custom.c:89
static const struct bitmap_data testdata_4bppGray
Definition: converter.c:574
@ WICBitmapDitherTypeNone
Definition: wincodec.idl:57
@ WICBitmapPaletteTypeCustom
Definition: wincodec.idl:92

Referenced by START_TEST().

◆ test_converter_8bppGray()

static void test_converter_8bppGray ( void  )
static

Definition at line 743 of file converter.c.

744{
745 BitmapTestSrc *src_obj;
746 IWICFormatConverter *converter;
747 BOOL can_convert = TRUE;
748 HRESULT hr;
749
751
752 hr = CoCreateInstance(&CLSID_WICDefaultFormatConverter, NULL, CLSCTX_INPROC_SERVER,
753 &IID_IWICFormatConverter, (void**)&converter);
754 ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
755 if (SUCCEEDED(hr))
756 {
757 hr = IWICFormatConverter_CanConvert(converter, &GUID_WICPixelFormat32bppBGRA,
758 &GUID_WICPixelFormat8bppGray, &can_convert);
759 ok(SUCCEEDED(hr), "CanConvert returned %lx\n", hr);
760 ok(can_convert, "expected TRUE, got %i\n", can_convert);
761
762 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
763 &GUID_WICPixelFormat8bppGray, WICBitmapDitherTypeNone, NULL, 0.0,
765 ok(SUCCEEDED(hr), "Initialize returned %lx\n", hr);
766
767 if (SUCCEEDED(hr))
768 compare_bitmap_data(&testdata_32bppBGRA, &testdata_8bppGray, (IWICBitmapSource*)converter, "8bppGray converter");
769
770 IWICFormatConverter_Release(converter);
771 }
772
773 DeleteTestBitmap(src_obj);
774}

Referenced by START_TEST().

◆ test_converter_8bppIndexed()

static void test_converter_8bppIndexed ( void  )
static

Definition at line 1827 of file converter.c.

1828{
1829 HRESULT hr;
1830 BitmapTestSrc *src_obj;
1831 IWICFormatConverter *converter;
1833 UINT count, i;
1834 BYTE buf[32 * 2 * 3]; /* enough to hold 32x2 24bppBGR data */
1835
1837
1838 hr = IWICImagingFactory_CreatePalette(factory, &palette);
1839 ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
1840 count = 0xdeadbeef;
1841 hr = IWICPalette_GetColorCount(palette, &count);
1842 ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
1843 ok(count == 0, "expected 0, got %u\n", count);
1844
1845 /* NULL palette + Custom type */
1846 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1847 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1848 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1849 &GUID_WICPixelFormat24bppBGR, WICBitmapDitherTypeNone,
1851 ok(hr == S_OK, "Initialize error %#lx\n", hr);
1852 hr = IWICFormatConverter_CopyPalette(converter, palette);
1853 ok(hr == 0xdeadbeef, "unexpected error %#lx\n", hr);
1854 hr = IWICFormatConverter_CopyPixels(converter, NULL, 32 * 3, sizeof(buf), buf);
1855 ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
1856 IWICFormatConverter_Release(converter);
1857
1858 /* NULL palette + Custom type */
1859 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1860 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1861 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1862 &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
1864 ok(hr == E_INVALIDARG, "unexpected error %#lx\n", hr);
1865 hr = IWICFormatConverter_CopyPalette(converter, palette);
1866 ok(hr == WINCODEC_ERR_WRONGSTATE, "unexpected error %#lx\n", hr);
1867 hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
1868 ok(hr == WINCODEC_ERR_WRONGSTATE, "unexpected error %#lx\n", hr);
1869 IWICFormatConverter_Release(converter);
1870
1871 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1872 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1873 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1874 &GUID_WICPixelFormat4bppIndexed, WICBitmapDitherTypeNone,
1876 ok(hr == E_INVALIDARG, "unexpected error %#lx\n", hr);
1877 IWICFormatConverter_Release(converter);
1878
1879 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1880 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1881 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1882 &GUID_WICPixelFormat2bppIndexed, WICBitmapDitherTypeNone,
1884 ok(hr == E_INVALIDARG, "unexpected error %#lx\n", hr);
1885 IWICFormatConverter_Release(converter);
1886
1887 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1888 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1889 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1890 &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
1892 ok(hr == E_INVALIDARG, "unexpected error %#lx\n", hr);
1893 IWICFormatConverter_Release(converter);
1894
1895 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1896 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1897 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1898 &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
1900 todo_wine ok(hr == S_OK, "unexpected error %#lx\n", hr);
1901 IWICFormatConverter_Release(converter);
1902
1903 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1904 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1905 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1906 &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
1908 todo_wine ok(hr == S_OK, "unexpected error %#lx\n", hr);
1909 IWICFormatConverter_Release(converter);
1910
1911 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1912 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1913 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1914 &GUID_WICPixelFormat1bppIndexed, WICBitmapDitherTypeNone,
1916 todo_wine ok(hr == E_INVALIDARG, "unexpected error %#lx\n", hr);
1917 IWICFormatConverter_Release(converter);
1918
1919 /* empty palette + Custom type */
1920 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1921 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1922 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1923 &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
1925 ok(hr == S_OK, "Initialize error %#lx\n", hr);
1926 hr = IWICFormatConverter_CopyPalette(converter, palette);
1927 ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
1928 count = 0xdeadbeef;
1929 hr = IWICPalette_GetColorCount(palette, &count);
1930 ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
1931 ok(count == 0, "expected 0, got %u\n", count);
1932 memset(buf, 0xaa, sizeof(buf));
1933 hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
1934 ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
1935 count = 0;
1936 for (i = 0; i < 32 * 2; i++)
1937 if (buf[i] != 0) count++;
1938 ok(count == 0, "expected 0\n");
1939 IWICFormatConverter_Release(converter);
1940
1941 /* NULL palette + Predefined type */
1942 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1943 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1944 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1945 &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
1947 ok(hr == S_OK, "Initialize error %#lx\n", hr);
1948 hr = IWICFormatConverter_CopyPalette(converter, palette);
1949 ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
1950 count = 0xdeadbeef;
1951 hr = IWICPalette_GetColorCount(palette, &count);
1952 ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
1953 ok(count == 16, "expected 16, got %u\n", count);
1954 hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
1955 ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
1956 count = 0;
1957 for (i = 0; i < 32 * 2; i++)
1958 if (buf[i] != 0) count++;
1959 ok(count != 0, "expected != 0\n");
1960 IWICFormatConverter_Release(converter);
1961
1962 /* not empty palette + Predefined type */
1963 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1964 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1965 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1966 &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
1968 ok(hr == S_OK, "Initialize error %#lx\n", hr);
1969 hr = IWICFormatConverter_CopyPalette(converter, palette);
1970 ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
1971 count = 0xdeadbeef;
1972 hr = IWICPalette_GetColorCount(palette, &count);
1973 ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
1974 ok(count == 16, "expected 16, got %u\n", count);
1975 hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
1976 ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
1977 count = 0;
1978 for (i = 0; i < 32 * 2; i++)
1979 if (buf[i] != 0) count++;
1980 ok(count != 0, "expected != 0\n");
1981 IWICFormatConverter_Release(converter);
1982
1983 /* not empty palette + MedianCut type */
1984 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
1985 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
1986 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
1987 &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
1989 ok(hr == S_OK, "Initialize error %#lx\n", hr);
1990 hr = IWICFormatConverter_CopyPalette(converter, palette);
1991 ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
1992 count = 0xdeadbeef;
1993 hr = IWICPalette_GetColorCount(palette, &count);
1994 ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
1995 ok(count == 16, "expected 16, got %u\n", count);
1996 hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
1997 ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
1998 count = 0;
1999 for (i = 0; i < 32 * 2; i++)
2000 if (buf[i] != 0) count++;
2001 ok(count != 0, "expected != 0\n");
2002 IWICFormatConverter_Release(converter);
2003
2004 /* NULL palette + MedianCut type */
2005 hr = IWICImagingFactory_CreateFormatConverter(factory, &converter);
2006 ok(hr == S_OK, "CreateFormatConverter error %#lx\n", hr);
2007 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
2008 &GUID_WICPixelFormat8bppIndexed, WICBitmapDitherTypeNone,
2010 ok(hr == S_OK || broken(hr == E_INVALIDARG) /* XP */, "Initialize error %#lx\n", hr);
2011 if (hr == S_OK)
2012 {
2013 hr = IWICFormatConverter_CopyPalette(converter, palette);
2014 ok(hr == S_OK, "CopyPalette error %#lx\n", hr);
2015 count = 0xdeadbeef;
2016 hr = IWICPalette_GetColorCount(palette, &count);
2017 ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
2018 ok(count == 8, "expected 8, got %u\n", count);
2019 hr = IWICFormatConverter_CopyPixels(converter, NULL, 32, sizeof(buf), buf);
2020 ok(hr == S_OK, "CopyPixels error %#lx\n", hr);
2021 count = 0;
2022 for (i = 0; i < 32 * 2; i++)
2023 if (buf[i] != 0) count++;
2024 ok(count != 0, "expected != 0\n");
2025 }
2026 IWICFormatConverter_Release(converter);
2027
2028 IWICPalette_Release(palette);
2029 DeleteTestBitmap(src_obj);
2030}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
@ WICBitmapPaletteTypeFixedBW
Definition: wincodec.idl:94
@ WICBitmapPaletteTypeFixedHalftone64
Definition: wincodec.idl:97
@ WICBitmapPaletteTypeFixedGray16
Definition: wincodec.idl:104
@ WICBitmapPaletteTypeMedianCut
Definition: wincodec.idl:93
@ WICBitmapPaletteTypeFixedHalftone8
Definition: wincodec.idl:95
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:3281

Referenced by START_TEST().

◆ test_default_converter()

static void test_default_converter ( void  )
static

Definition at line 677 of file converter.c.

678{
679 BitmapTestSrc *src_obj;
680 IWICFormatConverter *converter;
681 BOOL can_convert = TRUE;
682 HRESULT hr;
683
685
686 hr = CoCreateInstance(&CLSID_WICDefaultFormatConverter, NULL, CLSCTX_INPROC_SERVER,
687 &IID_IWICFormatConverter, (void**)&converter);
688 ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
689 if (SUCCEEDED(hr))
690 {
691 hr = IWICFormatConverter_CanConvert(converter, &GUID_WICPixelFormat32bppBGRA,
692 &GUID_WICPixelFormat32bppBGR, &can_convert);
693 ok(SUCCEEDED(hr), "CanConvert returned %lx\n", hr);
694 ok(can_convert, "expected TRUE, got %i\n", can_convert);
695
696 hr = IWICFormatConverter_Initialize(converter, &src_obj->IWICBitmapSource_iface,
697 &GUID_WICPixelFormat32bppBGR, WICBitmapDitherTypeNone, NULL, 0.0,
699 ok(SUCCEEDED(hr), "Initialize returned %lx\n", hr);
700
701 if (SUCCEEDED(hr))
702 compare_bitmap_data(&testdata_32bppBGRA, &testdata_32bppBGR, (IWICBitmapSource*)converter, "default converter");
703
704 IWICFormatConverter_Release(converter);
705 }
706
707 DeleteTestBitmap(src_obj);
708}

Referenced by START_TEST().

◆ test_encoder()

static void test_encoder ( const struct bitmap_data src,
const CLSID clsid_encoder,
const struct bitmap_data dst,
const CLSID clsid_decoder,
const char name 
)
static

Definition at line 1749 of file converter.c.

1751{
1752 const struct bitmap_data *srcs[2];
1753 const struct bitmap_data *dsts[2];
1754 WICColor colors[256];
1756 HRESULT hr;
1757
1758 hr = IWICImagingFactory_CreatePalette(factory, &palette);
1759 ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
1760
1761 memset(colors, 0, sizeof(colors));
1762 colors[0] = 0x11111111;
1763 colors[1] = 0x22222222;
1764 colors[2] = 0x33333333;
1765 colors[3] = 0x44444444;
1766 colors[4] = 0x55555555;
1767 /* TIFF decoder fails to decode a 8bpp frame if palette has less than 256 colors */
1768 hr = IWICPalette_InitializeCustom(palette, colors, 256);
1769 ok(hr == S_OK, "InitializeCustom error %#lx\n", hr);
1770
1771 srcs[0] = src;
1772 srcs[1] = NULL;
1773 dsts[0] = dst;
1774 dsts[1] = NULL;
1775
1776 test_multi_encoder(srcs, clsid_encoder, dsts, clsid_decoder, NULL, NULL, name, palette);
1777
1778 IWICPalette_Release(palette);
1779}

Referenced by START_TEST().

◆ test_encoder_properties()

static void test_encoder_properties ( const CLSID clsid_encoder,
IPropertyBag2 options 
)
static

Definition at line 905 of file converter.c.

906{
907 HRESULT hr;
908 ULONG cProperties = 0;
909 ULONG cProperties2 = 0;
910 PROPBAG2 all_props[64] = {{0}}; /* Should be enough for every encoder out there */
911 int i;
912
913 /* CountProperties */
914 {
915 hr = IPropertyBag2_CountProperties(options, &cProperties);
916 ok(SUCCEEDED(hr), "Reading property count, hr=%lx\n", hr);
917 }
918
919 /* GetPropertyInfo */
920 {
921 hr = IPropertyBag2_GetPropertyInfo(options, cProperties, 1, all_props, &cProperties2);
922 ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "IPropertyBag2::GetPropertyInfo - iProperty out of bounce handled wrong, hr=%lx\n", hr);
923
924 hr = IPropertyBag2_GetPropertyInfo(options, 0, cProperties+1, all_props, &cProperties2);
925 ok(hr == WINCODEC_ERR_VALUEOUTOFRANGE, "IPropertyBag2::GetPropertyInfo - cProperty out of bounce handled wrong, hr=%lx\n", hr);
926
927 if (cProperties == 0) /* GetPropertyInfo can be called for zero items on Windows 8 but not on Windows 7 (wine behaves like Win8) */
928 {
929 cProperties2 = cProperties;
930 hr = S_OK;
931 }
932 else
933 {
934 hr = IPropertyBag2_GetPropertyInfo(options, 0, min(64, cProperties), all_props, &cProperties2);
935 ok(SUCCEEDED(hr), "Reading infos from property bag failed, hr=%lx\n", hr);
936 }
937
938 if (FAILED(hr))
939 return;
940
941 ok(cProperties == cProperties2, "Mismatch of property count (IPropertyBag2::CountProperties=%i, IPropertyBag2::GetPropertyInfo=%i)\n",
942 (int)cProperties, (int)cProperties2);
943 }
944
945 if (IsEqualCLSID(clsid_encoder, &CLSID_WICTiffEncoder))
947 else if (IsEqualCLSID(clsid_encoder, &CLSID_WICPngEncoder))
949 else if (IsEqualCLSID(clsid_encoder, &CLSID_WICJpegEncoder))
951 else if (IsEqualCLSID(clsid_encoder, &CLSID_WICBmpEncoder))
953
954 for (i=0; i < cProperties2; i++)
955 {
956 ok(all_props[i].pstrName != NULL, "Unset property name in output of IPropertyBag2::GetPropertyInfo\n");
957 CoTaskMemFree(all_props[i].pstrName);
958 }
959}
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define FAILED(hr)
Definition: intsafe.h:51
static const struct property_opt_test_data testdata_jpeg_props[]
Definition: converter.c:810
static const struct property_opt_test_data testdata_bmp_props[]
Definition: converter.c:820
static void test_specific_encoder_properties(IPropertyBag2 *options, const property_opt_test_data *data, PROPBAG2 *all_props, int all_prop_cnt)
Definition: converter.c:836
static const struct property_opt_test_data testdata_png_props[]
Definition: converter.c:804
static const struct property_opt_test_data testdata_tiff_props[]
Definition: converter.c:798
#define min(a, b)
Definition: monoChain.cc:55
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
#define WINCODEC_ERR_VALUEOUTOFRANGE
Definition: winerror.h:3282

Referenced by test_multi_encoder_impl().

◆ test_encoder_rects()

static void test_encoder_rects ( void  )
static

Definition at line 1781 of file converter.c.

1782{
1783 const struct bitmap_data *srcs[2];
1784 const struct bitmap_data *dsts[2];
1785 WICRect rc;
1786
1787 srcs[0] = &testdata_24bppBGR;
1788 srcs[1] = NULL;
1789 dsts[0] = &testdata_24bppBGR;
1790 dsts[1] = NULL;
1791
1792 rc.X = 0;
1793 rc.Y = 0;
1794 rc.Width = 32;
1795 rc.Height = 2;
1796
1797 test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects full", NULL);
1798
1799 rc.Width = 0;
1800 test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects width=0", NULL);
1801
1802 rc.Width = -1;
1803 test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects width=-1", NULL);
1804
1805 rc.Width = 32;
1806 rc.Height = 0;
1807 test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects height=0", NULL);
1808
1809 rc.Height = -1;
1810 test_multi_encoder(srcs, &CLSID_WICTiffEncoder, dsts, &CLSID_WICTiffDecoder, &rc, NULL, "test_encoder_rects height=-1", NULL);
1811}

Referenced by START_TEST().

◆ test_invalid_conversion()

static void test_invalid_conversion ( void  )
static

Definition at line 662 of file converter.c.

663{
664 BitmapTestSrc *src_obj;
665 IWICBitmapSource *dst_bitmap;
666 HRESULT hr;
667
669
670 /* convert to a non-pixel-format GUID */
671 hr = WICConvertBitmapSource(&GUID_VendorMicrosoft, &src_obj->IWICBitmapSource_iface, &dst_bitmap);
672 ok(hr == WINCODEC_ERR_COMPONENTNOTFOUND, "WICConvertBitmapSource returned %lx\n", hr);
673
674 DeleteTestBitmap(src_obj);
675}

Referenced by START_TEST().

◆ test_multi_encoder()

static void test_multi_encoder ( const struct bitmap_data **  srcs,
const CLSID clsid_encoder,
const struct bitmap_data **  dsts,
const CLSID clsid_decoder,
WICRect rc,
const struct setting settings,
const char name,
IWICPalette palette 
)
static

Definition at line 1741 of file converter.c.

1744{
1745 test_multi_encoder_impl(srcs, clsid_encoder, dsts, clsid_decoder, rc, settings, name, palette, TRUE);
1746 test_multi_encoder_impl(srcs, clsid_encoder, dsts, clsid_decoder, rc, settings, name, palette, FALSE);
1747}
struct mke2fs_defaults settings[]
static void test_multi_encoder_impl(const struct bitmap_data **srcs, const CLSID *clsid_encoder, const struct bitmap_data **dsts, const CLSID *clsid_decoder, WICRect *rc, const struct setting *settings, const char *name, IWICPalette *palette, BOOL set_size)
Definition: converter.c:1375

Referenced by START_TEST(), test_encoder(), and test_encoder_rects().

◆ test_multi_encoder_impl()

static void test_multi_encoder_impl ( const struct bitmap_data **  srcs,
const CLSID clsid_encoder,
const struct bitmap_data **  dsts,
const CLSID clsid_decoder,
WICRect rc,
const struct setting settings,
const char name,
IWICPalette palette,
BOOL  set_size 
)
static

Definition at line 1375 of file converter.c.

1378{
1379 const GUID *container_format = NULL;
1380 HRESULT hr;
1382 BitmapTestSrc *src_obj;
1383 HGLOBAL hglobal;
1384 IStream *stream;
1385 IWICBitmapFrameEncode *frameencode;
1388 IWICBitmapFrameDecode *framedecode;
1390 GUID guid;
1391 int i;
1392
1393 hr = CoCreateInstance(clsid_encoder, NULL, CLSCTX_INPROC_SERVER,
1394 &IID_IWICBitmapEncoder, (void **)&encoder);
1395 ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
1396
1398 ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
1399
1400 hr = IWICBitmapEncoder_GetContainerFormat(encoder, NULL);
1401 ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
1402
1403 if (IsEqualGUID(clsid_encoder, &CLSID_WICPngEncoder))
1404 container_format = &GUID_ContainerFormatPng;
1405 else if (IsEqualGUID(clsid_encoder, &CLSID_WICBmpEncoder))
1406 container_format = &GUID_ContainerFormatBmp;
1407 else if (IsEqualGUID(clsid_encoder, &CLSID_WICTiffEncoder))
1408 container_format = &GUID_ContainerFormatTiff;
1409 else if (IsEqualGUID(clsid_encoder, &CLSID_WICJpegEncoder))
1410 container_format = &GUID_ContainerFormatJpeg;
1411 else if (IsEqualGUID(clsid_encoder, &CLSID_WICGifEncoder))
1412 container_format = &GUID_ContainerFormatGif;
1413 else
1414 ok(0, "Unknown encoder %s.\n", wine_dbgstr_guid(clsid_encoder));
1415
1416 if (container_format)
1417 {
1418 memset(&guid, 0, sizeof(guid));
1419 hr = IWICBitmapEncoder_GetContainerFormat(encoder, &guid);
1420 ok(SUCCEEDED(hr), "Failed to get container format, hr %#lx.\n", hr);
1421 ok(IsEqualGUID(container_format, &guid), "Unexpected container format %s.\n", wine_dbgstr_guid(&guid));
1422 }
1423
1424 hr = IWICBitmapEncoder_Initialize(encoder, stream, WICBitmapEncoderNoCache);
1425 ok(SUCCEEDED(hr), "Initialize failed, hr=%lx\n", hr);
1426
1427 /* Encoder options are optional. */
1428 hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frameencode, NULL);
1429 ok(SUCCEEDED(hr), "Failed to create encode frame, hr %#lx.\n", hr);
1430
1431 IStream_Release(stream);
1432 IWICBitmapEncoder_Release(encoder);
1433 IWICBitmapFrameEncode_Release(frameencode);
1434
1435 hr = CoCreateInstance(clsid_encoder, NULL, CLSCTX_INPROC_SERVER,
1436 &IID_IWICBitmapEncoder, (void**)&encoder);
1437 ok(SUCCEEDED(hr), "CoCreateInstance(%s) failed, hr=%lx\n", wine_dbgstr_guid(clsid_encoder), hr);
1438 if (SUCCEEDED(hr))
1439 {
1440 hglobal = GlobalAlloc(GMEM_MOVEABLE, 0);
1441 ok(hglobal != NULL, "GlobalAlloc failed\n");
1442 if (hglobal)
1443 {
1444 hr = CreateStreamOnHGlobal(hglobal, TRUE, &stream);
1445 ok(SUCCEEDED(hr), "CreateStreamOnHGlobal failed, hr=%lx\n", hr);
1446 }
1447
1448 if (hglobal && SUCCEEDED(hr))
1449 {
1450 if (palette)
1451 {
1452 hr = IWICBitmapEncoder_SetPalette(encoder, palette);
1453 ok(hr == WINCODEC_ERR_NOTINITIALIZED, "wrong error %#lx (%s)\n", hr, name);
1454 }
1455
1456 hr = IWICBitmapEncoder_Initialize(encoder, stream, WICBitmapEncoderNoCache);
1457 ok(SUCCEEDED(hr), "Initialize failed, hr=%lx\n", hr);
1458
1459 if (palette)
1460 {
1461 hr = IWICBitmapEncoder_SetPalette(encoder, palette);
1462 if (IsEqualGUID(clsid_encoder, &CLSID_WICGifEncoder))
1463 ok(hr == S_OK, "SetPalette failed, hr=%#lx\n", hr);
1464 else
1465 ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "wrong error %#lx\n", hr);
1466 hr = S_OK;
1467 }
1468
1469 i=0;
1470 while (SUCCEEDED(hr) && srcs[i])
1471 {
1472 CreateTestBitmap(srcs[i], &src_obj);
1473
1474 hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frameencode, &options);
1475 ok(SUCCEEDED(hr), "CreateFrame failed, hr=%lx\n", hr);
1476 if (SUCCEEDED(hr))
1477 {
1478 ok(options != NULL, "Encoder initialization has not created an property bag\n");
1479 if(options)
1480 test_encoder_properties(clsid_encoder, options);
1481
1482 if (settings)
1483 {
1484 int j;
1485 for (j=0; settings[j].name; j++)
1486 {
1487 PROPBAG2 propbag;
1488 VARIANT var;
1489
1490 memset(&propbag, 0, sizeof(propbag));
1491 memset(&var, 0, sizeof(var));
1492 propbag.pstrName = (LPOLESTR)settings[j].name;
1493 propbag.dwType = settings[j].type;
1494 V_VT(&var) = settings[j].vt;
1495 V_UNKNOWN(&var) = settings[j].value;
1496
1497 hr = IPropertyBag2_Write(options, 1, &propbag, &var);
1498 ok(SUCCEEDED(hr), "Writing property %s failed, hr=%lx\n", wine_dbgstr_w(settings[j].name), hr);
1499 }
1500 }
1501
1502 if (palette)
1503 {
1504 hr = IWICBitmapFrameEncode_SetPalette(frameencode, palette);
1505 ok(hr == WINCODEC_ERR_NOTINITIALIZED, "wrong error %#lx\n", hr);
1506 }
1507
1508 hr = IWICBitmapFrameEncode_Initialize(frameencode, options);
1509 ok(SUCCEEDED(hr), "Initialize failed, hr=%lx\n", hr);
1510
1511 memcpy(&pixelformat, srcs[i]->format, sizeof(GUID));
1512 hr = IWICBitmapFrameEncode_SetPixelFormat(frameencode, &pixelformat);
1513 ok(SUCCEEDED(hr), "SetPixelFormat failed, hr=%lx\n", hr);
1514 ok(IsEqualGUID(&pixelformat, dsts[i]->format) ||
1515 (IsEqualGUID(clsid_encoder, &CLSID_WICTiffEncoder) && srcs[i]->bpp == 2 && IsEqualGUID(&pixelformat, &GUID_WICPixelFormat4bppIndexed)) ||
1516 (IsEqualGUID(clsid_encoder, &CLSID_WICBmpEncoder) && srcs[i]->bpp == 2 && IsEqualGUID(&pixelformat, &GUID_WICPixelFormat4bppIndexed)),
1517 "SetPixelFormat changed the format to %s (%s)\n", wine_dbgstr_guid(&pixelformat), name);
1518
1519 if (set_size)
1520 {
1521 hr = IWICBitmapFrameEncode_SetSize(frameencode, srcs[i]->width, srcs[i]->height);
1522 ok(hr == S_OK, "SetSize failed, hr=%lx\n", hr);
1523 }
1524
1525 if (IsEqualGUID(clsid_encoder, &CLSID_WICPngEncoder))
1526 test_set_frame_palette(frameencode);
1527
1528 if (palette)
1529 {
1530 hr = IWICBitmapFrameEncode_SetPalette(frameencode, palette);
1531 ok(SUCCEEDED(hr), "SetPalette failed, hr=%lx (%s)\n", hr, name);
1532 }
1533
1534 hr = IWICBitmapFrameEncode_WriteSource(frameencode, &src_obj->IWICBitmapSource_iface, rc);
1535 if (rc && (rc->Width <= 0 || rc->Height <= 0))
1536 {
1537 /* WriteSource fails but WriteSource_Proxy succeeds. */
1538 ok(hr == E_INVALIDARG, "WriteSource should fail, hr=%lx (%s)\n", hr, name);
1540 if (!set_size && rc->Width < 0)
1541 todo_wine
1544 "WriteSource_Proxy(%dx%d) got unexpected hr %lx (%s)\n", rc->Width, rc->Height, hr, name);
1545 else
1546 ok(hr == S_OK, "WriteSource_Proxy failed, %dx%d, hr=%lx (%s)\n", rc->Width, rc->Height, hr, name);
1547 }
1548 else
1549 {
1550 if (rc)
1551 ok(SUCCEEDED(hr), "WriteSource(%dx%d) failed, hr=%lx (%s)\n", rc->Width, rc->Height, hr, name);
1552 else
1553 todo_wine_if((IsEqualGUID(clsid_encoder, &CLSID_WICTiffEncoder) && srcs[i]->bpp == 2) ||
1554 (IsEqualGUID(clsid_encoder, &CLSID_WICBmpEncoder) && srcs[i]->bpp == 2))
1555 ok(hr == S_OK, "WriteSource(NULL) failed, hr=%lx (%s)\n", hr, name);
1556
1557 }
1558
1559 if (SUCCEEDED(hr))
1560 {
1561 hr = IWICBitmapFrameEncode_Commit(frameencode);
1562 if (!set_size && rc && rc->Height < 0)
1563 todo_wine
1564 ok(hr == WINCODEC_ERR_UNEXPECTEDSIZE, "Commit got unexpected hr %lx (%s)\n", hr, name);
1565 else
1566 ok(hr == S_OK, "Commit failed, hr=%lx (%s)\n", hr, name);
1567 }
1568
1569 IWICBitmapFrameEncode_Release(frameencode);
1570 IPropertyBag2_Release(options);
1571 }
1572
1573 DeleteTestBitmap(src_obj);
1574
1575 i++;
1576 }
1577
1578 if (clsid_decoder == NULL)
1579 {
1580 IStream_Release(stream);
1581 IWICBitmapEncoder_Release(encoder);
1582 return;
1583 }
1584
1585 if (SUCCEEDED(hr))
1586 {
1587 hr = IWICBitmapEncoder_Commit(encoder);
1588 ok(SUCCEEDED(hr), "Commit failed, hr=%lx\n", hr);
1589
1590 if (IsEqualGUID(&pixelformat, dsts[0]->format))
1591 check_bitmap_format(stream, clsid_encoder, dsts[0]->format);
1592 }
1593
1594 if (SUCCEEDED(hr))
1595 {
1596 hr = CoCreateInstance(clsid_decoder, NULL, CLSCTX_INPROC_SERVER,
1597 &IID_IWICBitmapDecoder, (void**)&decoder);
1598 ok(SUCCEEDED(hr), "CoCreateInstance failed, hr=%lx\n", hr);
1599 }
1600
1601 if (SUCCEEDED(hr))
1602 {
1603 IWICPalette *frame_palette;
1604
1605 hr = IWICImagingFactory_CreatePalette(factory, &frame_palette);
1606 ok(hr == S_OK, "CreatePalette error %#lx\n", hr);
1607
1608 hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette);
1609 if (IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder))
1610 ok(hr == WINCODEC_ERR_WRONGSTATE, "wrong error %#lx\n", hr);
1611 else
1612 ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#lx\n", hr);
1613
1614 hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnDemand);
1615 ok(SUCCEEDED(hr), "Initialize failed, hr=%lx\n", hr);
1616
1617 hr = IWICBitmapDecoder_CopyPalette(decoder, frame_palette);
1618 if (IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder))
1619 ok(hr == S_OK || broken(hr == WINCODEC_ERR_FRAMEMISSING) /* XP */, "CopyPalette failed, hr=%#lx\n", hr);
1620 else
1621 ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#lx\n", hr);
1622
1623 hr = S_OK;
1624 i=0;
1625 while (SUCCEEDED(hr) && dsts[i])
1626 {
1627 hr = IWICBitmapDecoder_GetFrame(decoder, i, &framedecode);
1628 ok(SUCCEEDED(hr), "GetFrame failed, hr=%lx (%s)\n", hr, name);
1629
1630 if (SUCCEEDED(hr))
1631 {
1632 hr = IWICBitmapFrameDecode_GetPixelFormat(framedecode, &pixelformat);
1633 ok(hr == S_OK, "GetPixelFormat) failed, hr=%lx (%s)\n", hr, name);
1634 if (IsEqualGUID(&pixelformat, dsts[i]->format))
1635 compare_bitmap_data(srcs[i], dsts[i], (IWICBitmapSource*)framedecode, name);
1636
1637 hr = IWICBitmapFrameDecode_CopyPalette(framedecode, frame_palette);
1638 if (winetest_debug > 1)
1639 trace("%s, bpp %d, %s, hr %#lx\n", name, dsts[i]->bpp, wine_dbgstr_guid(dsts[i]->format), hr);
1640 if (dsts[i]->bpp > 8 || IsEqualGUID(dsts[i]->format, &GUID_WICPixelFormatBlackWhite))
1641 ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "wrong error %#lx\n", hr);
1642 else
1643 {
1644 UINT count, ret;
1645 WICColor colors[256];
1646
1647 ok(hr == S_OK, "CopyPalette error %#lx (%s)\n", hr, name);
1648
1649 count = 0;
1650 hr = IWICPalette_GetColorCount(frame_palette, &count);
1651 ok(hr == S_OK, "GetColorCount error %#lx\n", hr);
1652
1653 memset(colors, 0, sizeof(colors));
1654 ret = 0;
1655 hr = IWICPalette_GetColors(frame_palette, count, colors, &ret);
1656 ok(hr == S_OK, "GetColors error %#lx\n", hr);
1657 ok(ret == count, "expected %u, got %u\n", count, ret);
1658 if (IsEqualGUID(clsid_decoder, &CLSID_WICPngDecoder))
1659 {
1660 /* Newer libpng versions don't accept larger palettes than the declared
1661 * bit depth, so we need to generate the palette of the correct length.
1662 */
1663 ok(count == 256 || (dsts[i]->bpp == 1 && count == 2) ||
1664 (dsts[i]->bpp == 2 && count == 4) || (dsts[i]->bpp == 4 && count == 16),
1665 "expected 256, got %u (%s)\n", count, name);
1666
1667 ok(colors[0] == 0x11111111, "got %08x (%s)\n", colors[0], name);
1668 ok(colors[1] == 0x22222222, "got %08x (%s)\n", colors[1], name);
1669 if (count > 2)
1670 {
1671 ok(colors[2] == 0x33333333, "got %08x (%s)\n", colors[2], name);
1672 ok(colors[3] == 0x44444444, "got %08x (%s)\n", colors[3], name);
1673 if (count > 4)
1674 {
1675 ok(colors[4] == 0x55555555, "got %08x (%s)\n", colors[4], name);
1676 ok(colors[5] == 0, "got %08x (%s)\n", colors[5], name);
1677 }
1678 }
1679 }
1680 else if (IsEqualGUID(clsid_decoder, &CLSID_WICBmpDecoder) ||
1681 IsEqualGUID(clsid_decoder, &CLSID_WICTiffDecoder) ||
1682 IsEqualGUID(clsid_decoder, &CLSID_WICGifDecoder))
1683 {
1684 if (IsEqualGUID(&pixelformat, &GUID_WICPixelFormatBlackWhite) ||
1685 IsEqualGUID(&pixelformat, &GUID_WICPixelFormat8bppIndexed))
1686 {
1687 ok(count == 256, "expected 256, got %u (%s)\n", count, name);
1688
1689 ok(colors[0] == 0xff111111, "got %08x (%s)\n", colors[0], name);
1690 ok(colors[1] == 0xff222222, "got %08x (%s)\n", colors[1], name);
1691 ok(colors[2] == 0xff333333, "got %08x (%s)\n", colors[2], name);
1692 ok(colors[3] == 0xff444444, "got %08x (%s)\n", colors[3], name);
1693 ok(colors[4] == 0xff555555, "got %08x (%s)\n", colors[4], name);
1694 ok(colors[5] == 0xff000000, "got %08x (%s)\n", colors[5], name);
1695 }
1696 else if (IsEqualGUID(&pixelformat, &GUID_WICPixelFormat4bppIndexed))
1697 {
1698 ok(count == 16, "expected 16, got %u (%s)\n", count, name);
1699
1700 ok(colors[0] == 0xff111111, "got %08x (%s)\n", colors[0], name);
1701 ok(colors[1] == 0xff222222, "got %08x (%s)\n", colors[1], name);
1702 ok(colors[2] == 0xff333333, "got %08x (%s)\n", colors[2], name);
1703 ok(colors[3] == 0xff444444, "got %08x (%s)\n", colors[3], name);
1704 ok(colors[4] == 0xff555555, "got %08x (%s)\n", colors[4], name);
1705 ok(colors[5] == 0xff000000, "got %08x (%s)\n", colors[5], name);
1706 }
1707 else
1708 {
1709 ok(count == 2, "expected 2, got %u (%s)\n", count, name);
1710
1711 ok(colors[0] == 0xff111111, "got %08x (%s)\n", colors[0], name);
1712 ok(colors[1] == 0xff222222, "got %08x (%s)\n", colors[1], name);
1713 }
1714 }
1715 else
1716 {
1717 ok(count == 2, "expected 2, got %u (%s)\n", count, name);
1718
1719 ok(colors[0] == 0xff111111, "got %08x\n", colors[0]);
1720 ok(colors[1] == 0xff222222, "got %08x\n", colors[1]);
1721 }
1722 }
1723
1724 IWICBitmapFrameDecode_Release(framedecode);
1725 }
1726
1727 i++;
1728 }
1729
1730 IWICPalette_Release(frame_palette);
1731 IWICBitmapDecoder_Release(decoder);
1732 }
1733
1734 IStream_Release(stream);
1735 }
1736
1737 IWICBitmapEncoder_Release(encoder);
1738 }
1739}
#define trace
Definition: atltest.h:70
static void set_size(float size)
Definition: wordpad.c:316
DWORD bpp
Definition: surface.c:185
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
pixelformat
Definition: converter.c:37
GLdouble s
Definition: gl.h:2039
GLdouble n
Definition: glext.h:7729
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define wine_dbgstr_w
Definition: kernel32.h:34
if(dx< 0)
Definition: linetemp.h:194
const GUID * guid
const char * var
Definition: shader.c:5666
static LPOLESTR
Definition: stg_prop.c:27
static void test_set_frame_palette(IWICBitmapFrameEncode *frameencode)
Definition: converter.c:1340
static void test_encoder_properties(const CLSID *clsid_encoder, IPropertyBag2 *options)
Definition: converter.c:905
static void check_bitmap_format(IStream *stream, const CLSID *encoder, const WICPixelFormatGUID *format)
Definition: converter.c:1300
HRESULT STDMETHODCALLTYPE IWICBitmapFrameEncode_WriteSource_Proxy(IWICBitmapFrameEncode *This, IWICBitmapSource *pIBitmapSource, WICRect *prc)
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_VT(A)
Definition: oleauto.h:211
int ret
#define GMEM_MOVEABLE
Definition: winbase.h:320
@ WICBitmapEncoderNoCache
Definition: wincodec.idl:73
@ WICDecodeMetadataCacheOnDemand
Definition: wincodec.idl:29
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
Definition: winerror.h:3308
#define WINCODEC_ERR_NOTINITIALIZED
Definition: winerror.h:3285
#define WINCODEC_ERR_UNEXPECTEDSIZE
Definition: winerror.h:3314
#define WINCODEC_ERR_PALETTEUNAVAILABLE
Definition: winerror.h:3292
#define WINCODEC_ERR_SOURCERECTDOESNOTMATCHDIMENSIONS
Definition: winerror.h:3295
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_ARITHMETIC_OVERFLOW
Definition: winerror.h:351
#define WINCODEC_ERR_FRAMEMISSING
Definition: winerror.h:3301

Referenced by test_multi_encoder().

◆ test_set_frame_palette()

static void test_set_frame_palette ( IWICBitmapFrameEncode frameencode)
static

Definition at line 1340 of file converter.c.

1341{
1344 HRESULT hr;
1345
1346 hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
1347 &IID_IWICComponentFactory, (void **)&factory);
1348 ok(hr == S_OK, "CoCreateInstance failed, hr=%lx\n", hr);
1349
1350 hr = IWICBitmapFrameEncode_SetPalette(frameencode, NULL);
1351 ok(hr == E_INVALIDARG, "SetPalette failed, hr=%lx\n", hr);
1352
1353 hr = IWICComponentFactory_CreatePalette(factory, &palette);
1354 ok(hr == S_OK, "CreatePalette failed, hr=%lx\n", hr);
1355
1356 hr = IWICBitmapFrameEncode_SetPalette(frameencode, palette);
1357 todo_wine
1358 ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr=%lx\n", hr);
1359
1360 hr = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedHalftone256, FALSE);
1361 ok(hr == S_OK, "InitializePredefined failed, hr=%lx\n", hr);
1362
1363 EXPECT_REF(palette, 1);
1364 hr = IWICBitmapFrameEncode_SetPalette(frameencode, palette);
1365 ok(hr == S_OK, "SetPalette failed, hr=%lx\n", hr);
1366 EXPECT_REF(palette, 1);
1367
1368 hr = IWICBitmapFrameEncode_SetPalette(frameencode, NULL);
1369 ok(hr == E_INVALIDARG, "SetPalette failed, hr=%lx\n", hr);
1370
1371 IWICPalette_Release(palette);
1372 IWICComponentFactory_Release(factory);
1373}
static IWICImagingFactory * factory
Definition: converter.c:33
#define EXPECT_REF(obj, ref)
Definition: converter.c:1331
@ WICBitmapPaletteTypeFixedHalftone256
Definition: wincodec.idl:102

Referenced by test_multi_encoder_impl().

◆ test_specific_encoder_properties()

static void test_specific_encoder_properties ( IPropertyBag2 options,
const property_opt_test_data data,
PROPBAG2 *  all_props,
int  all_prop_cnt 
)
static

Definition at line 836 of file converter.c.

837{
838 HRESULT hr;
839 int i = 0;
840 VARIANT pvarValue;
841 HRESULT phrError = S_OK;
842
843 while (data[i].name)
844 {
845 int idx = find_property_index(data[i].name, all_props, all_prop_cnt);
846 PROPBAG2 pb = {0};
847 pb.pstrName = (LPOLESTR)data[i].name;
848
849 hr = IPropertyBag2_Read(options, 1, &pb, NULL, &pvarValue, &phrError);
850
851 if (data[i].skippable && idx == -1)
852 {
853 win_skip("Property %s is not supported on this machine.\n", wine_dbgstr_w(data[i].name));
854 i++;
855 continue;
856 }
857
858 ok(idx >= 0, "Property %s not in output of GetPropertyInfo\n",
860 if (idx >= 0)
861 {
862 ok(all_props[idx].vt == data[i].var_type, "Property %s has unexpected vt type, vt=%i\n",
863 wine_dbgstr_w(data[i].name), all_props[idx].vt);
864 ok(all_props[idx].dwType == PROPBAG2_TYPE_DATA, "Property %s has unexpected dw type, vt=%li\n",
865 wine_dbgstr_w(data[i].name), all_props[idx].dwType);
866 ok(all_props[idx].cfType == 0, "Property %s has unexpected cf type, vt=%i\n",
867 wine_dbgstr_w(data[i].name), all_props[idx].cfType);
868 }
869
870 ok(SUCCEEDED(hr), "Reading property %s from bag failed, hr=%lx\n",
872
873 if (SUCCEEDED(hr))
874 {
875 /* On XP the initial type is always VT_EMPTY */
876 ok(V_VT(&pvarValue) == data[i].initial_var_type || V_VT(&pvarValue) == VT_EMPTY,
877 "Property %s has unexpected initial type, V_VT=%i\n",
878 wine_dbgstr_w(data[i].name), V_VT(&pvarValue));
879
880 if(V_VT(&pvarValue) == data[i].initial_var_type)
881 {
882 switch (data[i].initial_var_type)
883 {
884 case VT_BOOL:
885 case VT_UI1:
886 ok(V_UNION(&pvarValue, bVal) == data[i].i_init_val, "Property %s has an unexpected initial value, pvarValue=%i\n",
887 wine_dbgstr_w(data[i].name), V_UNION(&pvarValue, bVal));
888 break;
889 case VT_R4:
890 ok(V_UNION(&pvarValue, fltVal) == data[i].f_init_val, "Property %s has an unexpected initial value, pvarValue=%f\n",
891 wine_dbgstr_w(data[i].name), V_UNION(&pvarValue, fltVal));
892 break;
893 default:
894 break;
895 }
896 }
897
898 VariantClear(&pvarValue);
899 }
900
901 i++;
902 }
903}
unsigned int idx
Definition: utils.c:41
@ VT_R4
Definition: compat.h:2299
@ VT_BOOL
Definition: compat.h:2306
@ VT_EMPTY
Definition: compat.h:2295
@ VT_UI1
Definition: compat.h:2311
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:91
static int find_property_index(const WCHAR *name, PROPBAG2 *all_props, int all_prop_cnt)
Definition: converter.c:825
#define V_UNION(A, B)
Definition: oleauto.h:212
#define win_skip
Definition: test.h:164
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648

Referenced by test_encoder_properties().

Variable Documentation

◆ BitmapTestSrc_Vtbl

const IWICBitmapSourceVtbl BitmapTestSrc_Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI BitmapTestSrc_GetResolution(IWICBitmapSource *iface, double *pDpiX, double *pDpiY)
Definition: converter.c:111
static HRESULT WINAPI BitmapTestSrc_CopyPixels(IWICBitmapSource *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
Definition: converter.c:147
static HRESULT WINAPI BitmapTestSrc_GetPixelFormat(IWICBitmapSource *iface, WICPixelFormatGUID *pPixelFormat)
Definition: converter.c:103
static HRESULT WINAPI BitmapTestSrc_CopyPalette(IWICBitmapSource *iface, IWICPalette *palette)
Definition: converter.c:120
static ULONG WINAPI BitmapTestSrc_AddRef(IWICBitmapSource *iface)
Definition: converter.c:80
static HRESULT WINAPI BitmapTestSrc_GetSize(IWICBitmapSource *iface, UINT *puiWidth, UINT *puiHeight)
Definition: converter.c:94
static HRESULT WINAPI BitmapTestSrc_QueryInterface(IWICBitmapSource *iface, REFIID iid, void **ppv)
Definition: converter.c:65
static ULONG WINAPI BitmapTestSrc_Release(IWICBitmapSource *iface)
Definition: converter.c:87

Definition at line 204 of file converter.c.

Referenced by CreateTestBitmap(), and DeleteTestBitmap().

◆ bits_16bppBGRA5551

const WORD bits_16bppBGRA5551[]
static
Initial value:
= {
TO_16bppBGRA5551(255,0,0,255), TO_16bppBGRA5551(0,255,0,255), TO_16bppBGRA5551(0,0,255,255), TO_16bppBGRA5551(0,0,0,255), TO_16bppBGRA5551(255,0,0,255), TO_16bppBGRA5551(0,255,0,255), TO_16bppBGRA5551(0,0,255,255), TO_16bppBGRA5551(0,0,0,255),
TO_16bppBGRA5551(255,0,0,255), TO_16bppBGRA5551(0,255,0,255), TO_16bppBGRA5551(0,0,255,255), TO_16bppBGRA5551(0,0,0,255), TO_16bppBGRA5551(255,0,0,255), TO_16bppBGRA5551(0,255,0,255), TO_16bppBGRA5551(0,0,255,255), TO_16bppBGRA5551(0,0,0,255),
TO_16bppBGRA5551(255,0,0,255), TO_16bppBGRA5551(0,255,0,255), TO_16bppBGRA5551(0,0,255,255), TO_16bppBGRA5551(0,0,0,255), TO_16bppBGRA5551(255,0,0,255), TO_16bppBGRA5551(0,255,0,255), TO_16bppBGRA5551(0,0,255,255), TO_16bppBGRA5551(0,0,0,255),
TO_16bppBGRA5551(255,0,0,255), TO_16bppBGRA5551(0,255,0,255), TO_16bppBGRA5551(0,0,255,255), TO_16bppBGRA5551(0,0,0,255), TO_16bppBGRA5551(255,0,0,255), TO_16bppBGRA5551(0,255,0,255), TO_16bppBGRA5551(0,0,255,255), TO_16bppBGRA5551(0,0,0,255),
TO_16bppBGRA5551(0,255,255,255), TO_16bppBGRA5551(255,0,255,255), TO_16bppBGRA5551(255,255,0,255), TO_16bppBGRA5551(255,255,255,255), TO_16bppBGRA5551(0,255,255,255), TO_16bppBGRA5551(255,0,255,255), TO_16bppBGRA5551(255,255,0,255), TO_16bppBGRA5551(255,255,255,255),
TO_16bppBGRA5551(0,255,255,255), TO_16bppBGRA5551(255,0,255,255), TO_16bppBGRA5551(255,255,0,255), TO_16bppBGRA5551(255,255,255,255), TO_16bppBGRA5551(0,255,255,255), TO_16bppBGRA5551(255,0,255,255), TO_16bppBGRA5551(255,255,0,255), TO_16bppBGRA5551(255,255,255,255),
TO_16bppBGRA5551(0,255,255,255), TO_16bppBGRA5551(255,0,255,255), TO_16bppBGRA5551(255,255,0,255), TO_16bppBGRA5551(255,255,255,255), TO_16bppBGRA5551(0,255,255,255), TO_16bppBGRA5551(255,0,255,255), TO_16bppBGRA5551(255,255,0,255), TO_16bppBGRA5551(255,255,255,255),
TO_16bppBGRA5551(0,255,255,255), TO_16bppBGRA5551(255,0,255,255), TO_16bppBGRA5551(255,255,0,255), TO_16bppBGRA5551(255,255,255,255), TO_16bppBGRA5551(0,255,255,255), TO_16bppBGRA5551(255,0,255,255), TO_16bppBGRA5551(255,255,0,255), TO_16bppBGRA5551(255,255,255,255)}
#define TO_16bppBGRA5551(b, g, r, a)
Definition: converter.c:605

Definition at line 612 of file converter.c.

◆ bits_1bpp

const BYTE bits_1bpp[]
static
Initial value:
= {
0x55,0x55,0x55,0x55,
0xaa,0xaa,0xaa,0xaa}

Definition at line 383 of file converter.c.

◆ bits_24bppBGR

const BYTE bits_24bppBGR[]
static
Initial value:
= {
255,0,0, 0,255,0, 0,0,255, 0,0,0, 255,0,0, 0,255,0, 0,0,255, 0,0,0,
255,0,0, 0,255,0, 0,0,255, 0,0,0, 255,0,0, 0,255,0, 0,0,255, 0,0,0,
255,0,0, 0,255,0, 0,0,255, 0,0,0, 255,0,0, 0,255,0, 0,0,255, 0,0,0,
255,0,0, 0,255,0, 0,0,255, 0,0,0, 255,0,0, 0,255,0, 0,0,255, 0,0,0,
0,255,255, 255,0,255, 255,255,0, 255,255,255, 0,255,255, 255,0,255, 255,255,0, 255,255,255,
0,255,255, 255,0,255, 255,255,0, 255,255,255, 0,255,255, 255,0,255, 255,255,0, 255,255,255,
0,255,255, 255,0,255, 255,255,0, 255,255,255, 0,255,255, 255,0,255, 255,255,0, 255,255,255,
0,255,255, 255,0,255, 255,255,0, 255,255,255, 0,255,255, 255,0,255, 255,255,0, 255,255,255}

Definition at line 424 of file converter.c.

◆ bits_24bppBGR_gray

const BYTE bits_24bppBGR_gray[]
static
Initial value:
= {
76,76,76, 220,220,220, 127,127,127, 0,0,0, 76,76,76, 220,220,220, 127,127,127, 0,0,0,
76,76,76, 220,220,220, 127,127,127, 0,0,0, 76,76,76, 220,220,220, 127,127,127, 0,0,0,
76,76,76, 220,220,220, 127,127,127, 0,0,0, 76,76,76, 220,220,220, 127,127,127, 0,0,0,
76,76,76, 220,220,220, 127,127,127, 0,0,0, 76,76,76, 220,220,220, 127,127,127, 0,0,0,
247,247,247, 145,145,145, 230,230,230, 255,255,255, 247,247,247, 145,145,145, 230,230,230, 255,255,255,
247,247,247, 145,145,145, 230,230,230, 255,255,255, 247,247,247, 145,145,145, 230,230,230, 255,255,255,
247,247,247, 145,145,145, 230,230,230, 255,255,255, 247,247,247, 145,145,145, 230,230,230, 255,255,255,
247,247,247, 145,145,145, 230,230,230, 255,255,255, 247,247,247, 145,145,145, 230,230,230, 255,255,255}

Definition at line 593 of file converter.c.

◆ bits_24bppRGB

const BYTE bits_24bppRGB[]
static
Initial value:
= {
0,0,255, 0,255,0, 255,0,0, 0,0,0, 0,0,255, 0,255,0, 255,0,0, 0,0,0,
0,0,255, 0,255,0, 255,0,0, 0,0,0, 0,0,255, 0,255,0, 255,0,0, 0,0,0,
0,0,255, 0,255,0, 255,0,0, 0,0,0, 0,0,255, 0,255,0, 255,0,0, 0,0,0,
0,0,255, 0,255,0, 255,0,0, 0,0,0, 0,0,255, 0,255,0, 255,0,0, 0,0,0,
255,255,0, 255,0,255, 0,255,255, 255,255,255, 255,255,0, 255,0,255, 0,255,255, 255,255,255,
255,255,0, 255,0,255, 0,255,255, 255,255,255, 255,255,0, 255,0,255, 0,255,255, 255,255,255,
255,255,0, 255,0,255, 0,255,255, 255,255,255, 255,255,0, 255,0,255, 0,255,255, 255,255,255,
255,255,0, 255,0,255, 0,255,255, 255,255,255, 255,255,0, 255,0,255, 0,255,255, 255,255,255 }

Definition at line 436 of file converter.c.

◆ bits_2bpp

const BYTE bits_2bpp[]
static
Initial value:
= {
0xdb,0xdb,0xdb,0xdb,0xdb,0xdb,0xdb,0xdb,
0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24}

Definition at line 392 of file converter.c.

◆ bits_32bppBGR

const BYTE bits_32bppBGR[]
static
Initial value:
= {
255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80, 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80,
255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80, 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80,
255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80, 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80,
255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80, 255,0,0,80, 0,255,0,80, 0,0,255,80, 0,0,0,80,
0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80, 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80,
0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80, 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80,
0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80, 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80,
0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80, 0,255,255,80, 255,0,255,80, 255,255,0,80, 255,255,255,80,
3,3,3,80, 6,6,6,80, 12,12,12,80, 15,15,15,80, 19,19,19,80, 22,22,22,80, 28,28,28,80, 31,31,31,80,
35,35,35,80, 38,38,38,80, 41,41,41,80, 47,47,47,80, 47,47,47,80, 54,54,54,80, 57,57,57,80, 63,63,63,80,
66,66,66,80, 70,70,70,80, 73,73,73,80, 79,79,79,80, 82,82,82,80, 86,86,86,80, 89,89,89,80, 95,95,95,80,
98,98,98,80, 98,98,98,80, 105,105,105,80, 108,108,108,80, 114,114,114,80, 117,117,117,80, 121,121,121,80, 124,124,124,80,
130,130,130,80, 133,133,133,80, 137,137,137,80, 140,140,140,80, 146,146,146,80, 149,149,149,80, 156,156,156,80, 156,156,156,80,
159,159,159,80, 165,165,165,80, 168,168,168,80, 172,172,172,80, 175,175,175,80, 181,181,181,80, 184,184,184,80, 188,188,188,80,
191,191,191,80, 197,197,197,80, 200,200,200,80, 207,207,207,80, 207,207,207,80, 213,213,213,80, 216,216,216,80, 219,219,219,80,
223,223,223,80, 226,226,226,80, 232,232,232,80, 235,235,235,80, 239,239,239,80, 242,242,242,80, 248,248,248,80, 251,251,251,80}

Definition at line 448 of file converter.c.

◆ bits_32bppBGRA

const BYTE bits_32bppBGRA[]
static
Initial value:
= {
255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255, 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255,
255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255, 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255,
255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255, 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255,
255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255, 255,0,0,255, 0,255,0,255, 0,0,255,255, 0,0,0,255,
0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255,
0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255,
0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255,
0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255, 0,255,255,255, 255,0,255,255, 255,255,0,255, 255,255,255,255,
3,3,3,255, 6,6,6,255, 12,12,12,255, 15,15,15,255, 19,19,19,255, 22,22,22,255, 28,28,28,255, 31,31,31,80,
35,35,35,255, 38,38,38,255, 41,41,41,255, 47,47,47,255, 47,47,47,255, 54,54,54,255, 57,57,57,255, 63,63,63,80,
66,66,66,255, 70,70,70,255, 73,73,73,255, 79,79,79,255, 82,82,82,255, 86,86,86,255, 89,89,89,255, 95,95,95,80,
98,98,98,255, 98,98,98,255, 105,105,105,255, 108,108,108,255, 114,114,114,255, 117,117,117,255, 121,121,121,255, 124,124,124,80,
130,130,130,255, 133,133,133,255, 137,137,137,255, 140,140,140,255, 146,146,146,255, 149,149,149,255, 156,156,156,255, 156,156,156,80,
159,159,159,255, 165,165,165,255, 168,168,168,255, 172,172,172,255, 175,175,175,255, 181,181,181,255, 184,184,184,255, 188,188,188,80,
191,191,191,255, 197,197,197,255, 200,200,200,255, 207,207,207,255, 207,207,207,255, 213,213,213,255, 216,216,216,255, 219,219,219,80,
223,223,223,255, 226,226,226,255, 232,232,232,255, 235,235,235,255, 239,239,239,255, 242,242,242,255, 248,248,248,255, 251,251,251,80}

Definition at line 472 of file converter.c.

◆ bits_32bppGrayFloat

const float bits_32bppGrayFloat[]
static
Initial value:
= {
0.072200f,0.715200f,0.212600f,0.000000f,0.072200f,0.715200f,0.212600f,0.000000f,
0.072200f,0.715200f,0.212600f,0.000000f,0.072200f,0.715200f,0.212600f,0.000000f,
0.072200f,0.715200f,0.212600f,0.000000f,0.072200f,0.715200f,0.212600f,0.000000f,
0.072200f,0.715200f,0.212600f,0.000000f,0.072200f,0.715200f,0.212600f,0.000000f,
0.927800f,0.284800f,0.787400f,1.000000f,0.927800f,0.284800f,0.787400f,1.000000f,
0.927800f,0.284800f,0.787400f,1.000000f,0.927800f,0.284800f,0.787400f,1.000000f,
0.927800f,0.284800f,0.787400f,1.000000f,0.927800f,0.284800f,0.787400f,1.000000f,
0.927800f,0.284800f,0.787400f,1.000000f,0.927800f,0.284800f,0.787400f,1.000000f}

Definition at line 553 of file converter.c.

Referenced by test_color_formats().

◆ bits_32bppGrayFloat_xp

const float bits_32bppGrayFloat_xp[]
static
Initial value:
= {
0.114000f,0.587000f,0.299000f,0.000000f,0.114000f,0.587000f,0.299000f,0.000000f,
0.114000f,0.587000f,0.299000f,0.000000f,0.114000f,0.587000f,0.299000f,0.000000f,
0.114000f,0.587000f,0.299000f,0.000000f,0.114000f,0.587000f,0.299000f,0.000000f,
0.114000f,0.587000f,0.299000f,0.000000f,0.114000f,0.587000f,0.299000f,0.000000f,
0.886000f,0.413000f,0.701000f,1.000000f,0.886000f,0.413000f,0.701000f,1.000000f,
0.886000f,0.413000f,0.701000f,1.000000f,0.886000f,0.413000f,0.701000f,1.000000f,
0.886000f,0.413000f,0.701000f,1.000000f,0.886000f,0.413000f,0.701000f,1.000000f,
0.886000f,0.413000f,0.701000f,1.000000f,0.886000f,0.413000f,0.701000f,1.000000f}

Definition at line 541 of file converter.c.

◆ bits_32bppPBGRA

const BYTE bits_32bppPBGRA[]
static
Initial value:
= {
80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80, 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80,
80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80, 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80,
80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80, 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80,
80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80, 80,0,0,80, 0,80,0,80, 0,0,80,80, 0,0,0,80,
0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80, 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80,
0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80, 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80,
0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80, 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80,
0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80, 0,80,80,80, 80,0,80,80, 80,80,0,80, 80,80,80,80,
1,1,1,80, 2,2,2,80, 4,4,4,80, 5,5,5,80, 6,6,6,80, 7,7,7,80, 9,9,9,80, 10,10,10,80,
11,11,11,80, 12,12,12,80, 13,13,13,80, 15,15,15,80, 15,15,15,80, 17,17,17,80, 18,18,18,80, 20,20,20,80,
21,21,21,80, 22,22,22,80, 23,23,23,80, 25,25,25,80, 26,26,26,80, 27,27,27,80, 28,28,28,80, 30,30,30,80,
31,31,31,80, 31,31,31,80, 33,33,33,80, 34,34,34,80, 36,36,36,80, 37,37,37,80, 38,38,38,80, 39,39,39,80,
41,41,41,80, 42,42,42,80, 43,43,43,80, 44,44,44,80, 46,46,46,80, 47,47,47,80, 49,49,49,80, 49,49,49,80,
50,50,50,80, 52,52,52,80, 53,53,53,80, 54,54,54,80, 55,55,55,80, 57,57,57,80, 58,58,58,80, 59,59,59,80,
60,60,60,80, 62,62,62,80, 63,63,63,80, 65,65,65,80, 65,65,65,80, 67,67,67,80, 68,68,68,80, 69,69,69,80,
70,70,70,80, 71,71,71,80, 73,73,73,80, 74,74,74,80, 75,75,75,80, 76,76,76,80, 78,78,78,80, 79,79,79,80}

Definition at line 506 of file converter.c.

◆ bits_32bppRGBA

const BYTE bits_32bppRGBA[]
static
Initial value:
= {
0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255, 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255,
0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255, 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255,
0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255, 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255,
0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255, 0,0,255,255, 0,255,0,255, 255,0,0,255, 0,0,0,255,
255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255, 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255,
255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255, 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255,
255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255, 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255,
255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255, 255,255,0,255, 255,0,255,255, 0,255,255,255, 255,255,255,255}

Definition at line 489 of file converter.c.

◆ bits_48bppRGB

const WORD bits_48bppRGB[]
static
Initial value:
= {
0,0,0, 0,65535,0, 32767,32768,32767,
65535,65535,65535, 10,10,10, 0,0,10}

Definition at line 625 of file converter.c.

Referenced by test_color_formats().

◆ bits_4bpp

const BYTE bits_4bpp[]
static
Initial value:
= {
0x34,0x43,0x34,0x43,0x34,0x43,0x34,0x43,0x34,0x43,0x34,0x43,0x34,0x43,0x34,0x43,
0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44}

Definition at line 399 of file converter.c.

◆ bits_4bppGray

const BYTE bits_4bppGray[]
static
Initial value:
= {
77,112,77,112,77,112,77,112,77,112,77,112,77,112,77,112,249,
239,249,239,249,239,249,239,249,239,249,239,249,239,249,239}

Definition at line 571 of file converter.c.

Referenced by test_color_formats().

◆ bits_4bppGray_xp

const BYTE bits_4bppGray_xp[]
static
Initial value:
= {
77,112,77,112,77,112,77,112,77,112,77,112,77,112,77,112,249,
239,249,239,249,239,249,239,249,239,249,239,249,239,249,239}

Definition at line 565 of file converter.c.

Referenced by test_color_formats().

◆ bits_64bppRGBA

const BYTE bits_64bppRGBA[]
static
Initial value:
= {
128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255, 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255,
128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255, 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255,
128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255, 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255,
128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255, 128,0,128,0,128,255,128,255, 128,0,128,255,128,0,128,255, 128,255,128,0,128,0,128,255, 128,0,128,0,128,0,128,255,
128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255, 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255,
128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255, 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255,
128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255, 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255,
128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255, 128,255,128,255,128,0,128,255, 128,255,128,0,128,255,128,255, 128,0,128,255,128,255,128,255, 128,255,128,255,128,255,128,255}

Definition at line 528 of file converter.c.

Referenced by test_color_formats().

◆ bits_64bppRGBA_2

const WORD bits_64bppRGBA_2[]
static
Initial value:
= {
0,0,0,65535, 0,65535,0,65535, 32767,32768,32767,65535,
65535,65535,65535,65535, 10,10,10,65535, 0,0,10,65535,}

Definition at line 632 of file converter.c.

◆ bits_8bpp

const BYTE bits_8bpp[]
static
Initial value:
= {
0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}

Definition at line 418 of file converter.c.

◆ bits_8bpp_4colors

const BYTE bits_8bpp_4colors[]
static
Initial value:
= {
0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,0,
3,2,1,3,3,2,1,3,3,2,1,3,3,2,1,3,3,2,1,3,3,2,1,3,3,2,1,3,3,2,1,3}

Definition at line 412 of file converter.c.

◆ bits_8bpp_BW

const BYTE bits_8bpp_BW[]
static
Initial value:
= {
0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,
1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0}

Definition at line 406 of file converter.c.

◆ bits_8bppGray

const BYTE bits_8bppGray[]
static
Initial value:
= {
76,220,127,0,76,220,127,0,76,220,127,0,76,220,127,0,
76,220,127,0,76,220,127,0,76,220,127,0,76,220,127,0,
247,145,230,255,247,145,230,255,247,145,230,255,247,145,230,255,
247,145,230,255,247,145,230,255,247,145,230,255,247,145,230,255}

Definition at line 585 of file converter.c.

Referenced by test_color_formats().

◆ bits_8bppGray_xp

const BYTE bits_8bppGray_xp[]
static
Initial value:
= {
29,150,76,0,29,150,76,0,29,150,76,0,29,150,76,0,
29,150,76,0,29,150,76,0,29,150,76,0,29,150,76,0,
226,105,179,255,226,105,179,255,226,105,179,255,226,105,179,255,
226,105,179,255,226,105,179,255,226,105,179,255,226,105,179,255}

Definition at line 577 of file converter.c.

◆ factory

Definition at line 33 of file converter.c.

Referenced by test_set_frame_palette().

◆ multiple_frames

const struct bitmap_data* multiple_frames[3]
static
Initial value:

Definition at line 1813 of file converter.c.

Referenced by START_TEST().

◆ png_interlace_settings

const struct setting png_interlace_settings[]
static
Initial value:
= {
{wszInterlaceOption, PROPBAG2_TYPE_DATA, VT_BOOL, (void*)VARIANT_TRUE},
{NULL}
}
static const WCHAR wszInterlaceOption[]
Definition: converter.c:788

Definition at line 1822 of file converter.c.

Referenced by START_TEST().

◆ single_frame

const struct bitmap_data* single_frame[2]
static
Initial value:

Definition at line 1818 of file converter.c.

Referenced by START_TEST().

◆ testdata_16bppBGRA5551

const struct bitmap_data testdata_16bppBGRA5551
static
Initial value:
= {
&GUID_WICPixelFormat16bppBGRA5551, 16, (BYTE*)bits_16bppBGRA5551, 32, 2, 96.0, 96.0}
static const WORD bits_16bppBGRA5551[]
Definition: converter.c:612

Definition at line 622 of file converter.c.

Referenced by START_TEST().

◆ testdata_1bppIndexed

const struct bitmap_data testdata_1bppIndexed
static
Initial value:
= {
&GUID_WICPixelFormat1bppIndexed, 1, bits_1bpp, 32, 2, 96.0, 96.0}
static const BYTE bits_1bpp[]
Definition: converter.c:383

Definition at line 388 of file converter.c.

Referenced by START_TEST().

◆ testdata_24bppBGR

const struct bitmap_data testdata_24bppBGR
static
Initial value:
= {
&GUID_WICPixelFormat24bppBGR, 24, bits_24bppBGR, 32, 2, 96.0, 96.0}
static const BYTE bits_24bppBGR[]
Definition: converter.c:424

Definition at line 433 of file converter.c.

Referenced by START_TEST(), test_converter_8bppIndexed(), and test_encoder_rects().

◆ testdata_24bppBGR_gray

const struct bitmap_data testdata_24bppBGR_gray
static
Initial value:
= {
&GUID_WICPixelFormat24bppBGR, 24, bits_24bppBGR_gray, 32, 2, 96.0, 96.0}
static const BYTE bits_24bppBGR_gray[]
Definition: converter.c:593

Definition at line 602 of file converter.c.

Referenced by START_TEST().

◆ testdata_24bppRGB

const struct bitmap_data testdata_24bppRGB
static
Initial value:
= {
&GUID_WICPixelFormat24bppRGB, 24, bits_24bppRGB, 32, 2, 96.0, 96.0}
static const BYTE bits_24bppRGB[]
Definition: converter.c:436

Definition at line 445 of file converter.c.

Referenced by START_TEST().

◆ testdata_2bppIndexed

const struct bitmap_data testdata_2bppIndexed
static
Initial value:
= {
&GUID_WICPixelFormat2bppIndexed, 2, bits_2bpp, 32, 2, 96.0, 96.0}
static const BYTE bits_2bpp[]
Definition: converter.c:392

Definition at line 395 of file converter.c.

Referenced by START_TEST().

◆ testdata_32bppBGR

const struct bitmap_data testdata_32bppBGR
static
Initial value:
= {
&GUID_WICPixelFormat32bppBGR, 32, bits_32bppBGR, 32, 2, 96.0, 96.0}
static const BYTE bits_32bppBGR[]
Definition: converter.c:448

Definition at line 465 of file converter.c.

Referenced by START_TEST(), and test_default_converter().

◆ testdata_32bppBGRA

const struct bitmap_data testdata_32bppBGRA
static
Initial value:
= {
&GUID_WICPixelFormat32bppBGRA, 32, bits_32bppBGRA, 32, 2, 96.0, 96.0}
static const BYTE bits_32bppBGRA[]
Definition: converter.c:472

Definition at line 499 of file converter.c.

Referenced by START_TEST(), test_converter_4bppGray(), test_converter_8bppGray(), test_default_converter(), and test_invalid_conversion().

◆ testdata_32bppBGRA80

const struct bitmap_data testdata_32bppBGRA80
static
Initial value:
= {
&GUID_WICPixelFormat32bppBGRA, 32, bits_32bppBGR, 32, 4, 96.0, 96.0}

Definition at line 467 of file converter.c.

Referenced by START_TEST().

◆ testdata_32bppGrayFloat

const struct bitmap_data testdata_32bppGrayFloat
static
Initial value:
= {
&GUID_WICPixelFormat32bppGrayFloat, 32, (const BYTE *)bits_32bppGrayFloat, 32, 2, 96.0, 96.0, &testdata_32bppGrayFloat_xp}
static const struct bitmap_data testdata_32bppGrayFloat_xp
Definition: converter.c:550
static const float bits_32bppGrayFloat[]
Definition: converter.c:553

Definition at line 562 of file converter.c.

Referenced by START_TEST().

◆ testdata_32bppGrayFloat_xp

const struct bitmap_data testdata_32bppGrayFloat_xp
static
Initial value:
= {
&GUID_WICPixelFormat32bppGrayFloat, 32, (const BYTE *)bits_32bppGrayFloat_xp, 32, 2, 96.0, 96.0}
static const float bits_32bppGrayFloat_xp[]
Definition: converter.c:541

Definition at line 550 of file converter.c.

◆ testdata_32bppPBGRA

const struct bitmap_data testdata_32bppPBGRA
static
Initial value:
= {
&GUID_WICPixelFormat32bppPBGRA, 32, bits_32bppPBGRA, 32, 4, 96.0, 96.0}
static const BYTE bits_32bppPBGRA[]
Definition: converter.c:506

Definition at line 523 of file converter.c.

Referenced by START_TEST().

◆ testdata_32bppPRGBA

const struct bitmap_data testdata_32bppPRGBA
static
Initial value:
= {
&GUID_WICPixelFormat32bppPRGBA, 32, bits_32bppPBGRA, 32, 4, 96.0, 96.0}

Definition at line 525 of file converter.c.

Referenced by START_TEST().

◆ testdata_32bppRGB

const struct bitmap_data testdata_32bppRGB
static
Initial value:
= {
&GUID_WICPixelFormat32bppRGB, 32, bits_32bppRGBA, 32, 2, 96.0, 96.0}
static const BYTE bits_32bppRGBA[]
Definition: converter.c:489

Definition at line 503 of file converter.c.

Referenced by START_TEST().

◆ testdata_32bppRGBA

const struct bitmap_data testdata_32bppRGBA
static
Initial value:
= {
&GUID_WICPixelFormat32bppRGBA, 32, bits_32bppRGBA, 32, 2, 96.0, 96.0}

Definition at line 501 of file converter.c.

Referenced by START_TEST().

◆ testdata_32bppRGBA80

const struct bitmap_data testdata_32bppRGBA80
static
Initial value:
= {
&GUID_WICPixelFormat32bppRGBA, 32, bits_32bppBGR, 32, 4, 96.0, 96.0}

Definition at line 469 of file converter.c.

Referenced by START_TEST().

◆ testdata_48bppRGB

const struct bitmap_data testdata_48bppRGB
static
Initial value:
= {
&GUID_WICPixelFormat48bppRGB, 48, (BYTE*)bits_48bppRGB, 3, 2, 96.0, 96.0}
static const WORD bits_48bppRGB[]
Definition: converter.c:625

Definition at line 629 of file converter.c.

Referenced by START_TEST().

◆ testdata_4bppGray

const struct bitmap_data testdata_4bppGray
static
Initial value:
= {
&GUID_WICPixelFormat4bppGray, 4, bits_4bppGray, 32, 2, 96.0, 96.0, &testdata_4bppGray_xp}
static const struct bitmap_data testdata_4bppGray_xp
Definition: converter.c:568
static const BYTE bits_4bppGray[]
Definition: converter.c:571

Definition at line 574 of file converter.c.

Referenced by test_converter_4bppGray().

◆ testdata_4bppGray_xp

const struct bitmap_data testdata_4bppGray_xp
static
Initial value:
= {
&GUID_WICPixelFormat4bppGray, 4, bits_4bppGray_xp, 32, 2, 96.0, 96.0}
static const BYTE bits_4bppGray_xp[]
Definition: converter.c:565

Definition at line 568 of file converter.c.

◆ testdata_4bppIndexed

const struct bitmap_data testdata_4bppIndexed
static
Initial value:
= {
&GUID_WICPixelFormat4bppIndexed, 4, bits_4bpp, 32, 2, 96.0, 96.0}
static const BYTE bits_4bpp[]
Definition: converter.c:399

Definition at line 403 of file converter.c.

Referenced by START_TEST().

◆ testdata_64bppRGBA

const struct bitmap_data testdata_64bppRGBA
static
Initial value:
= {
&GUID_WICPixelFormat64bppRGBA, 64, bits_64bppRGBA, 32, 2, 96.0, 96.0}
static const BYTE bits_64bppRGBA[]
Definition: converter.c:528

Definition at line 537 of file converter.c.

Referenced by START_TEST().

◆ testdata_64bppRGBA_2

const struct bitmap_data testdata_64bppRGBA_2
static
Initial value:
= {
&GUID_WICPixelFormat64bppRGBA, 64, (BYTE*)bits_64bppRGBA_2, 3, 2, 96.0, 96.0}
static const WORD bits_64bppRGBA_2[]
Definition: converter.c:632

Definition at line 636 of file converter.c.

Referenced by START_TEST().

◆ testdata_8bppGray

const struct bitmap_data testdata_8bppGray
static
Initial value:
= {
&GUID_WICPixelFormat8bppGray, 8, bits_8bppGray, 32, 2, 96.0, 96.0, &testdata_8bppGray_xp}
static const BYTE bits_8bppGray[]
Definition: converter.c:585
static const struct bitmap_data testdata_8bppGray_xp
Definition: converter.c:582

Definition at line 590 of file converter.c.

Referenced by START_TEST(), and test_converter_8bppGray().

◆ testdata_8bppGray_xp

const struct bitmap_data testdata_8bppGray_xp
static
Initial value:
= {
&GUID_WICPixelFormat8bppGray, 8, bits_8bppGray_xp, 32, 2, 96.0, 96.0}
static const BYTE bits_8bppGray_xp[]
Definition: converter.c:577

Definition at line 582 of file converter.c.

◆ testdata_8bppIndexed

const struct bitmap_data testdata_8bppIndexed
static
Initial value:
= {
&GUID_WICPixelFormat8bppIndexed, 8, bits_8bpp, 32, 2, 96.0, 96.0}
static const BYTE bits_8bpp[]
Definition: converter.c:418

Definition at line 421 of file converter.c.

Referenced by START_TEST().

◆ testdata_8bppIndexed_4colors

const struct bitmap_data testdata_8bppIndexed_4colors
static
Initial value:
= {
&GUID_WICPixelFormat8bppIndexed, 8, bits_8bpp_4colors, 32, 2, 96.0, 96.0}
static const BYTE bits_8bpp_4colors[]
Definition: converter.c:412

Definition at line 415 of file converter.c.

Referenced by START_TEST().

◆ testdata_8bppIndexed_BW

const struct bitmap_data testdata_8bppIndexed_BW
static
Initial value:
= {
&GUID_WICPixelFormat8bppIndexed, 8, bits_8bpp_BW, 32, 2, 96.0, 96.0}
static const BYTE bits_8bpp_BW[]
Definition: converter.c:406

Definition at line 409 of file converter.c.

Referenced by START_TEST().

◆ testdata_BlackWhite

const struct bitmap_data testdata_BlackWhite
static
Initial value:
= {
&GUID_WICPixelFormatBlackWhite, 1, bits_1bpp, 32, 2, 96.0, 96.0}

Definition at line 386 of file converter.c.

Referenced by START_TEST().

◆ testdata_bmp_props

const struct property_opt_test_data testdata_bmp_props[]
static
Initial value:
= {
{ wszEnableV5Header32bppBGRA, VT_BOOL, VT_BOOL, VARIANT_FALSE, 0.0f, TRUE },
{ NULL }
}
static const WCHAR wszEnableV5Header32bppBGRA[]
Definition: converter.c:796

Definition at line 820 of file converter.c.

Referenced by test_encoder_properties().

◆ testdata_jpeg_props

const struct property_opt_test_data testdata_jpeg_props[]
static
Initial value:
= {
{ NULL }
}
@ VT_ARRAY
Definition: compat.h:2341
@ VT_I4
Definition: compat.h:2298
static const WCHAR wszImageQuality[]
Definition: converter.c:790
static const WCHAR wszChrominance[]
Definition: converter.c:793
static const WCHAR wszBitmapTransform[]
Definition: converter.c:791
static const WCHAR wszSuppressApp0[]
Definition: converter.c:795
static const WCHAR wszLuminance[]
Definition: converter.c:792
static const WCHAR wszJpegYCrCbSubsampling[]
Definition: converter.c:794
@ WICBitmapTransformRotate0
Definition: wincodec.idl:110
@ WICJpegYCrCbSubsamplingDefault
Definition: wincodec.idl:151

Definition at line 810 of file converter.c.

Referenced by test_encoder_properties().

◆ testdata_png_props

const struct property_opt_test_data testdata_png_props[]
static
Initial value:
= {
{ NULL }
}
static const WCHAR wszFilterOption[]
Definition: converter.c:789
@ WICPngFilterUnspecified
Definition: wincodec.idl:181

Definition at line 804 of file converter.c.

Referenced by test_encoder_properties().

◆ testdata_tiff_props

const struct property_opt_test_data testdata_tiff_props[]
static
Initial value:
= {
{ NULL }
}
static const WCHAR wszCompressionQuality[]
Definition: converter.c:787
static const WCHAR wszTiffCompressionMethod[]
Definition: converter.c:786
@ WICTiffCompressionDontCare
Definition: wincodec.idl:169

Definition at line 798 of file converter.c.

Referenced by test_encoder_properties().

◆ wszBitmapTransform

const WCHAR wszBitmapTransform[] = {'B','i','t','m','a','p','T','r','a','n','s','f','o','r','m',0}
static

Definition at line 791 of file converter.c.

◆ wszChrominance

const WCHAR wszChrominance[] = {'C','h','r','o','m','i','n','a','n','c','e',0}
static

Definition at line 793 of file converter.c.

◆ wszCompressionQuality

const WCHAR wszCompressionQuality[] = {'C','o','m','p','r','e','s','s','i','o','n','Q','u','a','l','i','t','y',0}
static

Definition at line 787 of file converter.c.

◆ wszEnableV5Header32bppBGRA

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

Definition at line 796 of file converter.c.

◆ wszFilterOption

const WCHAR wszFilterOption[] = {'F','i','l','t','e','r','O','p','t','i','o','n',0}
static

Definition at line 789 of file converter.c.

◆ wszImageQuality

const WCHAR wszImageQuality[] = {'I','m','a','g','e','Q','u','a','l','i','t','y',0}
static

Definition at line 790 of file converter.c.

◆ wszInterlaceOption

const WCHAR wszInterlaceOption[] = {'I','n','t','e','r','l','a','c','e','O','p','t','i','o','n',0}
static

Definition at line 788 of file converter.c.

◆ wszJpegYCrCbSubsampling

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

Definition at line 794 of file converter.c.

◆ wszLuminance

const WCHAR wszLuminance[] = {'L','u','m','i','n','a','n','c','e',0}
static

Definition at line 792 of file converter.c.

◆ wszSuppressApp0

const WCHAR wszSuppressApp0[] = {'S','u','p','p','r','e','s','s','A','p','p','0',0}
static

Definition at line 795 of file converter.c.

◆ wszTiffCompressionMethod

const WCHAR wszTiffCompressionMethod[] = {'T','i','f','f','C','o','m','p','r','e','s','s','i','o','n','M','e','t','h','o','d',0}
static

Definition at line 786 of file converter.c.