Mercurial > hg > dmlib
view src/dmzlib.h @ 2208:90ec1ec89c56
Revamp the palette handling in lib64gfx somewhat, add helper functions to
lib64util for handling external palette file options and add support for
specifying one of the "internal" palettes or external (.act) palette file to
gfxconv and 64vw.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 14 Jun 2019 05:01:12 +0300 |
parents | 043b5942fdb6 |
children | 9807ae37ad69 |
line wrap: on
line source
/* * DMLib * -- ZLib implementation * Public domain zlib decode v0.2 by Sean Barrett 2006-11-18 * Modified and reformatted for DMLib by Matti 'ccr' Hamalainen */ #ifndef DMZLIB_H #define DMZLIB_H #include "dmlib.h" #ifdef __cplusplus extern "C" { #endif #define DM_ZLIB_HFAST_BITS 9 // accelerate all cases in default tables #define DM_ZLIB_HFAST_SIZE (1 << DM_ZLIB_HFAST_BITS) #define DM_ZLIB_HFAST_MASK (DM_ZLIB_HFAST_SIZE - 1) #define DM_ZLIB_HUFF_CODES (288) #define DM_ZLIB_HUFF_DIST (32) typedef struct { BOOL initialized; Uint16 fast[DM_ZLIB_HFAST_SIZE]; Uint16 firstCode[16]; int maxCode[16 + 1]; Uint16 firstSymbol[16]; Uint8 size[DM_ZLIB_HUFF_CODES]; Uint16 value[DM_ZLIB_HUFF_CODES]; } DMZHuffmanContext; typedef struct { Uint8 *inBuffer, *inBufferStart, *inBufferEnd; int window; int numBits; Uint32 codeBuffer; Uint8 *outBuffer, *outBufferStart, *outBufferEnd; BOOL expandable; DMZHuffmanContext zlength, zdistance; } DMZLibContext; int dmZLibInit(); void dmZLibClose(); int dmZLibInitInflate(DMZLibContext *ctx); void dmZLibCloseInflate(DMZLibContext *ctx); int dmZLibParseHeader(DMZLibContext * ctx, BOOL checkPNG); int dmZLibInflate(DMZLibContext * ctx); #ifdef __cplusplus } #endif #endif // DMZLIB_H