mfplat: Remove duplicated GUID entry from attribute tracing.
[wine/zf.git] / dlls / windowscodecs / wincodecs_private.h
blob78a01a983c0f8d7f9e7674ae7c5edfc8b079790c
1 /*
2 * Copyright 2009 Vincent Povirk for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef WINCODECS_PRIVATE_H
20 #define WINCODECS_PRIVATE_H
22 #include "wincodec.h"
23 #include "wincodecsdk.h"
25 #include "wine/debug.h"
27 DEFINE_GUID(CLSID_WineTgaDecoder, 0xb11fc79a,0x67cc,0x43e6,0xa9,0xce,0xe3,0xd5,0x49,0x45,0xd3,0x04);
29 DEFINE_GUID(CLSID_WICIcnsEncoder, 0x312fb6f1,0xb767,0x409d,0x8a,0x6d,0x0f,0xc1,0x54,0xd4,0xf0,0x5c);
31 DEFINE_GUID(GUID_WineContainerFormatTga, 0x0c44fda1,0xa5c5,0x4298,0x96,0x85,0x47,0x3f,0xc1,0x7c,0xd3,0x22);
33 DEFINE_GUID(GUID_WineContainerFormatIcns, 0xe4cd3e69,0x4436,0x4363,0x98,0x1d,0xcc,0xf0,0x5a,0x87,0x4c,0x73);
35 DEFINE_GUID(GUID_VendorWine, 0xddf46da1,0x7dc1,0x404e,0x98,0xf2,0xef,0xa4,0x8d,0xfc,0x95,0x0a);
37 extern IID IID_IMILBitmap;
38 extern IID IID_IMILBitmapSource;
39 extern IID IID_IMILBitmapLock;
40 extern IID IID_IMILBitmapScaler;
41 extern IID IID_IMILFormatConverter;
42 extern IID IID_IMILPalette;
44 #define INTERFACE IMILBitmapSource
45 DECLARE_INTERFACE_(IMILBitmapSource,IUnknown)
47 /*** IUnknown methods ***/
48 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID,void **) PURE;
49 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
50 STDMETHOD_(ULONG,Release)(THIS) PURE;
51 /*** IWICBitmapSource methods ***/
52 STDMETHOD_(HRESULT,GetSize)(THIS_ UINT *,UINT *) PURE;
53 STDMETHOD_(HRESULT,GetPixelFormat)(THIS_ int *) PURE;
54 STDMETHOD_(HRESULT,GetResolution)(THIS_ double *,double *) PURE;
55 STDMETHOD_(HRESULT,CopyPalette)(THIS_ IWICPalette *) PURE;
56 STDMETHOD_(HRESULT,CopyPixels)(THIS_ const WICRect *,UINT,UINT,BYTE *) PURE;
58 #undef INTERFACE
60 #define INTERFACE IMILBitmap
61 DECLARE_INTERFACE_(IMILBitmap,IMILBitmapSource)
63 /*** IUnknown methods ***/
64 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID,void **) PURE;
65 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
66 STDMETHOD_(ULONG,Release)(THIS) PURE;
67 /*** IWICBitmapSource methods ***/
68 STDMETHOD_(HRESULT,GetSize)(THIS_ UINT *,UINT *) PURE;
69 STDMETHOD_(HRESULT,GetPixelFormat)(THIS_ int *) PURE;
70 STDMETHOD_(HRESULT,GetResolution)(THIS_ double *,double *) PURE;
71 STDMETHOD_(HRESULT,CopyPalette)(THIS_ IWICPalette *) PURE;
72 STDMETHOD_(HRESULT,CopyPixels)(THIS_ const WICRect *,UINT,UINT,BYTE *) PURE;
73 /*** IMILBitmap methods ***/
74 STDMETHOD_(HRESULT,unknown1)(THIS_ void **) PURE;
75 STDMETHOD_(HRESULT,Lock)(THIS_ const WICRect *,DWORD,IWICBitmapLock **) PURE;
76 STDMETHOD_(HRESULT,Unlock)(THIS_ IWICBitmapLock *) PURE;
77 STDMETHOD_(HRESULT,SetPalette)(THIS_ IWICPalette *) PURE;
78 STDMETHOD_(HRESULT,SetResolution)(THIS_ double,double) PURE;
79 STDMETHOD_(HRESULT,AddDirtyRect)(THIS_ const WICRect *) PURE;
81 #undef INTERFACE
83 #define INTERFACE IMILBitmapScaler
84 DECLARE_INTERFACE_(IMILBitmapScaler,IMILBitmapSource)
86 /*** IUnknown methods ***/
87 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID,void **) PURE;
88 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
89 STDMETHOD_(ULONG,Release)(THIS) PURE;
90 /*** IWICBitmapSource methods ***/
91 STDMETHOD_(HRESULT,GetSize)(THIS_ UINT *,UINT *) PURE;
92 STDMETHOD_(HRESULT,GetPixelFormat)(THIS_ int *) PURE;
93 STDMETHOD_(HRESULT,GetResolution)(THIS_ double *,double *) PURE;
94 STDMETHOD_(HRESULT,CopyPalette)(THIS_ IWICPalette *) PURE;
95 STDMETHOD_(HRESULT,CopyPixels)(THIS_ const WICRect *,UINT,UINT,BYTE *) PURE;
96 /*** IMILBitmapScaler methods ***/
97 STDMETHOD_(HRESULT,unknown1)(THIS_ void **) PURE;
98 STDMETHOD_(HRESULT,Initialize)(THIS_ IMILBitmapSource *,UINT,UINT,WICBitmapInterpolationMode) PURE;
100 #undef INTERFACE
102 #define THISCALLMETHOD_(type,method) type (__thiscall *method)
104 #define INTERFACE IMILUnknown1
105 DECLARE_INTERFACE_(IMILUnknown1,IUnknown)
107 /*** IUnknown methods ***/
108 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID,void **) PURE;
109 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
110 STDMETHOD_(ULONG,Release)(THIS) PURE;
111 THISCALLMETHOD_(void,unknown1)(THIS_ void*) PURE;
112 STDMETHOD_(HRESULT,unknown2)(THIS_ void*, void*) PURE;
113 THISCALLMETHOD_(HRESULT,unknown3)(THIS_ void*) PURE;
114 STDMETHOD_(HRESULT,unknown4)(THIS_ void*) PURE;
115 STDMETHOD_(HRESULT,unknown5)(THIS_ void*) PURE;
116 STDMETHOD_(HRESULT,unknown6)(THIS_ DWORD64) PURE;
117 STDMETHOD_(HRESULT,unknown7)(THIS_ void*) PURE;
118 THISCALLMETHOD_(HRESULT,unknown8)(THIS) PURE;
120 #undef INTERFACE
122 #define INTERFACE IMILUnknown2
123 DECLARE_INTERFACE_(IMILUnknown2,IUnknown)
125 /*** IUnknown methods ***/
126 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID,void **) PURE;
127 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
128 STDMETHOD_(ULONG,Release)(THIS) PURE;
129 /*** unknown methods ***/
130 STDMETHOD_(HRESULT,unknown1)(THIS_ void *,void **) PURE;
131 STDMETHOD_(HRESULT,unknown2)(THIS_ void *,void *) PURE;
132 STDMETHOD_(HRESULT,unknown3)(THIS_ void *) PURE;
134 #undef INTERFACE
136 HRESULT create_instance(const CLSID *clsid, const IID *iid, void **ppv) DECLSPEC_HIDDEN;
138 typedef HRESULT(*class_constructor)(REFIID,void**);
139 extern HRESULT FormatConverter_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN;
140 extern HRESULT ImagingFactory_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN;
141 extern HRESULT BmpDecoder_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN;
142 extern HRESULT PngDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
143 extern HRESULT PngEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
144 extern HRESULT BmpEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
145 extern HRESULT DibDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
146 extern HRESULT GifDecoder_CreateInstance(REFIID riid, void** ppv) DECLSPEC_HIDDEN;
147 extern HRESULT GifEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
148 extern HRESULT IcoDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
149 extern HRESULT JpegDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
150 extern HRESULT JpegEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
151 extern HRESULT TiffDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
152 extern HRESULT TiffEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
153 extern HRESULT IcnsEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
154 extern HRESULT TgaDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
155 extern HRESULT DdsDecoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
156 extern HRESULT DdsEncoder_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
158 extern HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight,
159 UINT stride, UINT datasize, void *view, UINT offset,
160 REFWICPixelFormatGUID pixelFormat, WICBitmapCreateCacheOption option,
161 IWICBitmap **ppIBitmap) DECLSPEC_HIDDEN;
162 extern HRESULT BitmapScaler_Create(IWICBitmapScaler **scaler) DECLSPEC_HIDDEN;
163 extern HRESULT FlipRotator_Create(IWICBitmapFlipRotator **fliprotator) DECLSPEC_HIDDEN;
164 extern HRESULT PaletteImpl_Create(IWICPalette **palette) DECLSPEC_HIDDEN;
165 extern HRESULT StreamImpl_Create(IWICStream **stream) DECLSPEC_HIDDEN;
166 extern HRESULT ColorContext_Create(IWICColorContext **context) DECLSPEC_HIDDEN;
167 extern HRESULT ColorTransform_Create(IWICColorTransform **transform) DECLSPEC_HIDDEN;
168 extern HRESULT BitmapClipper_Create(IWICBitmapClipper **clipper) DECLSPEC_HIDDEN;
170 extern HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer,
171 UINT srcwidth, UINT srcheight, INT srcstride,
172 const WICRect *rc, UINT dststride, UINT dstbuffersize, BYTE *dstbuffer) DECLSPEC_HIDDEN;
174 extern HRESULT configure_write_source(IWICBitmapFrameEncode *iface,
175 IWICBitmapSource *source, const WICRect *prc,
176 const WICPixelFormatGUID *format,
177 INT width, INT height, double xres, double yres) DECLSPEC_HIDDEN;
179 extern HRESULT write_source(IWICBitmapFrameEncode *iface,
180 IWICBitmapSource *source, const WICRect *prc,
181 const WICPixelFormatGUID *format, UINT bpp, BOOL need_palette,
182 INT width, INT height) DECLSPEC_HIDDEN;
184 extern void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride) DECLSPEC_HIDDEN;
186 extern HRESULT get_pixelformat_bpp(const GUID *pixelformat, UINT *bpp) DECLSPEC_HIDDEN;
188 extern HRESULT CreatePropertyBag2(const PROPBAG2 *options, UINT count,
189 IPropertyBag2 **property) DECLSPEC_HIDDEN;
191 extern HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo) DECLSPEC_HIDDEN;
192 extern void ReleaseComponentInfos(void) DECLSPEC_HIDDEN;
193 extern HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnknown **ppIEnumUnknown) DECLSPEC_HIDDEN;
194 extern HRESULT get_decoder_info(REFCLSID clsid, IWICBitmapDecoderInfo **info) DECLSPEC_HIDDEN;
196 typedef struct BmpDecoder BmpDecoder;
198 extern HRESULT IcoDibDecoder_CreateInstance(BmpDecoder **ppDecoder) DECLSPEC_HIDDEN;
199 extern void BmpDecoder_GetWICDecoder(BmpDecoder *This, IWICBitmapDecoder **ppDecoder) DECLSPEC_HIDDEN;
200 extern void BmpDecoder_FindIconMask(BmpDecoder *This, ULONG *mask_offset, int *topdown) DECLSPEC_HIDDEN;
202 typedef struct _MetadataItem
204 PROPVARIANT schema;
205 PROPVARIANT id;
206 PROPVARIANT value;
207 } MetadataItem;
209 typedef struct _MetadataHandlerVtbl
211 int is_writer;
212 const CLSID *clsid;
213 HRESULT (*fnLoad)(IStream *stream, const GUID *preferred_vendor,
214 DWORD persist_options, MetadataItem **items, DWORD *item_count);
215 HRESULT (*fnSave)(IStream *stream, DWORD persist_options,
216 const MetadataItem *items, DWORD item_count);
217 HRESULT (*fnGetSizeMax)(const MetadataItem *items, DWORD item_count,
218 ULARGE_INTEGER *size);
219 } MetadataHandlerVtbl;
221 extern HRESULT MetadataReader_Create(const MetadataHandlerVtbl *vtable, REFIID iid, void** ppv) DECLSPEC_HIDDEN;
223 extern HRESULT UnknownMetadataReader_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
224 extern HRESULT IfdMetadataReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN;
225 extern HRESULT PngChrmReader_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
226 extern HRESULT PngGamaReader_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
227 extern HRESULT PngTextReader_CreateInstance(REFIID iid, void** ppv) DECLSPEC_HIDDEN;
228 extern HRESULT LSDReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN;
229 extern HRESULT IMDReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN;
230 extern HRESULT GCEReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN;
231 extern HRESULT APEReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN;
232 extern HRESULT GifCommentReader_CreateInstance(REFIID iid, void **ppv) DECLSPEC_HIDDEN;
233 extern HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *, const WCHAR *, IWICMetadataQueryReader **) DECLSPEC_HIDDEN;
234 extern HRESULT MetadataQueryWriter_CreateInstance(IWICMetadataBlockWriter *, const WCHAR *, IWICMetadataQueryWriter **) DECLSPEC_HIDDEN;
235 extern HRESULT stream_initialize_from_filehandle(IWICStream *iface, HANDLE hfile) DECLSPEC_HIDDEN;
237 static inline WCHAR *heap_strdupW(const WCHAR *src)
239 WCHAR *dst;
240 SIZE_T len;
241 if (!src) return NULL;
242 len = (lstrlenW(src) + 1) * sizeof(WCHAR);
243 if ((dst = HeapAlloc(GetProcessHeap(), 0, len))) memcpy(dst, src, len);
244 return dst;
247 static inline const char *debug_wic_rect(const WICRect *rect)
249 if (!rect) return "(null)";
250 return wine_dbg_sprintf("(%u,%u)-(%u,%u)", rect->X, rect->Y, rect->Width, rect->Height);
253 extern HMODULE windowscodecs_module;
255 HRESULT read_png_chunk(IStream *stream, BYTE *type, BYTE **data, ULONG *data_size);
257 /* unixlib iface */
258 struct decoder_funcs;
260 struct decoder_info
262 GUID container_format;
263 GUID block_format;
264 CLSID clsid;
267 #define DECODER_FLAGS_CAPABILITY_MASK 0x1f
268 #define DECODER_FLAGS_UNSUPPORTED_COLOR_CONTEXT 0x80000000
270 struct decoder_stat
272 DWORD flags;
273 DWORD frame_count;
276 struct decoder_frame
278 CLSID pixel_format;
279 UINT width, height;
280 UINT bpp;
281 DOUBLE dpix, dpiy;
282 DWORD num_color_contexts;
283 DWORD num_colors;
284 WICColor palette[256];
287 #define DECODER_BLOCK_OPTION_MASK 0x0001000F
288 #define DECODER_BLOCK_FULL_STREAM 0x80000000
289 #define DECODER_BLOCK_READER_CLSID 0x40000000
290 struct decoder_block
292 ULONGLONG offset;
293 ULONGLONG length;
294 DWORD options;
295 GUID reader_clsid;
298 struct decoder
300 const struct decoder_funcs *vtable;
303 struct decoder_funcs
305 HRESULT (CDECL *initialize)(struct decoder* This, IStream *stream, struct decoder_stat *st);
306 HRESULT (CDECL *get_frame_info)(struct decoder* This, UINT frame, struct decoder_frame *info);
307 HRESULT (CDECL *copy_pixels)(struct decoder* This, UINT frame, const WICRect *prc,
308 UINT stride, UINT buffersize, BYTE *buffer);
309 HRESULT (CDECL *get_metadata_blocks)(struct decoder* This, UINT frame, UINT *count,
310 struct decoder_block **blocks);
311 HRESULT (CDECL *get_color_context)(struct decoder* This, UINT frame, UINT num,
312 BYTE **data, DWORD *datasize);
313 void (CDECL *destroy)(struct decoder* This);
316 HRESULT CDECL stream_getsize(IStream *stream, ULONGLONG *size);
317 HRESULT CDECL stream_read(IStream *stream, void *buffer, ULONG read, ULONG *bytes_read);
318 HRESULT CDECL stream_seek(IStream *stream, LONGLONG ofs, DWORD origin, ULONGLONG *new_position);
319 HRESULT CDECL stream_write(IStream *stream, const void *buffer, ULONG write, ULONG *bytes_written);
321 struct win32_funcs
323 HRESULT (CDECL *stream_getsize)(IStream *stream, ULONGLONG *size);
324 HRESULT (CDECL *stream_read)(IStream *stream, void *buffer, ULONG read, ULONG *bytes_read);
325 HRESULT (CDECL *stream_seek)(IStream *stream, LONGLONG ofs, DWORD origin, ULONGLONG *new_position);
326 HRESULT (CDECL *stream_write)(IStream *stream, const void *buffer, ULONG write, ULONG *bytes_written);
329 HRESULT CDECL decoder_create(const CLSID *decoder_clsid, struct decoder_info *info, struct decoder **result);
330 HRESULT CDECL decoder_initialize(struct decoder *This, IStream *stream, struct decoder_stat *st);
331 HRESULT CDECL decoder_get_frame_info(struct decoder* This, UINT frame, struct decoder_frame *info);
332 HRESULT CDECL decoder_copy_pixels(struct decoder* This, UINT frame, const WICRect *prc,
333 UINT stride, UINT buffersize, BYTE *buffer);
334 HRESULT CDECL decoder_get_metadata_blocks(struct decoder* This, UINT frame, UINT *count,
335 struct decoder_block **blocks);
336 HRESULT CDECL decoder_get_color_context(struct decoder* This, UINT frame, UINT num,
337 BYTE **data, DWORD *datasize);
338 void CDECL decoder_destroy(struct decoder *This);
340 struct encoder_funcs;
342 /* sync with encoder_option_properties */
343 enum encoder_option
345 ENCODER_OPTION_INTERLACE,
346 ENCODER_OPTION_FILTER,
347 ENCODER_OPTION_COMPRESSION_METHOD,
348 ENCODER_OPTION_COMPRESSION_QUALITY,
349 ENCODER_OPTION_IMAGE_QUALITY,
350 ENCODER_OPTION_BITMAP_TRANSFORM,
351 ENCODER_OPTION_LUMINANCE,
352 ENCODER_OPTION_CHROMINANCE,
353 ENCODER_OPTION_YCRCB_SUBSAMPLING,
354 ENCODER_OPTION_SUPPRESS_APP0,
355 ENCODER_OPTION_END
358 #define ENCODER_FLAGS_MULTI_FRAME 0x1
359 #define ENCODER_FLAGS_ICNS_SIZE 0x2
360 #define ENCODER_FLAGS_SUPPORTS_METADATA 0x4
362 struct encoder_info
364 DWORD flags;
365 GUID container_format;
366 CLSID clsid;
367 DWORD encoder_options[7];
370 struct encoder_frame
372 GUID pixel_format;
373 UINT width, height;
374 UINT bpp;
375 BOOL indexed;
376 DOUBLE dpix, dpiy;
377 DWORD num_colors;
378 WICColor palette[256];
379 /* encoder options */
380 BOOL interlace;
381 DWORD filter;
384 struct encoder
386 const struct encoder_funcs *vtable;
389 struct encoder_funcs
391 HRESULT (CDECL *initialize)(struct encoder* This, IStream *stream);
392 HRESULT (CDECL *get_supported_format)(struct encoder* This, GUID *pixel_format, DWORD *bpp, BOOL *indexed);
393 HRESULT (CDECL *create_frame)(struct encoder* This, const struct encoder_frame *frame);
394 HRESULT (CDECL *write_lines)(struct encoder* This, BYTE *data, DWORD line_count, DWORD stride);
395 HRESULT (CDECL *commit_frame)(struct encoder* This);
396 HRESULT (CDECL *commit_file)(struct encoder* This);
397 void (CDECL *destroy)(struct encoder* This);
400 HRESULT CDECL encoder_initialize(struct encoder* This, IStream *stream);
401 HRESULT CDECL encoder_get_supported_format(struct encoder* This, GUID *pixel_format, DWORD *bpp, BOOL *indexed);
402 HRESULT CDECL encoder_create_frame(struct encoder* This, const struct encoder_frame *frame);
403 HRESULT CDECL encoder_write_lines(struct encoder* This, BYTE *data, DWORD line_count, DWORD stride);
404 HRESULT CDECL encoder_commit_frame(struct encoder* This);
405 HRESULT CDECL encoder_commit_file(struct encoder* This);
406 void CDECL encoder_destroy(struct encoder* This);
408 HRESULT CDECL png_decoder_create(struct decoder_info *info, struct decoder **result);
409 HRESULT CDECL tiff_decoder_create(struct decoder_info *info, struct decoder **result);
410 HRESULT CDECL jpeg_decoder_create(struct decoder_info *info, struct decoder **result);
412 HRESULT CDECL png_encoder_create(struct encoder_info *info, struct encoder **result);
413 HRESULT CDECL tiff_encoder_create(struct encoder_info *info, struct encoder **result);
414 HRESULT CDECL jpeg_encoder_create(struct encoder_info *info, struct encoder **result);
415 HRESULT CDECL icns_encoder_create(struct encoder_info *info, struct encoder **result);
417 struct unix_funcs
419 HRESULT (CDECL *decoder_create)(const CLSID *decoder_clsid, struct decoder_info *info, struct decoder **result);
420 HRESULT (CDECL *decoder_initialize)(struct decoder *This, IStream *stream, struct decoder_stat *st);
421 HRESULT (CDECL *decoder_get_frame_info)(struct decoder* This, UINT frame, struct decoder_frame *info);
422 HRESULT (CDECL *decoder_copy_pixels)(struct decoder* This, UINT frame, const WICRect *prc,
423 UINT stride, UINT buffersize, BYTE *buffer);
424 HRESULT (CDECL *decoder_get_metadata_blocks)(struct decoder* This, UINT frame, UINT *count,
425 struct decoder_block **blocks);
426 HRESULT (CDECL *decoder_get_color_context)(struct decoder* This, UINT frame, UINT num,
427 BYTE **data, DWORD *datasize);
428 void (CDECL *decoder_destroy)(struct decoder* This);
429 HRESULT (CDECL *encoder_create)(const CLSID *encoder_clsid, struct encoder_info *info, struct encoder **result);
430 HRESULT (CDECL *encoder_initialize)(struct encoder* This, IStream *stream);
431 HRESULT (CDECL *encoder_get_supported_format)(struct encoder* This, GUID *pixel_format, DWORD *bpp, BOOL *indexed);
432 HRESULT (CDECL *encoder_create_frame)(struct encoder* This, const struct encoder_frame *frame);
433 HRESULT (CDECL *encoder_write_lines)(struct encoder* This, BYTE *data, DWORD line_count, DWORD stride);
434 HRESULT (CDECL *encoder_commit_frame)(struct encoder* This);
435 HRESULT (CDECL *encoder_commit_file)(struct encoder* This);
436 void (CDECL *encoder_destroy)(struct encoder* This);
439 HRESULT get_unix_decoder(const CLSID *decoder_clsid, struct decoder_info *info, struct decoder **result);
440 HRESULT get_unix_encoder(const CLSID *encoder_clsid, struct encoder_info *info, struct encoder **result);
442 extern HRESULT CommonDecoder_CreateInstance(struct decoder *decoder,
443 const struct decoder_info *decoder_info, REFIID iid, void** ppv) DECLSPEC_HIDDEN;
445 extern HRESULT CommonEncoder_CreateInstance(struct encoder *encoder,
446 const struct encoder_info *encoder_info, REFIID iid, void** ppv) DECLSPEC_HIDDEN;
448 #endif /* WINCODECS_PRIVATE_H */