Classes | Defines | Typedefs | Functions | Variables
lodepng.cpp File Reference
#include "lodepng.h"
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for lodepng.cpp:

Go to the source code of this file.

Classes

struct  Coin
struct  ColorProfile
struct  ColorTree
struct  Hash
struct  HuffmanTree
struct  ucvector
struct  uivector

Defines

#define CERROR_BREAK(errorvar, code)
#define CERROR_RETURN_ERROR(errorvar, code)
#define CERROR_TRY_RETURN(call)
#define DEFAULT_WINDOWSIZE   2048
#define ERROR_BREAK(code)   CERROR_BREAK(error, code)
#define FIRST_LENGTH_CODE_INDEX   257
#define LAST_LENGTH_CODE_INDEX   285
#define NUM_CODE_LENGTH_CODES   19
#define NUM_DEFLATE_CODE_SYMBOLS   288
#define NUM_DISTANCE_SYMBOLS   32
#define READBIT(bitpointer, bitstream)   ((bitstream[bitpointer >> 3] >> (bitpointer & 0x7)) & (unsigned char)1)
#define VERSION_STRING   "20130805"

Typedefs

typedef struct Coin Coin
typedef struct ColorProfile ColorProfile
typedef struct ColorTree ColorTree
typedef struct Hash Hash
typedef struct HuffmanTree HuffmanTree
typedef struct ucvector ucvector
typedef struct uivector uivector

Functions

static void Adam7_deinterlace (unsigned char *out, const unsigned char *in, unsigned w, unsigned h, unsigned bpp)
static void Adam7_getpassvalues (unsigned passw[7], unsigned passh[7], size_t filter_passstart[8], size_t padded_passstart[8], size_t passstart[8], unsigned w, unsigned h, unsigned bpp)
static void Adam7_interlace (unsigned char *out, const unsigned char *in, unsigned w, unsigned h, unsigned bpp)
static void add_coins (Coin *c1, const Coin *c2)
static void addBitsToStream (size_t *bitpointer, ucvector *bitstream, unsigned value, size_t nbits)
static void addBitsToStreamReversed (size_t *bitpointer, ucvector *bitstream, unsigned value, size_t nbits)
static void addBitToStream (size_t *bitpointer, ucvector *bitstream, unsigned char bit)
static unsigned addChunk (ucvector *out, const char *chunkName, const unsigned char *data, size_t length)
static unsigned addChunk_bKGD (ucvector *out, const LodePNGInfo *info)
static unsigned addChunk_IDAT (ucvector *out, const unsigned char *data, size_t datasize, LodePNGCompressSettings *zlibsettings)
static unsigned addChunk_IEND (ucvector *out)
static unsigned addChunk_IHDR (ucvector *out, unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth, unsigned interlace_method)
static unsigned addChunk_iTXt (ucvector *out, unsigned compressed, const char *keyword, const char *langtag, const char *transkey, const char *textstring, LodePNGCompressSettings *zlibsettings)
static unsigned addChunk_pHYs (ucvector *out, const LodePNGInfo *info)
static unsigned addChunk_PLTE (ucvector *out, const LodePNGColorMode *info)
static unsigned addChunk_tEXt (ucvector *out, const char *keyword, const char *textstring)
static unsigned addChunk_tIME (ucvector *out, const LodePNGTime *time)
static unsigned addChunk_tRNS (ucvector *out, const LodePNGColorMode *info)
static unsigned addChunk_zTXt (ucvector *out, const char *keyword, const char *textstring, LodePNGCompressSettings *zlibsettings)
static void addColorBits (unsigned char *out, size_t index, unsigned bits, unsigned in)
static void addHuffmanSymbol (size_t *bp, ucvector *compressed, unsigned code, unsigned bitlen)
static void addLengthDistance (uivector *values, size_t length, size_t distance)
static void addPaddingBits (unsigned char *out, const unsigned char *in, size_t olinebits, size_t ilinebits, unsigned h)
static unsigned addUnknownChunks (ucvector *out, unsigned char *data, size_t datasize)
static unsigned adler32 (const unsigned char *data, unsigned len)
static unsigned append_symbol_coins (Coin *coins, const unsigned *frequencies, unsigned numcodes, size_t sum)
static unsigned checkColorValidity (LodePNGColorType colortype, unsigned bd)
static void cleanup_coins (Coin *coins, size_t num)
static void coin_cleanup (void *c)
static void coin_copy (Coin *c1, const Coin *c2)
static void coin_init (Coin *c)
static void color_profile_cleanup (ColorProfile *profile)
static void color_profile_init (ColorProfile *profile, LodePNGColorMode *mode)
static void color_tree_add (ColorTree *tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a, int index)
static void color_tree_cleanup (ColorTree *tree)
static int color_tree_get (ColorTree *tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
static int color_tree_has (ColorTree *tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
static void color_tree_init (ColorTree *tree)
static unsigned countZeros (const unsigned char *data, size_t size, size_t pos)
static void decodeGeneric (unsigned char **out, unsigned *w, unsigned *h, LodePNGState *state, const unsigned char *in, size_t insize)
static unsigned deflate (unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGCompressSettings *settings)
static unsigned deflateDynamic (ucvector *out, size_t *bp, Hash *hash, const unsigned char *data, size_t datapos, size_t dataend, const LodePNGCompressSettings *settings, int final)
static unsigned deflateFixed (ucvector *out, size_t *bp, Hash *hash, const unsigned char *data, size_t datapos, size_t dataend, const LodePNGCompressSettings *settings, int final)
static unsigned deflateNoCompression (ucvector *out, const unsigned char *data, size_t datasize)
static unsigned doAutoChooseColor (LodePNGColorMode *mode_out, const unsigned char *image, unsigned w, unsigned h, LodePNGColorMode *mode_in, LodePNGAutoConvert auto_convert)
static unsigned encodeLZ77 (uivector *out, Hash *hash, const unsigned char *in, size_t inpos, size_t insize, unsigned windowsize, unsigned minmatch, unsigned nicematch, unsigned lazymatching)
static unsigned filter (unsigned char *out, const unsigned char *in, unsigned w, unsigned h, const LodePNGColorMode *info, const LodePNGEncoderSettings *settings)
static void filterScanline (unsigned char *out, const unsigned char *scanline, const unsigned char *prevline, size_t length, size_t bytewidth, unsigned char filterType)
static float flog2 (float f)
static unsigned generateFixedDistanceTree (HuffmanTree *tree)
static unsigned generateFixedLitLenTree (HuffmanTree *tree)
static unsigned get_color_profile (ColorProfile *profile, const unsigned char *in, size_t numpixels, LodePNGColorMode *mode, unsigned fix_png)
static unsigned getHash (const unsigned char *data, size_t size, size_t pos)
static unsigned getNumColorChannels (LodePNGColorType colortype)
static unsigned getPaletteTranslucency (const unsigned char *palette, size_t palettesize)
static unsigned getPixelColorRGBA16 (unsigned short *r, unsigned short *g, unsigned short *b, unsigned short *a, const unsigned char *in, size_t i, const LodePNGColorMode *mode)
static unsigned getPixelColorRGBA8 (unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a, const unsigned char *in, size_t i, const LodePNGColorMode *mode, unsigned fix_png)
static unsigned getPixelColorsRGBA8 (unsigned char *buffer, size_t numpixels, unsigned has_alpha, const unsigned char *in, const LodePNGColorMode *mode, unsigned fix_png)
static unsigned getTreeInflateDynamic (HuffmanTree *tree_ll, HuffmanTree *tree_d, const unsigned char *in, size_t *bp, size_t inlength)
static void getTreeInflateFixed (HuffmanTree *tree_ll, HuffmanTree *tree_d)
unsigned getValueRequiredBits (unsigned short value)
static void hash_cleanup (Hash *hash)
static unsigned hash_init (Hash *hash, unsigned windowsize)
static unsigned huffmanDecodeSymbol (const unsigned char *in, size_t *bp, const HuffmanTree *codetree, size_t inbitlength)
static void HuffmanTree_cleanup (HuffmanTree *tree)
static unsigned HuffmanTree_getCode (const HuffmanTree *tree, unsigned index)
static unsigned HuffmanTree_getLength (const HuffmanTree *tree, unsigned index)
static void HuffmanTree_init (HuffmanTree *tree)
static unsigned HuffmanTree_make2DTree (HuffmanTree *tree)
static unsigned HuffmanTree_makeFromFrequencies (HuffmanTree *tree, const unsigned *frequencies, size_t mincodes, size_t numcodes, unsigned maxbitlen)
static unsigned HuffmanTree_makeFromLengths (HuffmanTree *tree, const unsigned *bitlen, size_t numcodes, unsigned maxbitlen)
static unsigned HuffmanTree_makeFromLengths2 (HuffmanTree *tree)
static unsigned inflate (unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGDecompressSettings *settings)
static unsigned inflateHuffmanBlock (ucvector *out, const unsigned char *in, size_t *bp, size_t *pos, size_t inlength, unsigned btype)
static unsigned inflateNoCompression (ucvector *out, const unsigned char *in, size_t *bp, size_t *pos, size_t inlength)
static void init_coins (Coin *coins, size_t num)
static void lodepng_add32bitInt (ucvector *buffer, unsigned value)
unsigned lodepng_add_itext (LodePNGInfo *info, const char *key, const char *langtag, const char *transkey, const char *str)
unsigned lodepng_add_text (LodePNGInfo *info, const char *key, const char *str)
unsigned lodepng_can_have_alpha (const LodePNGColorMode *info)
unsigned char lodepng_chunk_ancillary (const unsigned char *chunk)
unsigned lodepng_chunk_append (unsigned char **out, size_t *outlength, const unsigned char *chunk)
unsigned lodepng_chunk_check_crc (const unsigned char *chunk)
unsigned lodepng_chunk_create (unsigned char **out, size_t *outlength, unsigned length, const char *type, const unsigned char *data)
unsigned char * lodepng_chunk_data (unsigned char *chunk)
const unsigned char * lodepng_chunk_data_const (const unsigned char *chunk)
void lodepng_chunk_generate_crc (unsigned char *chunk)
unsigned lodepng_chunk_length (const unsigned char *chunk)
unsigned char * lodepng_chunk_next (unsigned char *chunk)
const unsigned char * lodepng_chunk_next_const (const unsigned char *chunk)
unsigned char lodepng_chunk_private (const unsigned char *chunk)
unsigned char lodepng_chunk_safetocopy (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)
void lodepng_clear_itext (LodePNGInfo *info)
void lodepng_clear_text (LodePNGInfo *info)
void lodepng_color_mode_cleanup (LodePNGColorMode *info)
unsigned lodepng_color_mode_copy (LodePNGColorMode *dest, const LodePNGColorMode *source)
static int lodepng_color_mode_equal (const LodePNGColorMode *a, const LodePNGColorMode *b)
void lodepng_color_mode_init (LodePNGColorMode *info)
void lodepng_compress_settings_init (LodePNGCompressSettings *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 lodepng_crc32 (const unsigned char *buf, size_t len)
unsigned lodepng_decode (unsigned char **out, unsigned *w, unsigned *h, LodePNGState *state, const unsigned char *in, size_t insize)
unsigned lodepng_decode24 (unsigned char **out, unsigned *w, unsigned *h, const unsigned char *in, size_t insize)
unsigned lodepng_decode24_file (unsigned char **out, unsigned *w, unsigned *h, const char *filename)
unsigned lodepng_decode32 (unsigned char **out, unsigned *w, unsigned *h, const unsigned char *in, size_t insize)
unsigned lodepng_decode32_file (unsigned char **out, unsigned *w, unsigned *h, const char *filename)
unsigned lodepng_decode_file (unsigned char **out, unsigned *w, unsigned *h, const char *filename, LodePNGColorType colortype, unsigned bitdepth)
unsigned lodepng_decode_memory (unsigned char **out, unsigned *w, unsigned *h, const unsigned char *in, size_t insize, LodePNGColorType colortype, unsigned bitdepth)
void lodepng_decoder_settings_init (LodePNGDecoderSettings *settings)
void lodepng_decompress_settings_init (LodePNGDecompressSettings *settings)
unsigned lodepng_deflate (unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGCompressSettings *settings)
static unsigned lodepng_deflatev (ucvector *out, const unsigned char *in, size_t insize, const LodePNGCompressSettings *settings)
unsigned lodepng_encode (unsigned char **out, size_t *outsize, const unsigned char *image, unsigned w, unsigned h, LodePNGState *state)
unsigned lodepng_encode24 (unsigned char **out, size_t *outsize, const unsigned char *image, unsigned w, unsigned h)
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_encode32_file (const char *filename, const unsigned char *image, unsigned w, unsigned h)
unsigned lodepng_encode_file (const char *filename, const unsigned char *image, unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth)
unsigned lodepng_encode_memory (unsigned char **out, size_t *outsize, const unsigned char *image, unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth)
void lodepng_encoder_settings_init (LodePNGEncoderSettings *settings)
const char * lodepng_error_text (unsigned code)
static void lodepng_free (void *ptr)
unsigned lodepng_get_bpp (const LodePNGColorMode *info)
static unsigned lodepng_get_bpp_lct (LodePNGColorType colortype, unsigned bitdepth)
unsigned lodepng_get_channels (const LodePNGColorMode *info)
size_t lodepng_get_raw_size (unsigned w, unsigned h, const LodePNGColorMode *color)
size_t lodepng_get_raw_size_lct (unsigned w, unsigned h, LodePNGColorType colortype, unsigned bitdepth)
unsigned lodepng_has_palette_alpha (const LodePNGColorMode *info)
unsigned lodepng_huffman_code_lengths (unsigned *lengths, const unsigned *frequencies, size_t numcodes, unsigned maxbitlen)
unsigned lodepng_inflate (unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGDecompressSettings *settings)
static unsigned lodepng_inflatev (ucvector *out, const unsigned char *in, size_t insize, const LodePNGDecompressSettings *settings)
void lodepng_info_cleanup (LodePNGInfo *info)
unsigned lodepng_info_copy (LodePNGInfo *dest, const LodePNGInfo *source)
void lodepng_info_init (LodePNGInfo *info)
void lodepng_info_swap (LodePNGInfo *a, LodePNGInfo *b)
unsigned lodepng_inspect (unsigned *w, unsigned *h, LodePNGState *state, const unsigned char *in, size_t insize)
unsigned lodepng_is_alpha_type (const LodePNGColorMode *info)
unsigned lodepng_is_greyscale_type (const LodePNGColorMode *info)
unsigned lodepng_is_palette_type (const LodePNGColorMode *info)
unsigned lodepng_load_file (unsigned char **out, size_t *outsize, const char *filename)
static void * lodepng_malloc (size_t size)
unsigned lodepng_palette_add (LodePNGColorMode *info, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
void lodepng_palette_clear (LodePNGColorMode *info)
unsigned lodepng_read32bitInt (const unsigned char *buffer)
static void * lodepng_realloc (void *ptr, size_t new_size)
unsigned lodepng_save_file (const unsigned char *buffer, size_t buffersize, const char *filename)
static void lodepng_set32bitInt (unsigned char *buffer, unsigned value)
void lodepng_state_cleanup (LodePNGState *state)
void lodepng_state_copy (LodePNGState *dest, const LodePNGState *source)
void lodepng_state_init (LodePNGState *state)
unsigned lodepng_zlib_compress (unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGCompressSettings *settings)
unsigned lodepng_zlib_decompress (unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGDecompressSettings *settings)
static void LodePNGIText_cleanup (LodePNGInfo *info)
static unsigned LodePNGIText_copy (LodePNGInfo *dest, const LodePNGInfo *source)
static void LodePNGIText_init (LodePNGInfo *info)
static void LodePNGText_cleanup (LodePNGInfo *info)
static unsigned LodePNGText_copy (LodePNGInfo *dest, const LodePNGInfo *source)
static void LodePNGText_init (LodePNGInfo *info)
static void LodePNGUnknownChunks_cleanup (LodePNGInfo *info)
static unsigned LodePNGUnknownChunks_copy (LodePNGInfo *dest, const LodePNGInfo *src)
static void LodePNGUnknownChunks_init (LodePNGInfo *info)
static unsigned char paethPredictor (short a, short b, short c)
static unsigned postProcessScanlines (unsigned char *out, unsigned char *in, unsigned w, unsigned h, const LodePNGInfo *info_png)
static unsigned preProcessScanlines (unsigned char **out, size_t *outsize, const unsigned char *in, unsigned w, unsigned h, const LodePNGInfo *info_png, const LodePNGEncoderSettings *settings)
static unsigned char readBitFromReversedStream (size_t *bitpointer, const unsigned char *bitstream)
static unsigned char readBitFromStream (size_t *bitpointer, const unsigned char *bitstream)
static unsigned readBitsFromReversedStream (size_t *bitpointer, const unsigned char *bitstream, size_t nbits)
static unsigned readBitsFromStream (size_t *bitpointer, const unsigned char *bitstream, size_t nbits)
static unsigned readChunk_bKGD (LodePNGInfo *info, const unsigned char *data, size_t chunkLength)
static unsigned readChunk_iTXt (LodePNGInfo *info, const LodePNGDecompressSettings *zlibsettings, const unsigned char *data, size_t chunkLength)
static unsigned readChunk_pHYs (LodePNGInfo *info, const unsigned char *data, size_t chunkLength)
static unsigned readChunk_PLTE (LodePNGColorMode *color, const unsigned char *data, size_t chunkLength)
static unsigned readChunk_tEXt (LodePNGInfo *info, const unsigned char *data, size_t chunkLength)
static unsigned readChunk_tIME (LodePNGInfo *info, const unsigned char *data, size_t chunkLength)
static unsigned readChunk_tRNS (LodePNGColorMode *color, const unsigned char *data, size_t chunkLength)
static unsigned readChunk_zTXt (LodePNGInfo *info, const LodePNGDecompressSettings *zlibsettings, const unsigned char *data, size_t chunkLength)
static void removePaddingBits (unsigned char *out, const unsigned char *in, size_t olinebits, size_t ilinebits, unsigned h)
static unsigned rgba16ToPixel (unsigned char *out, size_t i, const LodePNGColorMode *mode, unsigned short r, unsigned short g, unsigned short b, unsigned short a)
static unsigned rgba8ToPixel (unsigned char *out, size_t i, const LodePNGColorMode *mode, ColorTree *tree, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
static size_t searchCodeIndex (const unsigned *array, size_t array_size, size_t value)
static void setBitOfReversedStream (size_t *bitpointer, unsigned char *bitstream, unsigned char bit)
static void setBitOfReversedStream0 (size_t *bitpointer, unsigned char *bitstream, unsigned char bit)
static void setColorKeyFrom16bit (LodePNGColorMode *mode_out, unsigned r, unsigned g, unsigned b, unsigned bitdepth)
static void sort_coins (Coin *data, size_t amount)
static void string_cleanup (char **out)
static void string_init (char **out)
static unsigned string_resize (char **out, size_t size)
static void string_set (char **out, const char *in)
static void ucvector_cleanup (void *p)
static void ucvector_init (ucvector *p)
static void ucvector_init_buffer (ucvector *p, unsigned char *buffer, size_t size)
static unsigned ucvector_push_back (ucvector *p, unsigned char c)
static unsigned ucvector_resize (ucvector *p, size_t size)
static unsigned ucvector_resizev (ucvector *p, size_t size, unsigned char value)
static void uivector_cleanup (void *p)
static unsigned uivector_copy (uivector *p, const uivector *q)
static void uivector_init (uivector *p)
static unsigned uivector_push_back (uivector *p, unsigned c)
static unsigned uivector_resize (uivector *p, size_t size)
static unsigned uivector_resizev (uivector *p, size_t size, unsigned value)
static void uivector_swap (uivector *p, uivector *q)
static unsigned unfilter (unsigned char *out, const unsigned char *in, unsigned w, unsigned h, unsigned bpp)
static unsigned unfilterScanline (unsigned char *recon, const unsigned char *scanline, const unsigned char *precon, size_t bytewidth, unsigned char filterType, size_t length)
static unsigned update_adler32 (unsigned adler, const unsigned char *data, unsigned len)
static void updateHashChain (Hash *hash, size_t pos, int hashval, unsigned windowsize)
static void writeLZ77data (size_t *bp, ucvector *out, const uivector *lz77_encoded, const HuffmanTree *tree_ll, const HuffmanTree *tree_d)
static void writeSignature (ucvector *out)
static unsigned zlib_compress (unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGCompressSettings *settings)
static unsigned zlib_decompress (unsigned char **out, size_t *outsize, const unsigned char *in, size_t insize, const LodePNGDecompressSettings *settings)

Variables

static const unsigned ADAM7_DX [7] = { 8, 8, 4, 4, 2, 2, 1 }
static const unsigned ADAM7_DY [7] = { 8, 8, 8, 4, 4, 2, 2 }
static const unsigned ADAM7_IX [7] = { 0, 4, 0, 2, 0, 1, 0 }
static const unsigned ADAM7_IY [7] = { 0, 0, 4, 0, 2, 0, 1 }
static const unsigned CLCL_ORDER [NUM_CODE_LENGTH_CODES] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}
static const unsigned DISTANCEBASE [30]
static const unsigned DISTANCEEXTRA [30]
static const unsigned HASH_NUM_CHARACTERS = 3
static const unsigned HASH_NUM_VALUES = 65536
static const unsigned HASH_SHIFT = 2
static const unsigned LENGTHBASE [29]
static const unsigned LENGTHEXTRA [29]
static unsigned lodepng_crc32_table [256]
const LodePNGCompressSettings lodepng_default_compress_settings = {2, 1, DEFAULT_WINDOWSIZE, 3, 128, 1, 0, 0, 0}
const LodePNGDecompressSettings lodepng_default_decompress_settings = {0, 0, 0, 0}
static const size_t MAX_SUPPORTED_DEFLATE_LENGTH = 258

Define Documentation

#define CERROR_BREAK (   errorvar,
  code 
)
Value:
{\
  errorvar = code;\
  break;\
}

Definition at line 94 of file lodepng.cpp.

#define CERROR_RETURN_ERROR (   errorvar,
  code 
)
Value:
{\
  errorvar = code;\
  return code;\
}

Definition at line 104 of file lodepng.cpp.

#define CERROR_TRY_RETURN (   call)
Value:
{\
  unsigned error = call;\
  if(error) return error;\
}

Definition at line 111 of file lodepng.cpp.

#define DEFAULT_WINDOWSIZE   2048

Definition at line 2221 of file lodepng.cpp.

#define ERROR_BREAK (   code)    CERROR_BREAK(error, code)

Definition at line 101 of file lodepng.cpp.

#define FIRST_LENGTH_CODE_INDEX   257

Definition at line 456 of file lodepng.cpp.

#define LAST_LENGTH_CODE_INDEX   285

Definition at line 457 of file lodepng.cpp.

#define NUM_CODE_LENGTH_CODES   19

Definition at line 463 of file lodepng.cpp.

#define NUM_DEFLATE_CODE_SYMBOLS   288

Definition at line 459 of file lodepng.cpp.

#define NUM_DISTANCE_SYMBOLS   32

Definition at line 461 of file lodepng.cpp.

#define READBIT (   bitpointer,
  bitstream 
)    ((bitstream[bitpointer >> 3] >> (bitpointer & 0x7)) & (unsigned char)1)

Definition at line 431 of file lodepng.cpp.

#define VERSION_STRING   "20130805"

Definition at line 40 of file lodepng.cpp.


Typedef Documentation

typedef struct Coin Coin
typedef struct ColorProfile ColorProfile
typedef struct ColorTree ColorTree

Definition at line 2911 of file lodepng.cpp.

typedef struct Hash Hash
typedef struct HuffmanTree HuffmanTree
typedef struct ucvector ucvector
typedef struct uivector uivector

Function Documentation

static void Adam7_deinterlace ( unsigned char *  out,
const unsigned char *  in,
unsigned  w,
unsigned  h,
unsigned  bpp 
) [static]

Definition at line 4126 of file lodepng.cpp.

static void Adam7_getpassvalues ( unsigned  passw[7],
unsigned  passh[7],
size_t  filter_passstart[8],
size_t  padded_passstart[8],
size_t  passstart[8],
unsigned  w,
unsigned  h,
unsigned  bpp 
) [static]

Definition at line 3918 of file lodepng.cpp.

static void Adam7_interlace ( unsigned char *  out,
const unsigned char *  in,
unsigned  w,
unsigned  h,
unsigned  bpp 
) [static]

Definition at line 5488 of file lodepng.cpp.

static void add_coins ( Coin c1,
const Coin c2 
) [static]

Definition at line 682 of file lodepng.cpp.

static void addBitsToStream ( size_t *  bitpointer,
ucvector bitstream,
unsigned  value,
size_t  nbits 
) [static]

Definition at line 416 of file lodepng.cpp.

static void addBitsToStreamReversed ( size_t *  bitpointer,
ucvector bitstream,
unsigned  value,
size_t  nbits 
) [static]

Definition at line 422 of file lodepng.cpp.

static void addBitToStream ( size_t *  bitpointer,
ucvector bitstream,
unsigned char  bit 
) [static]

Definition at line 407 of file lodepng.cpp.

static unsigned addChunk ( ucvector out,
const char *  chunkName,
const unsigned char *  data,
size_t  length 
) [static]

Definition at line 4886 of file lodepng.cpp.

static unsigned addChunk_bKGD ( ucvector out,
const LodePNGInfo info 
) [static]

Definition at line 5097 of file lodepng.cpp.

static unsigned addChunk_IDAT ( ucvector out,
const unsigned char *  data,
size_t  datasize,
LodePNGCompressSettings zlibsettings 
) [static]

Definition at line 4989 of file lodepng.cpp.

static unsigned addChunk_IEND ( ucvector out) [static]

Definition at line 5004 of file lodepng.cpp.

static unsigned addChunk_IHDR ( ucvector out,
unsigned  w,
unsigned  h,
LodePNGColorType  colortype,
unsigned  bitdepth,
unsigned  interlace_method 
) [static]

Definition at line 4906 of file lodepng.cpp.

static unsigned addChunk_iTXt ( ucvector out,
unsigned  compressed,
const char *  keyword,
const char *  langtag,
const char *  transkey,
const char *  textstring,
LodePNGCompressSettings zlibsettings 
) [static]

Definition at line 5056 of file lodepng.cpp.

static unsigned addChunk_pHYs ( ucvector out,
const LodePNGInfo info 
) [static]

Definition at line 5144 of file lodepng.cpp.

static unsigned addChunk_PLTE ( ucvector out,
const LodePNGColorMode info 
) [static]

Definition at line 4927 of file lodepng.cpp.

static unsigned addChunk_tEXt ( ucvector out,
const char *  keyword,
const char *  textstring 
) [static]

Definition at line 5013 of file lodepng.cpp.

static unsigned addChunk_tIME ( ucvector out,
const LodePNGTime time 
) [static]

Definition at line 5127 of file lodepng.cpp.

static unsigned addChunk_tRNS ( ucvector out,
const LodePNGColorMode info 
) [static]

Definition at line 4944 of file lodepng.cpp.

static unsigned addChunk_zTXt ( ucvector out,
const char *  keyword,
const char *  textstring,
LodePNGCompressSettings zlibsettings 
) [static]

Definition at line 5029 of file lodepng.cpp.

static void addColorBits ( unsigned char *  out,
size_t  index,
unsigned  bits,
unsigned  in 
) [static]

Definition at line 2901 of file lodepng.cpp.

static void addHuffmanSymbol ( size_t *  bp,
ucvector compressed,
unsigned  code,
unsigned  bitlen 
) [static]

Definition at line 1314 of file lodepng.cpp.

static void addLengthDistance ( uivector values,
size_t  length,
size_t  distance 
) [static]

Definition at line 1340 of file lodepng.cpp.

static void addPaddingBits ( unsigned char *  out,
const unsigned char *  in,
size_t  olinebits,
size_t  ilinebits,
unsigned  h 
) [static]

Definition at line 5455 of file lodepng.cpp.

static unsigned addUnknownChunks ( ucvector out,
unsigned char *  data,
size_t  datasize 
) [static]

Definition at line 5652 of file lodepng.cpp.

static unsigned adler32 ( const unsigned char *  data,
unsigned  len 
) [static]

Definition at line 2068 of file lodepng.cpp.

static unsigned append_symbol_coins ( Coin coins,
const unsigned *  frequencies,
unsigned  numcodes,
size_t  sum 
) [static]

Definition at line 729 of file lodepng.cpp.

static unsigned checkColorValidity ( LodePNGColorType  colortype,
unsigned  bd 
) [static]

Definition at line 2493 of file lodepng.cpp.

static void cleanup_coins ( Coin coins,
size_t  num 
) [static]

Definition at line 695 of file lodepng.cpp.

static void coin_cleanup ( void *  c) [static]

Definition at line 671 of file lodepng.cpp.

static void coin_copy ( Coin c1,
const Coin c2 
) [static]

Definition at line 676 of file lodepng.cpp.

static void coin_init ( Coin c) [static]

Definition at line 665 of file lodepng.cpp.

static void color_profile_cleanup ( ColorProfile profile) [static]

Definition at line 3519 of file lodepng.cpp.

static void color_profile_init ( ColorProfile profile,
LodePNGColorMode mode 
) [static]

Definition at line 3492 of file lodepng.cpp.

static void color_tree_add ( ColorTree tree,
unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a,
int  index 
) [static]

Definition at line 2967 of file lodepng.cpp.

static void color_tree_cleanup ( ColorTree tree) [static]

Definition at line 2932 of file lodepng.cpp.

static int color_tree_get ( ColorTree tree,
unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
) [static]

Definition at line 2946 of file lodepng.cpp.

static int color_tree_has ( ColorTree tree,
unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
) [static]

Definition at line 2959 of file lodepng.cpp.

static void color_tree_init ( ColorTree tree) [static]

Definition at line 2925 of file lodepng.cpp.

static unsigned countZeros ( const unsigned char *  data,
size_t  size,
size_t  pos 
) [static]

Definition at line 1422 of file lodepng.cpp.

static void decodeGeneric ( unsigned char **  out,
unsigned *  w,
unsigned *  h,
LodePNGState state,
const unsigned char *  in,
size_t  insize 
) [static]

Definition at line 4564 of file lodepng.cpp.

static unsigned deflate ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  in,
size_t  insize,
const LodePNGCompressSettings settings 
) [static]

Definition at line 2024 of file lodepng.cpp.

static unsigned deflateDynamic ( ucvector out,
size_t *  bp,
Hash hash,
const unsigned char *  data,
size_t  datapos,
size_t  dataend,
const LodePNGCompressSettings settings,
int  final 
) [static]

Definition at line 1679 of file lodepng.cpp.

static unsigned deflateFixed ( ucvector out,
size_t *  bp,
Hash hash,
const unsigned char *  data,
size_t  datapos,
size_t  dataend,
const LodePNGCompressSettings settings,
int  final 
) [static]

Definition at line 1924 of file lodepng.cpp.

static unsigned deflateNoCompression ( ucvector out,
const unsigned char *  data,
size_t  datasize 
) [static]

Definition at line 1608 of file lodepng.cpp.

static unsigned doAutoChooseColor ( LodePNGColorMode mode_out,
const unsigned char *  image,
unsigned  w,
unsigned  h,
LodePNGColorMode mode_in,
LodePNGAutoConvert  auto_convert 
) [static]

Definition at line 3760 of file lodepng.cpp.

static unsigned encodeLZ77 ( uivector out,
Hash hash,
const unsigned char *  in,
size_t  inpos,
size_t  insize,
unsigned  windowsize,
unsigned  minmatch,
unsigned  nicematch,
unsigned  lazymatching 
) [static]

encode it as length/distance pair or literal value

Definition at line 1450 of file lodepng.cpp.

static unsigned filter ( unsigned char *  out,
const unsigned char *  in,
unsigned  w,
unsigned  h,
const LodePNGColorMode info,
const LodePNGEncoderSettings settings 
) [static]

Definition at line 5235 of file lodepng.cpp.

static void filterScanline ( unsigned char *  out,
const unsigned char *  scanline,
const unsigned char *  prevline,
size_t  length,
size_t  bytewidth,
unsigned char  filterType 
) [static]

Definition at line 5162 of file lodepng.cpp.

static float flog2 ( float  f) [static]

Definition at line 5227 of file lodepng.cpp.

static unsigned generateFixedDistanceTree ( HuffmanTree tree) [static]

Definition at line 908 of file lodepng.cpp.

static unsigned generateFixedLitLenTree ( HuffmanTree tree) [static]

Definition at line 889 of file lodepng.cpp.

static unsigned get_color_profile ( ColorProfile profile,
const unsigned char *  in,
size_t  numpixels,
LodePNGColorMode mode,
unsigned  fix_png 
) [static]

Definition at line 3556 of file lodepng.cpp.

static unsigned getHash ( const unsigned char *  data,
size_t  size,
size_t  pos 
) [static]

Definition at line 1411 of file lodepng.cpp.

static unsigned getNumColorChannels ( LodePNGColorType  colortype) [static]

Definition at line 2507 of file lodepng.cpp.

static unsigned getPaletteTranslucency ( const unsigned char *  palette,
size_t  palettesize 
) [static]

Definition at line 5632 of file lodepng.cpp.

static unsigned getPixelColorRGBA16 ( unsigned short *  r,
unsigned short *  g,
unsigned short *  b,
unsigned short *  a,
const unsigned char *  in,
size_t  i,
const LodePNGColorMode mode 
) [static]

Definition at line 3353 of file lodepng.cpp.

static unsigned getPixelColorRGBA8 ( unsigned char *  r,
unsigned char *  g,
unsigned char *  b,
unsigned char *  a,
const unsigned char *  in,
size_t  i,
const LodePNGColorMode mode,
unsigned  fix_png 
) [static]

Definition at line 3103 of file lodepng.cpp.

static unsigned getPixelColorsRGBA8 ( unsigned char *  buffer,
size_t  numpixels,
unsigned  has_alpha,
const unsigned char *  in,
const LodePNGColorMode mode,
unsigned  fix_png 
) [static]

Definition at line 3216 of file lodepng.cpp.

static unsigned getTreeInflateDynamic ( HuffmanTree tree_ll,
HuffmanTree tree_d,
const unsigned char *  in,
size_t *  bp,
size_t  inlength 
) [static]

Definition at line 964 of file lodepng.cpp.

static void getTreeInflateFixed ( HuffmanTree tree_ll,
HuffmanTree tree_d 
) [static]

Definition at line 956 of file lodepng.cpp.

unsigned getValueRequiredBits ( unsigned short  value)

Definition at line 3546 of file lodepng.cpp.

static void hash_cleanup ( Hash hash) [static]

Definition at line 1403 of file lodepng.cpp.

static unsigned hash_init ( Hash hash,
unsigned  windowsize 
) [static]

Definition at line 1385 of file lodepng.cpp.

static unsigned huffmanDecodeSymbol ( const unsigned char *  in,
size_t *  bp,
const HuffmanTree codetree,
size_t  inbitlength 
) [static]

Definition at line 928 of file lodepng.cpp.

static void HuffmanTree_cleanup ( HuffmanTree tree) [static]

Definition at line 524 of file lodepng.cpp.

static unsigned HuffmanTree_getCode ( const HuffmanTree tree,
unsigned  index 
) [static]

Definition at line 877 of file lodepng.cpp.

static unsigned HuffmanTree_getLength ( const HuffmanTree tree,
unsigned  index 
) [static]

Definition at line 882 of file lodepng.cpp.

static void HuffmanTree_init ( HuffmanTree tree) [static]

Definition at line 517 of file lodepng.cpp.

static unsigned HuffmanTree_make2DTree ( HuffmanTree tree) [static]

Definition at line 532 of file lodepng.cpp.

static unsigned HuffmanTree_makeFromFrequencies ( HuffmanTree tree,
const unsigned *  frequencies,
size_t  mincodes,
size_t  numcodes,
unsigned  maxbitlen 
) [static]

Definition at line 860 of file lodepng.cpp.

static unsigned HuffmanTree_makeFromLengths ( HuffmanTree tree,
const unsigned *  bitlen,
size_t  numcodes,
unsigned  maxbitlen 
) [static]

Definition at line 640 of file lodepng.cpp.

static unsigned HuffmanTree_makeFromLengths2 ( HuffmanTree tree) [static]

Definition at line 596 of file lodepng.cpp.

static unsigned inflate ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  in,
size_t  insize,
const LodePNGDecompressSettings settings 
) [static]

Definition at line 1289 of file lodepng.cpp.

static unsigned inflateHuffmanBlock ( ucvector out,
const unsigned char *  in,
size_t *  bp,
size_t *  pos,
size_t  inlength,
unsigned  btype 
) [static]

Definition at line 1112 of file lodepng.cpp.

static unsigned inflateNoCompression ( ucvector out,
const unsigned char *  in,
size_t *  bp,
size_t *  pos,
size_t  inlength 
) [static]

Definition at line 1212 of file lodepng.cpp.

static void init_coins ( Coin coins,
size_t  num 
) [static]

Definition at line 689 of file lodepng.cpp.

static void lodepng_add32bitInt ( ucvector buffer,
unsigned  value 
) [static]

Definition at line 345 of file lodepng.cpp.

unsigned lodepng_add_itext ( LodePNGInfo info,
const char *  key,
const char *  langtag,
const char *  transkey,
const char *  str 
)

Definition at line 2805 of file lodepng.cpp.

unsigned lodepng_add_text ( LodePNGInfo info,
const char *  key,
const char *  str 
)

Definition at line 2733 of file lodepng.cpp.

unsigned lodepng_can_have_alpha ( const LodePNGColorMode info)

Definition at line 2641 of file lodepng.cpp.

unsigned char lodepng_chunk_ancillary ( const unsigned char *  chunk)

Definition at line 2384 of file lodepng.cpp.

unsigned lodepng_chunk_append ( unsigned char **  out,
size_t *  outlength,
const unsigned char *  chunk 
)

Definition at line 2438 of file lodepng.cpp.

unsigned lodepng_chunk_check_crc ( const unsigned char *  chunk)

Definition at line 2409 of file lodepng.cpp.

unsigned lodepng_chunk_create ( unsigned char **  out,
size_t *  outlength,
unsigned  length,
const char *  type,
const unsigned char *  data 
)

Definition at line 2457 of file lodepng.cpp.

unsigned char* lodepng_chunk_data ( unsigned char *  chunk)

Definition at line 2399 of file lodepng.cpp.

const unsigned char* lodepng_chunk_data_const ( const unsigned char *  chunk)

Definition at line 2404 of file lodepng.cpp.

void lodepng_chunk_generate_crc ( unsigned char *  chunk)

Definition at line 2419 of file lodepng.cpp.

unsigned lodepng_chunk_length ( const unsigned char *  chunk)

Definition at line 2366 of file lodepng.cpp.

unsigned char* lodepng_chunk_next ( unsigned char *  chunk)

Definition at line 2426 of file lodepng.cpp.

const unsigned char* lodepng_chunk_next_const ( const unsigned char *  chunk)

Definition at line 2432 of file lodepng.cpp.

unsigned char lodepng_chunk_private ( const unsigned char *  chunk)

Definition at line 2389 of file lodepng.cpp.

unsigned char lodepng_chunk_safetocopy ( const unsigned char *  chunk)

Definition at line 2394 of file lodepng.cpp.

void lodepng_chunk_type ( char  type[5],
const unsigned char *  chunk 
)

Definition at line 2371 of file lodepng.cpp.

unsigned char lodepng_chunk_type_equals ( const unsigned char *  chunk,
const char *  type 
)

Definition at line 2378 of file lodepng.cpp.

void lodepng_clear_itext ( LodePNGInfo info)

Definition at line 2800 of file lodepng.cpp.

void lodepng_clear_text ( LodePNGInfo info)

Definition at line 2728 of file lodepng.cpp.

Definition at line 2538 of file lodepng.cpp.

unsigned lodepng_color_mode_copy ( LodePNGColorMode dest,
const LodePNGColorMode source 
)

Definition at line 2543 of file lodepng.cpp.

static int lodepng_color_mode_equal ( const LodePNGColorMode a,
const LodePNGColorMode b 
) [static]

Definition at line 2557 of file lodepng.cpp.

Definition at line 2528 of file lodepng.cpp.

Definition at line 2223 of file lodepng.cpp.

unsigned lodepng_convert ( unsigned char *  out,
const unsigned char *  in,
LodePNGColorMode mode_out,
LodePNGColorMode mode_in,
unsigned  w,
unsigned  h,
unsigned  fix_png 
)

Definition at line 3396 of file lodepng.cpp.

unsigned lodepng_crc32 ( const unsigned char *  buf,
size_t  len 
)

Definition at line 2307 of file lodepng.cpp.

unsigned lodepng_decode ( unsigned char **  out,
unsigned *  w,
unsigned *  h,
LodePNGState state,
const unsigned char *  in,
size_t  insize 
)

Definition at line 4741 of file lodepng.cpp.

unsigned lodepng_decode24 ( unsigned char **  out,
unsigned *  w,
unsigned *  h,
const unsigned char *  in,
size_t  insize 
)

Definition at line 4803 of file lodepng.cpp.

unsigned lodepng_decode24_file ( unsigned char **  out,
unsigned *  w,
unsigned *  h,
const char *  filename 
)

Definition at line 4826 of file lodepng.cpp.

unsigned lodepng_decode32 ( unsigned char **  out,
unsigned *  w,
unsigned *  h,
const unsigned char *  in,
size_t  insize 
)

Definition at line 4798 of file lodepng.cpp.

unsigned lodepng_decode32_file ( unsigned char **  out,
unsigned *  w,
unsigned *  h,
const char *  filename 
)

Definition at line 4821 of file lodepng.cpp.

unsigned lodepng_decode_file ( unsigned char **  out,
unsigned *  w,
unsigned *  h,
const char *  filename,
LodePNGColorType  colortype,
unsigned  bitdepth 
)

Definition at line 4809 of file lodepng.cpp.

unsigned lodepng_decode_memory ( unsigned char **  out,
unsigned *  w,
unsigned *  h,
const unsigned char *  in,
size_t  insize,
LodePNGColorType  colortype,
unsigned  bitdepth 
)

Definition at line 4785 of file lodepng.cpp.

Definition at line 4832 of file lodepng.cpp.

Definition at line 2245 of file lodepng.cpp.

unsigned lodepng_deflate ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  in,
size_t  insize,
const LodePNGCompressSettings settings 
)

Definition at line 2011 of file lodepng.cpp.

static unsigned lodepng_deflatev ( ucvector out,
const unsigned char *  in,
size_t  insize,
const LodePNGCompressSettings settings 
) [static]

Definition at line 1972 of file lodepng.cpp.

unsigned lodepng_encode ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  image,
unsigned  w,
unsigned  h,
LodePNGState state 
)

Definition at line 5665 of file lodepng.cpp.

unsigned lodepng_encode24 ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  image,
unsigned  w,
unsigned  h 
)

Definition at line 5879 of file lodepng.cpp.

unsigned lodepng_encode24_file ( const char *  filename,
const unsigned char *  image,
unsigned  w,
unsigned  h 
)

Definition at line 5901 of file lodepng.cpp.

unsigned lodepng_encode32 ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  image,
unsigned  w,
unsigned  h 
)

Definition at line 5874 of file lodepng.cpp.

unsigned lodepng_encode32_file ( const char *  filename,
const unsigned char *  image,
unsigned  w,
unsigned  h 
)

Definition at line 5896 of file lodepng.cpp.

unsigned lodepng_encode_file ( const char *  filename,
const unsigned char *  image,
unsigned  w,
unsigned  h,
LodePNGColorType  colortype,
unsigned  bitdepth 
)

Definition at line 5885 of file lodepng.cpp.

unsigned lodepng_encode_memory ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  image,
unsigned  w,
unsigned  h,
LodePNGColorType  colortype,
unsigned  bitdepth 
)

Definition at line 5858 of file lodepng.cpp.

Definition at line 5907 of file lodepng.cpp.

const char* lodepng_error_text ( unsigned  code)

Definition at line 5929 of file lodepng.cpp.

static void lodepng_free ( void *  ptr) [static]

Definition at line 71 of file lodepng.cpp.

unsigned lodepng_get_bpp ( const LodePNGColorMode info)

Definition at line 2605 of file lodepng.cpp.

static unsigned lodepng_get_bpp_lct ( LodePNGColorType  colortype,
unsigned  bitdepth 
) [static]

Definition at line 2520 of file lodepng.cpp.

unsigned lodepng_get_channels ( const LodePNGColorMode info)

Definition at line 2611 of file lodepng.cpp.

size_t lodepng_get_raw_size ( unsigned  w,
unsigned  h,
const LodePNGColorMode color 
)

Definition at line 2648 of file lodepng.cpp.

size_t lodepng_get_raw_size_lct ( unsigned  w,
unsigned  h,
LodePNGColorType  colortype,
unsigned  bitdepth 
)

Definition at line 2653 of file lodepng.cpp.

unsigned lodepng_has_palette_alpha ( const LodePNGColorMode info)

Definition at line 2631 of file lodepng.cpp.

unsigned lodepng_huffman_code_lengths ( unsigned *  lengths,
const unsigned *  frequencies,
size_t  numcodes,
unsigned  maxbitlen 
)

Definition at line 745 of file lodepng.cpp.

unsigned lodepng_inflate ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  in,
size_t  insize,
const LodePNGDecompressSettings settings 
)

Definition at line 1276 of file lodepng.cpp.

static unsigned lodepng_inflatev ( ucvector out,
const unsigned char *  in,
size_t  insize,
const LodePNGDecompressSettings settings 
) [static]

Definition at line 1242 of file lodepng.cpp.

Definition at line 2863 of file lodepng.cpp.

unsigned lodepng_info_copy ( LodePNGInfo dest,
const LodePNGInfo source 
)

Definition at line 2874 of file lodepng.cpp.

void lodepng_info_init ( LodePNGInfo info)

Definition at line 2843 of file lodepng.cpp.

void lodepng_info_swap ( LodePNGInfo a,
LodePNGInfo b 
)

Definition at line 2891 of file lodepng.cpp.

unsigned lodepng_inspect ( unsigned *  w,
unsigned *  h,
LodePNGState state,
const unsigned char *  in,
size_t  insize 
)

Definition at line 3953 of file lodepng.cpp.

unsigned lodepng_is_alpha_type ( const LodePNGColorMode info)

Definition at line 2621 of file lodepng.cpp.

unsigned lodepng_is_greyscale_type ( const LodePNGColorMode info)

Definition at line 2616 of file lodepng.cpp.

unsigned lodepng_is_palette_type ( const LodePNGColorMode info)

Definition at line 2626 of file lodepng.cpp.

unsigned lodepng_load_file ( unsigned char **  out,
size_t *  outsize,
const char *  filename 
)

Definition at line 358 of file lodepng.cpp.

static void* lodepng_malloc ( size_t  size) [static]

Definition at line 61 of file lodepng.cpp.

unsigned lodepng_palette_add ( LodePNGColorMode info,
unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
)

Definition at line 2584 of file lodepng.cpp.

Definition at line 2577 of file lodepng.cpp.

unsigned lodepng_read32bitInt ( const unsigned char *  buffer)

Definition at line 328 of file lodepng.cpp.

static void* lodepng_realloc ( void *  ptr,
size_t  new_size 
) [static]

Definition at line 66 of file lodepng.cpp.

unsigned lodepng_save_file ( const unsigned char *  buffer,
size_t  buffersize,
const char *  filename 
)

Definition at line 386 of file lodepng.cpp.

static void lodepng_set32bitInt ( unsigned char *  buffer,
unsigned  value 
) [static]

Definition at line 335 of file lodepng.cpp.

Definition at line 4861 of file lodepng.cpp.

void lodepng_state_copy ( LodePNGState dest,
const LodePNGState source 
)

Definition at line 4867 of file lodepng.cpp.

void lodepng_state_init ( LodePNGState state)

Definition at line 4848 of file lodepng.cpp.

unsigned lodepng_zlib_compress ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  in,
size_t  insize,
const LodePNGCompressSettings settings 
)

Definition at line 2137 of file lodepng.cpp.

unsigned lodepng_zlib_decompress ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  in,
size_t  insize,
const LodePNGDecompressSettings settings 
)

Definition at line 2079 of file lodepng.cpp.

static void LodePNGIText_cleanup ( LodePNGInfo info) [static]

Definition at line 2768 of file lodepng.cpp.

static unsigned LodePNGIText_copy ( LodePNGInfo dest,
const LodePNGInfo source 
) [static]

Definition at line 2784 of file lodepng.cpp.

static void LodePNGIText_init ( LodePNGInfo info) [static]

Definition at line 2759 of file lodepng.cpp.

static void LodePNGText_cleanup ( LodePNGInfo info) [static]

Definition at line 2703 of file lodepng.cpp.

static unsigned LodePNGText_copy ( LodePNGInfo dest,
const LodePNGInfo source 
) [static]

Definition at line 2715 of file lodepng.cpp.

static void LodePNGText_init ( LodePNGInfo info) [static]

Definition at line 2696 of file lodepng.cpp.

static void LodePNGUnknownChunks_cleanup ( LodePNGInfo info) [static]

Definition at line 2667 of file lodepng.cpp.

static unsigned LodePNGUnknownChunks_copy ( LodePNGInfo dest,
const LodePNGInfo src 
) [static]

Definition at line 2673 of file lodepng.cpp.

static void LodePNGUnknownChunks_init ( LodePNGInfo info) [static]

Definition at line 2660 of file lodepng.cpp.

static unsigned char paethPredictor ( short  a,
short  b,
short  c 
) [static]

Definition at line 3885 of file lodepng.cpp.

static unsigned postProcessScanlines ( unsigned char *  out,
unsigned char *  in,
unsigned  w,
unsigned  h,
const LodePNGInfo info_png 
) [static]

Definition at line 4206 of file lodepng.cpp.

static unsigned preProcessScanlines ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  in,
unsigned  w,
unsigned  h,
const LodePNGInfo info_png,
const LodePNGEncoderSettings settings 
) [static]

Definition at line 5539 of file lodepng.cpp.

static unsigned char readBitFromReversedStream ( size_t *  bitpointer,
const unsigned char *  bitstream 
) [static]

Definition at line 2323 of file lodepng.cpp.

static unsigned char readBitFromStream ( size_t *  bitpointer,
const unsigned char *  bitstream 
) [static]

Definition at line 433 of file lodepng.cpp.

static unsigned readBitsFromReversedStream ( size_t *  bitpointer,
const unsigned char *  bitstream,
size_t  nbits 
) [static]

Definition at line 2330 of file lodepng.cpp.

static unsigned readBitsFromStream ( size_t *  bitpointer,
const unsigned char *  bitstream,
size_t  nbits 
) [static]

Definition at line 440 of file lodepng.cpp.

static unsigned readChunk_bKGD ( LodePNGInfo info,
const unsigned char *  data,
size_t  chunkLength 
) [static]

Definition at line 4316 of file lodepng.cpp.

static unsigned readChunk_iTXt ( LodePNGInfo info,
const LodePNGDecompressSettings zlibsettings,
const unsigned char *  data,
size_t  chunkLength 
) [static]

Definition at line 4442 of file lodepng.cpp.

static unsigned readChunk_pHYs ( LodePNGInfo info,
const unsigned char *  data,
size_t  chunkLength 
) [static]

Definition at line 4550 of file lodepng.cpp.

static unsigned readChunk_PLTE ( LodePNGColorMode color,
const unsigned char *  data,
size_t  chunkLength 
) [static]

Definition at line 4256 of file lodepng.cpp.

static unsigned readChunk_tEXt ( LodePNGInfo info,
const unsigned char *  data,
size_t  chunkLength 
) [static]

Definition at line 4350 of file lodepng.cpp.

static unsigned readChunk_tIME ( LodePNGInfo info,
const unsigned char *  data,
size_t  chunkLength 
) [static]

Definition at line 4535 of file lodepng.cpp.

static unsigned readChunk_tRNS ( LodePNGColorMode color,
const unsigned char *  data,
size_t  chunkLength 
) [static]

Definition at line 4280 of file lodepng.cpp.

static unsigned readChunk_zTXt ( LodePNGInfo info,
const LodePNGDecompressSettings zlibsettings,
const unsigned char *  data,
size_t  chunkLength 
) [static]

Definition at line 4393 of file lodepng.cpp.

static void removePaddingBits ( unsigned char *  out,
const unsigned char *  in,
size_t  olinebits,
size_t  ilinebits,
unsigned  h 
) [static]

Definition at line 4176 of file lodepng.cpp.

static unsigned rgba16ToPixel ( unsigned char *  out,
size_t  i,
const LodePNGColorMode mode,
unsigned short  r,
unsigned short  g,
unsigned short  b,
unsigned short  a 
) [static]

Definition at line 3059 of file lodepng.cpp.

static unsigned rgba8ToPixel ( unsigned char *  out,
size_t  i,
const LodePNGColorMode mode,
ColorTree tree,
unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a 
) [static]

Definition at line 2985 of file lodepng.cpp.

static size_t searchCodeIndex ( const unsigned *  array,
size_t  array_size,
size_t  value 
) [static]

Definition at line 1321 of file lodepng.cpp.

static void setBitOfReversedStream ( size_t *  bitpointer,
unsigned char *  bitstream,
unsigned char  bit 
) [static]

Definition at line 2354 of file lodepng.cpp.

static void setBitOfReversedStream0 ( size_t *  bitpointer,
unsigned char *  bitstream,
unsigned char  bit 
) [static]

Definition at line 2342 of file lodepng.cpp.

static void setColorKeyFrom16bit ( LodePNGColorMode mode_out,
unsigned  r,
unsigned  g,
unsigned  b,
unsigned  bitdepth 
) [static]

Definition at line 3749 of file lodepng.cpp.

static void sort_coins ( Coin data,
size_t  amount 
) [static]

Definition at line 705 of file lodepng.cpp.

static void string_cleanup ( char **  out) [static]

Definition at line 306 of file lodepng.cpp.

static void string_init ( char **  out) [static]

Definition at line 299 of file lodepng.cpp.

static unsigned string_resize ( char **  out,
size_t  size 
) [static]

Definition at line 287 of file lodepng.cpp.

static void string_set ( char **  out,
const char *  in 
) [static]

Definition at line 312 of file lodepng.cpp.

static void ucvector_cleanup ( void *  p) [static]

Definition at line 236 of file lodepng.cpp.

static void ucvector_init ( ucvector p) [static]

Definition at line 243 of file lodepng.cpp.

static void ucvector_init_buffer ( ucvector p,
unsigned char *  buffer,
size_t  size 
) [static]

Definition at line 264 of file lodepng.cpp.

static unsigned ucvector_push_back ( ucvector p,
unsigned char  c 
) [static]

Definition at line 273 of file lodepng.cpp.

static unsigned ucvector_resize ( ucvector p,
size_t  size 
) [static]

Definition at line 216 of file lodepng.cpp.

static unsigned ucvector_resizev ( ucvector p,
size_t  size,
unsigned char  value 
) [static]

Definition at line 251 of file lodepng.cpp.

static void uivector_cleanup ( void *  p) [static]

Definition at line 135 of file lodepng.cpp.

static unsigned uivector_copy ( uivector p,
const uivector q 
) [static]

Definition at line 186 of file lodepng.cpp.

static void uivector_init ( uivector p) [static]

Definition at line 170 of file lodepng.cpp.

static unsigned uivector_push_back ( uivector p,
unsigned  c 
) [static]

Definition at line 178 of file lodepng.cpp.

static unsigned uivector_resize ( uivector p,
size_t  size 
) [static]

Definition at line 143 of file lodepng.cpp.

static unsigned uivector_resizev ( uivector p,
size_t  size,
unsigned  value 
) [static]

Definition at line 162 of file lodepng.cpp.

static void uivector_swap ( uivector p,
uivector q 
) [static]

Definition at line 194 of file lodepng.cpp.

static unsigned unfilter ( unsigned char *  out,
const unsigned char *  in,
unsigned  w,
unsigned  h,
unsigned  bpp 
) [static]

Definition at line 4084 of file lodepng.cpp.

static unsigned unfilterScanline ( unsigned char *  recon,
const unsigned char *  scanline,
const unsigned char *  precon,
size_t  bytewidth,
unsigned char  filterType,
size_t  length 
) [static]

Definition at line 4010 of file lodepng.cpp.

static unsigned update_adler32 ( unsigned  adler,
const unsigned char *  data,
unsigned  len 
) [static]

Definition at line 2044 of file lodepng.cpp.

static void updateHashChain ( Hash hash,
size_t  pos,
int  hashval,
unsigned  windowsize 
) [static]

Definition at line 1433 of file lodepng.cpp.

static void writeLZ77data ( size_t *  bp,
ucvector out,
const uivector lz77_encoded,
const HuffmanTree tree_ll,
const HuffmanTree tree_d 
) [static]

Definition at line 1650 of file lodepng.cpp.

static void writeSignature ( ucvector out) [static]

Definition at line 4893 of file lodepng.cpp.

static unsigned zlib_compress ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  in,
size_t  insize,
const LodePNGCompressSettings settings 
) [static]

Definition at line 2180 of file lodepng.cpp.

static unsigned zlib_decompress ( unsigned char **  out,
size_t *  outsize,
const unsigned char *  in,
size_t  insize,
const LodePNGDecompressSettings settings 
) [static]

Definition at line 2124 of file lodepng.cpp.


Variable Documentation

const unsigned ADAM7_DX[7] = { 8, 8, 4, 4, 2, 2, 1 } [static]

Definition at line 3900 of file lodepng.cpp.

const unsigned ADAM7_DY[7] = { 8, 8, 8, 4, 4, 2, 2 } [static]

Definition at line 3901 of file lodepng.cpp.

const unsigned ADAM7_IX[7] = { 0, 4, 0, 2, 0, 1, 0 } [static]

Definition at line 3898 of file lodepng.cpp.

const unsigned ADAM7_IY[7] = { 0, 0, 4, 0, 2, 0, 1 } [static]

Definition at line 3899 of file lodepng.cpp.

const unsigned CLCL_ORDER[NUM_CODE_LENGTH_CODES] = {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15} [static]

Definition at line 488 of file lodepng.cpp.

const unsigned DISTANCEBASE[30] [static]
Initial value:
 {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513,
     769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}

Definition at line 477 of file lodepng.cpp.

const unsigned DISTANCEEXTRA[30] [static]
Initial value:
 {0, 0, 0, 0, 1, 1, 2,  2,  3,  3,  4,  4,  5,  5,   6,   6,   7,   7,   8,
       8,    9,    9,   10,   10,   11,   11,   12,    12,    13,    13}

Definition at line 482 of file lodepng.cpp.

const unsigned HASH_NUM_CHARACTERS = 3 [static]

Definition at line 1360 of file lodepng.cpp.

const unsigned HASH_NUM_VALUES = 65536 [static]

Definition at line 1359 of file lodepng.cpp.

const unsigned HASH_SHIFT = 2 [static]

Definition at line 1361 of file lodepng.cpp.

const unsigned LENGTHBASE[29] [static]
Initial value:
 {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59,
     67, 83, 99, 115, 131, 163, 195, 227, 258}

Definition at line 467 of file lodepng.cpp.

const unsigned LENGTHEXTRA[29] [static]
Initial value:
 {0, 0, 0, 0, 0, 0, 0,  0,  1,  1,  1,  1,  2,  2,  2,  2,  3,  3,  3,  3,
      4,  4,  4,   4,   5,   5,   5,   5,   0}

Definition at line 472 of file lodepng.cpp.

unsigned lodepng_crc32_table[256] [static]

Definition at line 2271 of file lodepng.cpp.

Definition at line 2238 of file lodepng.cpp.

Definition at line 2254 of file lodepng.cpp.

const size_t MAX_SUPPORTED_DEFLATE_LENGTH = 258 [static]

Definition at line 1311 of file lodepng.cpp.



libfovis
Author(s): Albert Huang, Maurice Fallon
autogenerated on Thu Jun 6 2019 20:16:12