45 #ifndef LODEPNG_NO_COMPILE_ZLIB 46 #define LODEPNG_COMPILE_ZLIB 49 #ifndef LODEPNG_NO_COMPILE_PNG 50 #define LODEPNG_COMPILE_PNG 53 #ifndef LODEPNG_NO_COMPILE_DECODER 54 #define LODEPNG_COMPILE_DECODER 57 #ifndef LODEPNG_NO_COMPILE_ENCODER 58 #define LODEPNG_COMPILE_ENCODER 61 #ifndef LODEPNG_NO_COMPILE_DISK 62 #define LODEPNG_COMPILE_DISK 65 #ifndef LODEPNG_NO_COMPILE_ANCILLARY_CHUNKS 66 #define LODEPNG_COMPILE_ANCILLARY_CHUNKS 69 #ifndef LODEPNG_NO_COMPILE_ERROR_TEXT 70 #define LODEPNG_COMPILE_ERROR_TEXT 75 #ifndef LODEPNG_NO_COMPILE_ALLOCATORS 76 #define LODEPNG_COMPILE_ALLOCATORS 80 #ifndef LODEPNG_NO_COMPILE_CPP 81 #define LODEPNG_COMPILE_CPP 85 #ifdef LODEPNG_COMPILE_PNG 95 #ifdef LODEPNG_COMPILE_DECODER 112 const unsigned char* in,
size_t insize,
117 const unsigned char* in,
size_t insize);
121 const unsigned char* in,
size_t insize);
123 #ifdef LODEPNG_COMPILE_DISK 129 const char* filename,
134 const char* filename);
138 const char* filename);
143 #ifdef LODEPNG_COMPILE_ENCODER 161 const unsigned char* image,
unsigned w,
unsigned h,
166 const unsigned char* image,
unsigned w,
unsigned h);
170 const unsigned char* image,
unsigned w,
unsigned h);
172 #ifdef LODEPNG_COMPILE_DISK 179 const unsigned char* image,
unsigned w,
unsigned h,
184 const unsigned char* image,
unsigned w,
unsigned h);
188 const unsigned char* image,
unsigned w,
unsigned h);
193 #ifdef LODEPNG_COMPILE_CPP 195 #ifdef LODEPNG_COMPILE_DECODER 197 unsigned decode(std::vector<unsigned char>& out,
unsigned& w,
unsigned& h,
198 const unsigned char* in,
size_t insize,
200 unsigned decode(std::vector<unsigned char>& out,
unsigned& w,
unsigned& h,
201 const std::vector<unsigned char>& in,
203 #ifdef LODEPNG_COMPILE_DISK 208 unsigned decode(std::vector<unsigned char>& out,
unsigned& w,
unsigned& h,
209 const std::string& filename,
211 #endif //LODEPNG_COMPILE_DISK 212 #endif //LODEPNG_COMPILE_DECODER 214 #ifdef LODEPNG_COMPILE_ENCODER 216 unsigned encode(std::vector<unsigned char>& out,
217 const unsigned char* in,
unsigned w,
unsigned h,
219 unsigned encode(std::vector<unsigned char>& out,
220 const std::vector<unsigned char>& in,
unsigned w,
unsigned h,
222 #ifdef LODEPNG_COMPILE_DISK 228 unsigned encode(
const std::string& filename,
229 const unsigned char* in,
unsigned w,
unsigned h,
231 unsigned encode(
const std::string& filename,
232 const std::vector<unsigned char>& in,
unsigned w,
unsigned h,
234 #endif //LODEPNG_COMPILE_DISK 235 #endif //LODEPNG_COMPILE_ENCODER 240 #ifdef LODEPNG_COMPILE_ERROR_TEXT 245 #ifdef LODEPNG_COMPILE_DECODER 252 unsigned (*custom_zlib)(
unsigned char**,
size_t*,
253 const unsigned char*, size_t,
258 unsigned (*custom_inflate)(
unsigned char**,
size_t*,
259 const unsigned char*, size_t,
269 #ifdef LODEPNG_COMPILE_ENCODER 285 unsigned (*custom_zlib)(
unsigned char**,
size_t*,
286 const unsigned char*, size_t,
291 unsigned (*custom_deflate)(
unsigned char**,
size_t*,
292 const unsigned char*, size_t,
302 #ifdef LODEPNG_COMPILE_PNG 358 unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a);
386 #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS 407 #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS 471 unsigned char* unknown_chunks_data[3];
472 size_t unknown_chunks_size[3];
482 #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS 492 const char* transkey,
const char*
508 unsigned w,
unsigned h,
unsigned fix_png);
511 #ifdef LODEPNG_COMPILE_DECODER 524 #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS 534 #ifdef LODEPNG_COMPILE_ENCODER 600 #ifdef LODEPNG_COMPILE_ANCILLARY_CHUNKS 612 #if defined(LODEPNG_COMPILE_DECODER) || defined(LODEPNG_COMPILE_ENCODER) 615 #ifdef LODEPNG_COMPILE_DECODER 618 #ifdef LODEPNG_COMPILE_ENCODER 625 #ifdef LODEPNG_COMPILE_CPP 637 #ifdef LODEPNG_COMPILE_DECODER 642 unsigned lodepng_decode(
unsigned char** out,
unsigned* w,
unsigned* h,
644 const unsigned char* in,
size_t insize);
653 const unsigned char* in,
size_t insize);
657 #ifdef LODEPNG_COMPILE_ENCODER 660 const unsigned char* image,
unsigned w,
unsigned h,
715 const unsigned char* chunk);
725 const char* type,
const unsigned char* data);
729 unsigned lodepng_crc32(
const unsigned char* buf,
size_t len);
733 #ifdef LODEPNG_COMPILE_ZLIB 740 #ifdef LODEPNG_COMPILE_DECODER 743 const unsigned char* in,
size_t insize,
753 const unsigned char* in,
size_t insize,
757 #ifdef LODEPNG_COMPILE_ENCODER 766 const unsigned char* in,
size_t insize,
774 const unsigned* frequencies,
775 size_t numcodes,
unsigned maxbitlen);
779 const unsigned char* in,
size_t insize,
785 #ifdef LODEPNG_COMPILE_DISK 795 const char* filename);
806 const char* filename);
809 #ifdef LODEPNG_COMPILE_CPP 812 #ifdef LODEPNG_COMPILE_PNG 817 State(
const State& other);
819 State& operator=(
const State& other);
822 #ifdef LODEPNG_COMPILE_DECODER 824 unsigned decode(std::vector<unsigned char>& out,
unsigned& w,
unsigned& h,
826 const unsigned char* in,
size_t insize);
827 unsigned decode(std::vector<unsigned char>& out,
unsigned& w,
unsigned& h,
829 const std::vector<unsigned char>& in);
832 #ifdef LODEPNG_COMPILE_ENCODER 834 unsigned encode(std::vector<unsigned char>& out,
835 const unsigned char* in,
unsigned w,
unsigned h,
837 unsigned encode(std::vector<unsigned char>& out,
838 const std::vector<unsigned char>& in,
unsigned w,
unsigned h,
842 #ifdef LODEPNG_COMPILE_DISK 847 void load_file(std::vector<unsigned char>& buffer,
const std::string& filename);
853 void save_file(
const std::vector<unsigned char>& buffer,
854 const std::string& filename);
855 #endif //LODEPNG_COMPILE_DISK 856 #endif //LODEPNG_COMPILE_PNG 858 #ifdef LODEPNG_COMPILE_ZLIB 859 #ifdef LODEPNG_COMPILE_DECODER 861 unsigned decompress(std::vector<unsigned char>& out,
const unsigned char* in,
864 lodepng_default_decompress_settings);
867 unsigned decompress(std::vector<unsigned char>& out,
868 const std::vector<unsigned char>& in,
870 lodepng_default_decompress_settings);
871 #endif //LODEPNG_COMPILE_DECODER 873 #ifdef LODEPNG_COMPILE_ENCODER 875 unsigned compress(std::vector<unsigned char>& out,
const unsigned char* in,
880 unsigned compress(std::vector<unsigned char>& out,
881 const std::vector<unsigned char>& in,
883 #endif //LODEPNG_COMPILE_ENCODER 884 #endif //LODEPNG_COMPILE_ZLIB
unsigned lodepng_get_bpp(const LodePNGColorMode *info)
LodePNGColorMode info_raw
unsigned text_compression
unsigned char lodepng_chunk_safetocopy(const unsigned char *chunk)
void lodepng_color_mode_cleanup(LodePNGColorMode *info)
unsigned lodepng_inflate(unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGDecompressSettings *settings)
unsigned lodepng_convert(unsigned char *out, const unsigned char *in, LodePNGColorMode *mode_out, LodePNGColorMode *mode_in, unsigned w, unsigned h, unsigned fix_png)
unsigned char lodepng_chunk_private(const unsigned char *chunk)
unsigned lodepng_info_copy(LodePNGInfo *dest, const LodePNGInfo *source)
unsigned lodepng_chunk_create(unsigned char **out, size_t *outlength, unsigned length, const char *type, const unsigned char *data)
struct LodePNGDecoderSettings LodePNGDecoderSettings
struct LodePNGColorMode LodePNGColorMode
unsigned lodepng_save_file(const unsigned char *buffer, size_t buffersize, const char *filename)
unsigned lodepng_deflate(unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGCompressSettings *settings)
unsigned interlace_method
unsigned lodepng_encode_file(const char *filename, const unsigned char *image, unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth)
unsigned read_text_chunks
void lodepng_info_init(LodePNGInfo *info)
const LodePNGCompressSettings lodepng_default_compress_settings
size_t lodepng_get_raw_size(unsigned w, unsigned h, const LodePNGColorMode *color)
unsigned lodepng_is_palette_type(const LodePNGColorMode *info)
unsigned lodepng_decode(unsigned char **out, unsigned *w, unsigned *h, LodePNGState *state, const unsigned char *in, size_t insize)
unsigned char lodepng_chunk_type_equals(const unsigned char *chunk, const char *type)
unsigned background_defined
unsigned lodepng_decode24(unsigned char **out, unsigned *w, unsigned *h, const unsigned char *in, size_t insize)
unsigned lodepng_encode(unsigned char **out, size_t *outsize, const unsigned char *image, unsigned w, unsigned h, LodePNGState *state)
unsigned filter_palette_zero
void lodepng_chunk_generate_crc(unsigned char *chunk)
LodePNGDecompressSettings zlibsettings
unsigned lodepng_encode24_file(const char *filename, const unsigned char *image, unsigned w, unsigned h)
unsigned lodepng_encode32(unsigned char **out, size_t *outsize, const unsigned char *image, unsigned w, unsigned h)
unsigned lodepng_is_greyscale_type(const LodePNGColorMode *info)
LodePNGColorType colortype
void lodepng_color_mode_init(LodePNGColorMode *info)
void lodepng_state_copy(LodePNGState *dest, const LodePNGState *source)
unsigned char lodepng_chunk_ancillary(const unsigned char *chunk)
void lodepng_clear_text(LodePNGInfo *info)
void lodepng_state_cleanup(LodePNGState *state)
unsigned char * predefined_filters
void lodepng_info_cleanup(LodePNGInfo *info)
struct LodePNGInfo LodePNGInfo
unsigned lodepng_decode_file(unsigned char **out, unsigned *w, unsigned *h, const char *filename, LodePNGColorType colortype, unsigned bitdepth)
unsigned lodepng_has_palette_alpha(const LodePNGColorMode *info)
unsigned lodepng_get_channels(const LodePNGColorMode *info)
unsigned lodepng_zlib_decompress(unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGDecompressSettings *settings)
void lodepng_clear_itext(LodePNGInfo *info)
unsigned lodepng_encode32_file(const char *filename, const unsigned char *image, unsigned w, unsigned h)
unsigned compression_method
unsigned lodepng_inspect(unsigned *w, unsigned *h, LodePNGState *state, const unsigned char *in, size_t insize)
LodePNGAutoConvert auto_convert
unsigned lodepng_encode24(unsigned char **out, size_t *outsize, const unsigned char *image, unsigned w, unsigned h)
void lodepng_decoder_settings_init(LodePNGDecoderSettings *settings)
const unsigned char * lodepng_chunk_next_const(const unsigned char *chunk)
unsigned lodepng_crc32(const unsigned char *buf, size_t len)
unsigned lodepng_decode_memory(unsigned char **out, unsigned *w, unsigned *h, const unsigned char *in, size_t insize, LodePNGColorType colortype, unsigned bitdepth)
unsigned lodepng_chunk_append(unsigned char **out, size_t *outlength, const unsigned char *chunk)
LodePNGCompressSettings zlibsettings
void lodepng_compress_settings_init(LodePNGCompressSettings *settings)
unsigned lodepng_add_text(LodePNGInfo *info, const char *key, const char *str)
struct LodePNGEncoderSettings LodePNGEncoderSettings
unsigned char * lodepng_chunk_next(unsigned char *chunk)
unsigned lodepng_encode_memory(unsigned char **out, size_t *outsize, const unsigned char *image, unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth)
unsigned lodepng_palette_add(LodePNGColorMode *info, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
const LodePNGDecompressSettings lodepng_default_decompress_settings
void lodepng_palette_clear(LodePNGColorMode *info)
unsigned lodepng_decode24_file(unsigned char **out, unsigned *w, unsigned *h, const char *filename)
unsigned char * lodepng_chunk_data(unsigned char *chunk)
void lodepng_encoder_settings_init(LodePNGEncoderSettings *settings)
unsigned lodepng_load_file(unsigned char **out, size_t *outsize, const char *filename)
LodePNGFilterStrategy filter_strategy
unsigned lodepng_add_itext(LodePNGInfo *info, const char *key, const char *langtag, const char *transkey, const char *str)
unsigned lodepng_can_have_alpha(const LodePNGColorMode *info)
const char * lodepng_error_text(unsigned code)
void lodepng_state_init(LodePNGState *state)
LodePNGDecoderSettings decoder
void lodepng_chunk_type(char type[5], const unsigned char *chunk)
unsigned lodepng_decode32_file(unsigned char **out, unsigned *w, unsigned *h, const char *filename)
LodePNGEncoderSettings encoder
unsigned lodepng_is_alpha_type(const LodePNGColorMode *info)
unsigned lodepng_color_mode_copy(LodePNGColorMode *dest, const LodePNGColorMode *source)
const unsigned char * lodepng_chunk_data_const(const unsigned char *chunk)
unsigned lodepng_decode32(unsigned char **out, unsigned *w, unsigned *h, const unsigned char *in, size_t insize)
unsigned lodepng_zlib_compress(unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGCompressSettings *settings)
void lodepng_decompress_settings_init(LodePNGDecompressSettings *settings)
struct LodePNGTime LodePNGTime
unsigned remember_unknown_chunks
unsigned lodepng_huffman_code_lengths(unsigned *lengths, const unsigned *frequencies, size_t numcodes, unsigned maxbitlen)
unsigned lodepng_chunk_length(const unsigned char *chunk)
unsigned lodepng_chunk_check_crc(const unsigned char *chunk)
struct LodePNGState LodePNGState