My Project
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Classes | |
struct | LodeZlib_DeflateSettings |
struct | LodePNG_InfoColor |
struct | LodePNG_InfoPng |
struct | LodePNG_InfoRaw |
struct | LodePNG_EncodeSettings |
struct | LodePNG_Encoder |
Macros | |
#define | LODEPNG_COMPILE_ZLIB /*deflate&zlib encoder and deflate&zlib decoder*/ |
#define | LODEPNG_COMPILE_PNG /*png encoder and png decoder*/ |
#define | LODEPNG_COMPILE_ENCODER /*deflate&zlib encoder and png encoder*/ |
#define | LODEPNG_COMPILE_DISK /*the optional built in harddisk file loading and saving functions*/ |
Typedefs | |
typedef struct LodeZlib_DeflateSettings | LodeZlib_DeflateSettings |
typedef struct LodePNG_InfoColor | LodePNG_InfoColor |
typedef struct LodePNG_InfoPng | LodePNG_InfoPng |
typedef struct LodePNG_InfoRaw | LodePNG_InfoRaw |
typedef struct LodePNG_EncodeSettings | LodePNG_EncodeSettings |
typedef struct LodePNG_Encoder | LodePNG_Encoder |
Functions | |
void | LodeZlib_DeflateSettings_init (LodeZlib_DeflateSettings *settings) |
unsigned | LodeZlib_compress (unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodeZlib_DeflateSettings *settings) |
unsigned | LodePNG_chunk_length (const unsigned char *chunk) |
void | LodePNG_chunk_type (char type[5], const unsigned char *chunk) |
unsigned char | LodePNG_chunk_type_equals (const unsigned char *chunk, const char *type) |
unsigned char | LodePNG_chunk_critical (const unsigned char *chunk) |
unsigned char | LodePNG_chunk_private (const unsigned char *chunk) |
unsigned char | LodePNG_chunk_safetocopy (const unsigned char *chunk) |
unsigned char * | LodePNG_chunk_data (unsigned char *chunk) |
const unsigned char * | LodePNG_chunk_data_const (const unsigned char *chunk) |
unsigned | LodePNG_chunk_check_crc (const unsigned char *chunk) |
void | LodePNG_chunk_generate_crc (unsigned char *chunk) |
unsigned char * | LodePNG_chunk_next (unsigned char *chunk) |
const unsigned char * | LodePNG_chunk_next_const (const unsigned char *chunk) |
unsigned | LodePNG_append_chunk (unsigned char **out, size_t *outlength, const unsigned char *chunk) |
unsigned | LodePNG_create_chunk (unsigned char **out, size_t *outlength, unsigned length, const char *type, const unsigned char *data) |
void | LodePNG_InfoColor_init (LodePNG_InfoColor *info) |
void | LodePNG_InfoColor_cleanup (LodePNG_InfoColor *info) |
unsigned | LodePNG_InfoColor_copy (LodePNG_InfoColor *dest, const LodePNG_InfoColor *source) |
void | LodePNG_InfoColor_clearPalette (LodePNG_InfoColor *info) |
unsigned | LodePNG_InfoColor_addPalette (LodePNG_InfoColor *info, unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
unsigned | LodePNG_InfoColor_getBpp (const LodePNG_InfoColor *info) |
unsigned | LodePNG_InfoColor_getChannels (const LodePNG_InfoColor *info) |
unsigned | LodePNG_InfoColor_isGreyscaleType (const LodePNG_InfoColor *info) |
unsigned | LodePNG_InfoColor_isAlphaType (const LodePNG_InfoColor *info) |
void | LodePNG_InfoPng_init (LodePNG_InfoPng *info) |
void | LodePNG_InfoPng_cleanup (LodePNG_InfoPng *info) |
unsigned | LodePNG_InfoPng_copy (LodePNG_InfoPng *dest, const LodePNG_InfoPng *source) |
void | LodePNG_InfoRaw_init (LodePNG_InfoRaw *info) |
void | LodePNG_InfoRaw_cleanup (LodePNG_InfoRaw *info) |
unsigned | LodePNG_InfoRaw_copy (LodePNG_InfoRaw *dest, const LodePNG_InfoRaw *source) |
unsigned | LodePNG_convert (unsigned char *out, const unsigned char *in, LodePNG_InfoColor *infoOut, LodePNG_InfoColor *infoIn, unsigned w, unsigned h) |
void | LodePNG_EncodeSettings_init (LodePNG_EncodeSettings *settings) |
void | LodePNG_Encoder_init (LodePNG_Encoder *encoder) |
void | LodePNG_Encoder_cleanup (LodePNG_Encoder *encoder) |
void | LodePNG_Encoder_copy (LodePNG_Encoder *dest, const LodePNG_Encoder *source) |
void | LodePNG_encode (LodePNG_Encoder *encoder, unsigned char **out, size_t *outsize, 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_encode32f (const char *filename, const unsigned char *image, unsigned w, unsigned h) |
unsigned | LodePNG_loadFile (unsigned char **out, size_t *outsize, const char *filename) |
unsigned | LodePNG_saveFile (const unsigned char *buffer, size_t buffersize, const char *filename) |
Variables | |
const LodeZlib_DeflateSettings | LodeZlib_defaultDeflateSettings |
#define LODEPNG_COMPILE_DISK /*the optional built in harddisk file loading and saving functions*/ |
#define LODEPNG_COMPILE_ENCODER /*deflate&zlib encoder and png encoder*/ |
#define LODEPNG_COMPILE_PNG /*png encoder and png decoder*/ |
#define LODEPNG_COMPILE_ZLIB /*deflate&zlib encoder and deflate&zlib decoder*/ |
typedef struct LodePNG_Encoder LodePNG_Encoder |
typedef struct LodePNG_EncodeSettings LodePNG_EncodeSettings |
typedef struct LodePNG_InfoColor LodePNG_InfoColor |
typedef struct LodePNG_InfoPng LodePNG_InfoPng |
typedef struct LodePNG_InfoRaw LodePNG_InfoRaw |
typedef struct LodeZlib_DeflateSettings LodeZlib_DeflateSettings |
unsigned LodePNG_append_chunk | ( | unsigned char ** | out, |
size_t * | outlength, | ||
const unsigned char * | chunk | ||
) |
Definition at line 1937 of file lodepng.cpp.
References LodePNG_chunk_length().
unsigned LodePNG_chunk_check_crc | ( | const unsigned char * | chunk | ) |
Definition at line 1909 of file lodepng.cpp.
References Crc32_crc(), LodePNG_chunk_length(), and LodePNG_read32bitInt().
unsigned char LodePNG_chunk_critical | ( | const unsigned char * | chunk | ) |
Definition at line 1884 of file lodepng.cpp.
unsigned char* LodePNG_chunk_data | ( | unsigned char * | chunk | ) |
Definition at line 1899 of file lodepng.cpp.
const unsigned char* LodePNG_chunk_data_const | ( | const unsigned char * | chunk | ) |
Definition at line 1904 of file lodepng.cpp.
void LodePNG_chunk_generate_crc | ( | unsigned char * | chunk | ) |
Definition at line 1918 of file lodepng.cpp.
References Crc32_crc(), LodePNG_chunk_length(), and LodePNG_set32bitInt().
Referenced by LodePNG_create_chunk().
unsigned LodePNG_chunk_length | ( | const unsigned char * | chunk | ) |
Definition at line 1865 of file lodepng.cpp.
References LodePNG_read32bitInt().
Referenced by LodePNG_append_chunk(), LodePNG_chunk_check_crc(), LodePNG_chunk_generate_crc(), LodePNG_chunk_next(), and LodePNG_chunk_next_const().
unsigned char* LodePNG_chunk_next | ( | unsigned char * | chunk | ) |
Definition at line 1925 of file lodepng.cpp.
References LodePNG_chunk_length().
const unsigned char* LodePNG_chunk_next_const | ( | const unsigned char * | chunk | ) |
Definition at line 1931 of file lodepng.cpp.
References LodePNG_chunk_length().
unsigned char LodePNG_chunk_private | ( | const unsigned char * | chunk | ) |
Definition at line 1889 of file lodepng.cpp.
unsigned char LodePNG_chunk_safetocopy | ( | const unsigned char * | chunk | ) |
Definition at line 1894 of file lodepng.cpp.
void LodePNG_chunk_type | ( | char | type[5], |
const unsigned char * | chunk | ||
) |
Definition at line 1870 of file lodepng.cpp.
unsigned char LodePNG_chunk_type_equals | ( | const unsigned char * | chunk, |
const char * | type | ||
) |
Definition at line 1877 of file lodepng.cpp.
unsigned LodePNG_convert | ( | unsigned char * | out, |
const unsigned char * | in, | ||
LodePNG_InfoColor * | infoOut, | ||
LodePNG_InfoColor * | infoIn, | ||
unsigned | w, | ||
unsigned | h | ||
) |
Definition at line 2361 of file lodepng.cpp.
References LodePNG_InfoColor::bitDepth, LodePNG_InfoColor::colorType, LodePNG_InfoColor::key_b, LodePNG_InfoColor::key_defined, LodePNG_InfoColor::key_g, LodePNG_InfoColor::key_r, LodePNG_InfoColor_equal(), LodePNG_InfoColor_getBpp(), LodePNG_InfoColor_isAlphaType(), LodePNG_InfoColor_isGreyscaleType(), LodePNG_InfoColor::palette, LodePNG_InfoColor::palettesize, and readBitsFromReversedStream().
Referenced by LodePNG_encode().
unsigned LodePNG_create_chunk | ( | unsigned char ** | out, |
size_t * | outlength, | ||
unsigned | length, | ||
const char * | type, | ||
const unsigned char * | data | ||
) |
Definition at line 1956 of file lodepng.cpp.
References LodePNG_chunk_generate_crc(), and LodePNG_set32bitInt().
Referenced by addChunk().
void LodePNG_encode | ( | LodePNG_Encoder * | encoder, |
unsigned char ** | out, | ||
size_t * | outsize, | ||
const unsigned char * | image, | ||
unsigned | w, | ||
unsigned | h | ||
) |
Definition at line 3910 of file lodepng.cpp.
References addChunk_IDAT(), addChunk_IEND(), addChunk_IHDR(), addChunk_PLTE(), addChunk_tRNS(), LodePNG_EncodeSettings::autoLeaveOutAlphaChannel, LodePNG_InfoColor::bitDepth, LodeZlib_DeflateSettings::btype, checkColorValidity(), LodePNG_InfoPng::color, LodePNG_InfoRaw::color, LodePNG_InfoColor::colorType, ucvector::data, LodePNG_Encoder::error, LodePNG_EncodeSettings::force_palette, LodePNG_InfoPng::height, LodePNG_Encoder::infoPng, LodePNG_Encoder::infoRaw, LodePNG_InfoPng::interlaceMethod, isFullyOpaque(), isPaletteFullyOpaque(), LodePNG_InfoColor::key_defined, LodePNG_convert(), LodePNG_InfoColor_equal(), LodePNG_InfoColor_getBpp(), LodePNG_InfoColor::palette, LodePNG_InfoColor::palettesize, preProcessScanlines(), LodePNG_Encoder::settings, ucvector::size, ucvector_init(), VERSION_STRING, LodePNG_InfoPng::width, LodeZlib_DeflateSettings::windowSize, writeSignature(), and LodePNG_EncodeSettings::zlibsettings.
Referenced by LodePNG_encode32(), Image::save(), and ColoredImage::save().
unsigned LodePNG_encode32 | ( | unsigned char ** | out, |
size_t * | outsize, | ||
const unsigned char * | image, | ||
unsigned | w, | ||
unsigned | h | ||
) |
Definition at line 4042 of file lodepng.cpp.
References LodePNG_Encoder::error, LodePNG_encode(), LodePNG_Encoder_cleanup(), and LodePNG_Encoder_init().
Referenced by LodePNG_encode32f().
unsigned LodePNG_encode32f | ( | const char * | filename, |
const unsigned char * | image, | ||
unsigned | w, | ||
unsigned | h | ||
) |
Definition at line 4054 of file lodepng.cpp.
References LodePNG_encode32(), and LodePNG_saveFile().
void LodePNG_Encoder_cleanup | ( | LodePNG_Encoder * | encoder | ) |
Definition at line 4084 of file lodepng.cpp.
References LodePNG_Encoder::infoPng, LodePNG_Encoder::infoRaw, LodePNG_InfoPng_cleanup(), and LodePNG_InfoRaw_cleanup().
Referenced by LodePNG_encode32(), LodePNG_Encoder_copy(), Image::save(), and ColoredImage::save().
void LodePNG_Encoder_copy | ( | LodePNG_Encoder * | dest, |
const LodePNG_Encoder * | source | ||
) |
Definition at line 4090 of file lodepng.cpp.
References LodePNG_Encoder::error, LodePNG_Encoder::infoPng, LodePNG_Encoder::infoRaw, LodePNG_Encoder_cleanup(), LodePNG_InfoPng_copy(), LodePNG_InfoPng_init(), LodePNG_InfoRaw_copy(), and LodePNG_InfoRaw_init().
void LodePNG_Encoder_init | ( | LodePNG_Encoder * | encoder | ) |
Definition at line 4076 of file lodepng.cpp.
References LodePNG_Encoder::error, LodePNG_Encoder::infoPng, LodePNG_Encoder::infoRaw, LodePNG_EncodeSettings_init(), LodePNG_InfoPng_init(), LodePNG_InfoRaw_init(), and LodePNG_Encoder::settings.
Referenced by LodePNG_encode32(), Image::save(), and ColoredImage::save().
void LodePNG_EncodeSettings_init | ( | LodePNG_EncodeSettings * | settings | ) |
Definition at line 4065 of file lodepng.cpp.
References LodePNG_EncodeSettings::autoLeaveOutAlphaChannel, LodePNG_EncodeSettings::force_palette, LodeZlib_DeflateSettings_init(), and LodePNG_EncodeSettings::zlibsettings.
Referenced by LodePNG_Encoder_init().
unsigned LodePNG_InfoColor_addPalette | ( | LodePNG_InfoColor * | info, |
unsigned char | r, | ||
unsigned char | g, | ||
unsigned char | b, | ||
unsigned char | a | ||
) |
Definition at line 2046 of file lodepng.cpp.
References LodePNG_InfoColor::palette, and LodePNG_InfoColor::palettesize.
Referenced by Image::save().
void LodePNG_InfoColor_cleanup | ( | LodePNG_InfoColor * | info | ) |
Definition at line 2035 of file lodepng.cpp.
References LodePNG_InfoColor_clearPalette().
Referenced by LodePNG_InfoColor_copy(), LodePNG_InfoPng_cleanup(), and LodePNG_InfoRaw_cleanup().
void LodePNG_InfoColor_clearPalette | ( | LodePNG_InfoColor * | info | ) |
Definition at line 2040 of file lodepng.cpp.
References LodePNG_InfoColor::palette, and LodePNG_InfoColor::palettesize.
Referenced by LodePNG_InfoColor_cleanup().
unsigned LodePNG_InfoColor_copy | ( | LodePNG_InfoColor * | dest, |
const LodePNG_InfoColor * | source | ||
) |
Definition at line 2323 of file lodepng.cpp.
References LodePNG_InfoColor_cleanup(), LodePNG_InfoColor::palette, and LodePNG_InfoColor::palettesize.
Referenced by LodePNG_InfoPng_copy(), and LodePNG_InfoRaw_copy().
unsigned LodePNG_InfoColor_getBpp | ( | const LodePNG_InfoColor * | info | ) |
Definition at line 2066 of file lodepng.cpp.
References LodePNG_InfoColor::bitDepth, LodePNG_InfoColor::colorType, and getBpp().
Referenced by filter(), LodePNG_convert(), LodePNG_encode(), and preProcessScanlines().
unsigned LodePNG_InfoColor_getChannels | ( | const LodePNG_InfoColor * | info | ) |
Definition at line 2067 of file lodepng.cpp.
References LodePNG_InfoColor::colorType, and getNumColorChannels().
void LodePNG_InfoColor_init | ( | LodePNG_InfoColor * | info | ) |
Definition at line 2025 of file lodepng.cpp.
References LodePNG_InfoColor::bitDepth, LodePNG_InfoColor::colorType, LodePNG_InfoColor::key_b, LodePNG_InfoColor::key_defined, LodePNG_InfoColor::key_g, LodePNG_InfoColor::key_r, LodePNG_InfoColor::palette, and LodePNG_InfoColor::palettesize.
Referenced by LodePNG_InfoPng_copy(), LodePNG_InfoPng_init(), LodePNG_InfoRaw_copy(), and LodePNG_InfoRaw_init().
unsigned LodePNG_InfoColor_isAlphaType | ( | const LodePNG_InfoColor * | info | ) |
Definition at line 2069 of file lodepng.cpp.
References LodePNG_InfoColor::colorType.
Referenced by LodePNG_convert().
unsigned LodePNG_InfoColor_isGreyscaleType | ( | const LodePNG_InfoColor * | info | ) |
Definition at line 2068 of file lodepng.cpp.
References LodePNG_InfoColor::colorType.
Referenced by LodePNG_convert().
void LodePNG_InfoPng_cleanup | ( | LodePNG_InfoPng * | info | ) |
Definition at line 2284 of file lodepng.cpp.
References LodePNG_InfoPng::color, and LodePNG_InfoColor_cleanup().
Referenced by LodePNG_Encoder_cleanup(), and LodePNG_InfoPng_copy().
unsigned LodePNG_InfoPng_copy | ( | LodePNG_InfoPng * | dest, |
const LodePNG_InfoPng * | source | ||
) |
Definition at line 2296 of file lodepng.cpp.
References LodePNG_InfoPng::color, LodePNG_InfoColor_copy(), LodePNG_InfoColor_init(), and LodePNG_InfoPng_cleanup().
Referenced by LodePNG_Encoder_copy().
void LodePNG_InfoPng_init | ( | LodePNG_InfoPng * | info | ) |
Definition at line 2262 of file lodepng.cpp.
References LodePNG_InfoPng::color, LodePNG_InfoPng::compressionMethod, LodePNG_InfoPng::filterMethod, LodePNG_InfoPng::height, LodePNG_InfoPng::interlaceMethod, LodePNG_InfoColor_init(), and LodePNG_InfoPng::width.
Referenced by LodePNG_Encoder_copy(), and LodePNG_Encoder_init().
void LodePNG_InfoRaw_cleanup | ( | LodePNG_InfoRaw * | info | ) |
Definition at line 2339 of file lodepng.cpp.
References LodePNG_InfoRaw::color, and LodePNG_InfoColor_cleanup().
Referenced by LodePNG_Encoder_cleanup(), and LodePNG_InfoRaw_copy().
unsigned LodePNG_InfoRaw_copy | ( | LodePNG_InfoRaw * | dest, |
const LodePNG_InfoRaw * | source | ||
) |
Definition at line 2344 of file lodepng.cpp.
References LodePNG_InfoRaw::color, LodePNG_InfoColor_copy(), LodePNG_InfoColor_init(), and LodePNG_InfoRaw_cleanup().
Referenced by LodePNG_Encoder_copy().
void LodePNG_InfoRaw_init | ( | LodePNG_InfoRaw * | info | ) |
Definition at line 2334 of file lodepng.cpp.
References LodePNG_InfoRaw::color, and LodePNG_InfoColor_init().
Referenced by LodePNG_Encoder_copy(), and LodePNG_Encoder_init().
unsigned LodePNG_loadFile | ( | unsigned char ** | out, |
size_t * | outsize, | ||
const char * | filename | ||
) |
Definition at line 4110 of file lodepng.cpp.
References portable_fopen().
unsigned LodePNG_saveFile | ( | const unsigned char * | buffer, |
size_t | buffersize, | ||
const char * | filename | ||
) |
Definition at line 4141 of file lodepng.cpp.
References portable_fopen().
Referenced by LodePNG_encode32f(), Image::save(), and ColoredImage::save().
unsigned LodeZlib_compress | ( | unsigned char ** | out, |
size_t * | outsize, | ||
const unsigned char * | in, | ||
size_t | insize, | ||
const LodeZlib_DeflateSettings * | settings | ||
) |
Definition at line 1651 of file lodepng.cpp.
References adler32(), ucvector::data, LodeFlate_deflate(), LodeZlib_add32bitInt(), ucvector::size, ucvector_cleanup(), ucvector_init(), ucvector_init_buffer(), and ucvector_push_back().
Referenced by LodePNG_compress().
void LodeZlib_DeflateSettings_init | ( | LodeZlib_DeflateSettings * | settings | ) |
Definition at line 1697 of file lodepng.cpp.
References LodeZlib_DeflateSettings::btype, LodeZlib_DeflateSettings::useLZ77, and LodeZlib_DeflateSettings::windowSize.
Referenced by LodePNG_EncodeSettings_init().
const LodeZlib_DeflateSettings LodeZlib_defaultDeflateSettings |
Definition at line 1704 of file lodepng.cpp.
Referenced by filter().