31 #if LE_ENABLE_PNG_DECODER == 1 35 extern const char* LODEPNG_VERSION_STRING;
37 #define LODEPNG_NO_COMPILE_ENCODER 38 #define LODEPNG_NO_COMPILE_ERROR_TEXT 39 #define LODEPNG_COMPILE_ALLOCATORS 52 #ifndef LODEPNG_NO_COMPILE_ZLIB 53 #define LODEPNG_COMPILE_ZLIB 56 #ifndef LODEPNG_NO_COMPILE_PNG 57 #define LODEPNG_COMPILE_PNG 60 #ifndef LODEPNG_NO_COMPILE_DECODER 61 #define LODEPNG_COMPILE_DECODER 64 #ifndef LODEPNG_NO_COMPILE_ANCILLARY_CHUNKS 65 #define LODEPNG_COMPILE_ANCILLARY_CHUNKS 68 #ifndef LODEPNG_NO_COMPILE_ERROR_TEXT 69 #define LODEPNG_COMPILE_ERROR_TEXT 72 #ifdef LODEPNG_COMPILE_PNG 74 typedef enum LodePNGColorType
83 #ifdef LODEPNG_COMPILE_DECODER 99 unsigned lodepng_decode_memory(
unsigned char** out,
unsigned* w,
unsigned* h,
100 const unsigned char* in,
size_t insize,
101 LodePNGColorType colortype,
unsigned bitdepth);
104 unsigned lodepng_decode32(
unsigned char** out,
unsigned* w,
unsigned* h,
105 const unsigned char* in,
size_t insize);
108 unsigned lodepng_decode24(
unsigned char** out,
unsigned* w,
unsigned* h,
109 const unsigned char* in,
size_t insize);
114 #ifdef LODEPNG_COMPILE_ERROR_TEXT 116 const char* lodepng_error_text(
unsigned code);
119 #ifdef LODEPNG_COMPILE_DECODER 121 typedef struct LodePNGDecompressSettings LodePNGDecompressSettings;
122 struct LodePNGDecompressSettings
124 unsigned ignore_adler32;
127 unsigned (*custom_zlib)(
unsigned char**,
size_t*,
128 const unsigned char*, size_t,
129 const LodePNGDecompressSettings*);
133 unsigned (*custom_inflate)(
unsigned char**,
size_t*,
134 const unsigned char*, size_t,
135 const LodePNGDecompressSettings*);
137 const void* custom_context;
140 extern const LodePNGDecompressSettings lodepng_default_decompress_settings;
141 void lodepng_decompress_settings_init(LodePNGDecompressSettings* settings);
144 #ifdef LODEPNG_COMPILE_PNG 150 typedef struct LodePNGColorMode
153 LodePNGColorType colortype;
169 unsigned char* palette;
183 unsigned key_defined;
190 void lodepng_color_mode_init(LodePNGColorMode* info);
191 void lodepng_color_mode_cleanup(LodePNGColorMode* info);
193 unsigned lodepng_color_mode_copy(LodePNGColorMode* dest,
const LodePNGColorMode* source);
195 void lodepng_palette_clear(LodePNGColorMode* info);
197 unsigned lodepng_palette_add(LodePNGColorMode* info,
198 unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a);
201 unsigned lodepng_get_bpp(
const LodePNGColorMode* info);
204 unsigned lodepng_get_channels(
const LodePNGColorMode* info);
206 unsigned lodepng_is_greyscale_type(
const LodePNGColorMode* info);
208 unsigned lodepng_is_alpha_type(
const LodePNGColorMode* info);
210 unsigned lodepng_is_palette_type(
const LodePNGColorMode* info);
213 unsigned lodepng_has_palette_alpha(
const LodePNGColorMode* info);
221 unsigned lodepng_can_have_alpha(
const LodePNGColorMode* info);
223 size_t lodepng_get_raw_size(
unsigned w,
unsigned h,
const LodePNGColorMode* color);
225 #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS 227 typedef struct LodePNGTime
239 typedef struct LodePNGInfo
242 unsigned compression_method;
243 unsigned filter_method;
244 unsigned interlace_method;
245 LodePNGColorMode color;
247 #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS 259 unsigned background_defined;
260 unsigned background_r;
261 unsigned background_g;
262 unsigned background_b;
288 char** itext_langtags;
289 char** itext_transkeys;
290 char** itext_strings;
293 unsigned time_defined;
297 unsigned phys_defined;
311 unsigned char* unknown_chunks_data[3];
312 size_t unknown_chunks_size[3];
317 void lodepng_info_init(LodePNGInfo* info);
318 void lodepng_info_cleanup(LodePNGInfo* info);
320 unsigned lodepng_info_copy(LodePNGInfo* dest,
const LodePNGInfo* source);
322 #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS 323 void lodepng_clear_text(LodePNGInfo* info);
324 unsigned lodepng_add_text(LodePNGInfo* info,
const char* key,
const char* str);
326 void lodepng_clear_itext(LodePNGInfo* info);
327 unsigned lodepng_add_itext(LodePNGInfo* info,
const char* key,
const char* langtag,
328 const char* transkey,
const char* str);
342 unsigned lodepng_convert(
unsigned char* out,
const unsigned char* in,
343 const LodePNGColorMode* mode_out,
const LodePNGColorMode* mode_in,
344 unsigned w,
unsigned h);
346 #ifdef LODEPNG_COMPILE_DECODER 351 typedef struct LodePNGDecoderSettings
353 LodePNGDecompressSettings zlibsettings;
357 unsigned color_convert;
359 #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS 360 unsigned read_text_chunks;
362 unsigned remember_unknown_chunks;
364 } LodePNGDecoderSettings;
366 void lodepng_decoder_settings_init(LodePNGDecoderSettings* settings);
369 #if defined(LODEPNG_COMPILE_DECODER) 371 typedef struct LodePNGState
373 #ifdef LODEPNG_COMPILE_DECODER 374 LodePNGDecoderSettings decoder;
376 LodePNGColorMode info_raw;
377 LodePNGInfo info_png;
382 void lodepng_state_init(LodePNGState* state);
383 void lodepng_state_cleanup(LodePNGState* state);
384 void lodepng_state_copy(LodePNGState* dest,
const LodePNGState* source);
387 #ifdef LODEPNG_COMPILE_DECODER 392 unsigned lodepng_decode(
unsigned char** out,
unsigned* w,
unsigned* h,
394 const unsigned char* in,
size_t insize);
401 unsigned lodepng_inspect(
unsigned* w,
unsigned* h,
403 const unsigned char* in,
size_t insize);
424 unsigned lodepng_chunk_length(
const unsigned char* chunk);
427 void lodepng_chunk_type(
char type[5],
const unsigned char* chunk);
430 unsigned char lodepng_chunk_type_equals(
const unsigned char* chunk,
const char* type);
433 unsigned char lodepng_chunk_ancillary(
const unsigned char* chunk);
436 unsigned char lodepng_chunk_private(
const unsigned char* chunk);
439 unsigned char lodepng_chunk_safetocopy(
const unsigned char* chunk);
442 unsigned char* lodepng_chunk_data(
unsigned char* chunk);
443 const unsigned char* lodepng_chunk_data_const(
const unsigned char* chunk);
446 unsigned lodepng_chunk_check_crc(
const unsigned char* chunk);
449 void lodepng_chunk_generate_crc(
unsigned char* chunk);
452 unsigned char* lodepng_chunk_next(
unsigned char* chunk);
453 const unsigned char* lodepng_chunk_next_const(
const unsigned char* chunk);
460 unsigned lodepng_chunk_append(
unsigned char** out,
size_t* outlength,
const unsigned char* chunk);
468 unsigned lodepng_chunk_create(
unsigned char** out,
size_t* outlength,
unsigned length,
469 const char* type,
const unsigned char* data);
473 unsigned lodepng_crc32(
const unsigned char* buf,
size_t len);
477 #ifdef LODEPNG_COMPILE_ZLIB 484 #ifdef LODEPNG_COMPILE_DECODER 486 unsigned lodepng_inflate(
unsigned char** out,
size_t* outsize,
487 const unsigned char* in,
size_t insize,
488 const LodePNGDecompressSettings* settings);
496 unsigned lodepng_zlib_decompress(
unsigned char** out,
size_t* outsize,
497 const unsigned char* in,
size_t insize,
498 const LodePNGDecompressSettings* settings);
virtual uint32_t length(const leString *_this)
Get length of the string.
Image functions and defintions.