Mercurial > hg > dmlib
diff tools/libgfx.h @ 1309:5ad7d780a09b
Move bitstream reading functions to libgfx, as they were only used there.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 19 Aug 2017 15:27:43 +0300 |
parents | 43b13dbbdcd1 |
children | ae2ba8cb510f |
line wrap: on
line diff
--- a/tools/libgfx.h Sat Aug 19 15:21:41 2017 +0300 +++ b/tools/libgfx.h Sat Aug 19 15:27:43 2017 +0300 @@ -124,6 +124,23 @@ int dmReadPCXImage(const char *filename, DMImage **pimg); +typedef struct _DMBitStreamContext +{ + void *handle; + + BOOL (*putByte)(struct _DMBitStreamContext *ctx, Uint8 val); + + int outBuf, outBitCount, outByteCount; +} DMBitStreamContext; + + +void dmInitBitStreamContext(DMBitStreamContext *ctx); +int dmFlushBitStream(DMBitStreamContext *ctx); +BOOL dmPutBits(DMBitStreamContext *ctx, const int val, const int n); +int dmInitBitStreamFILE(DMBitStreamContext *ctx, FILE *fp); + + + #ifdef __cplusplus } #endif