Mercurial > hg > dmlib
comparison tools/libgfx.h @ 2086:aedadff9e116
Implement dmGetBits() to the DMBitStreamContext API. Also improve error handling.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 13 Dec 2018 15:54:09 +0200 |
parents | 41df24d1dfb6 |
children | 614b161c0aa5 |
comparison
equal
deleted
inserted
replaced
2085:b31bb3dc1310 | 2086:aedadff9e116 |
---|---|
150 | 150 |
151 typedef struct _DMBitStreamContext | 151 typedef struct _DMBitStreamContext |
152 { | 152 { |
153 void *handle; | 153 void *handle; |
154 | 154 |
155 BOOL (*putByte)(struct _DMBitStreamContext *ctx, Uint8 val); | 155 int (*putByte)(struct _DMBitStreamContext *ctx); |
156 int (*getByte)(struct _DMBitStreamContext *ctx); | |
156 | 157 |
157 int outBuf, outBitCount, outByteCount; | 158 unsigned int |
159 outBuf, outBitCount, outByteCount, | |
160 inBuf, inBitCount, inByteCount; | |
158 } DMBitStreamContext; | 161 } DMBitStreamContext; |
159 | 162 |
160 | 163 |
161 void dmInitBitStreamContext(DMBitStreamContext *ctx); | 164 void dmInitBitStreamContext(DMBitStreamContext *ctx); |
162 int dmFlushBitStream(DMBitStreamContext *ctx); | 165 int dmFlushBitStream(DMBitStreamContext *ctx); |
163 BOOL dmPutBits(DMBitStreamContext *ctx, const int val, const int n); | 166 int dmInitBitStreamRes(DMBitStreamContext *ctx, DMResource *fp); |
164 int dmInitBitStreamFILE(DMBitStreamContext *ctx, DMResource *fp); | 167 |
168 int dmPutBits(DMBitStreamContext *ctx, const unsigned int val, const unsigned int n); | |
169 int dmGetBits(DMBitStreamContext *ctx, unsigned int *val, const unsigned int n); | |
165 | 170 |
166 | 171 |
167 #ifdef __cplusplus | 172 #ifdef __cplusplus |
168 } | 173 } |
169 #endif | 174 #endif |