Leptonica
1.54
|
Макросы | |
#define | DEBUG 0 |
Функции | |
l_uint8 * | zlibCompress (l_uint8 *datain, size_t nin, size_t *pnout) |
l_uint8 * | zlibUncompress (l_uint8 *datain, size_t nin, size_t *pnout) |
Переменные | |
static const l_int32 | L_BUF_SIZE = 32768 |
static const l_int32 | ZLIB_COMPRESSION_LEVEL = 6 |
#define DEBUG 0 |
l_uint8* zlibCompress | ( | l_uint8 * | datain, |
size_t | nin, | ||
size_t * | pnout | ||
) |
Input: datain (byte buffer with input data) nin (number of bytes of input data) &nout (<return> number of bytes of output data) Return: dataout (compressed data), or null on error
Notes: (1) We repeatedly read in and fill up an input buffer, compress the data, and read it back out. zlib uses two byte buffers internally in the z_stream data structure. We use the bbuffers to feed data into the fixed bufferin, and feed it out of bufferout, in the same way that a pair of streams would normally be used if the data were being read from one file and written to another. This is done iteratively, compressing L_BUF_SIZE bytes of input data at a time.
l_uint8* zlibUncompress | ( | l_uint8 * | datain, |
size_t | nin, | ||
size_t * | pnout | ||
) |
Input: datain (byte buffer with compressed input data) nin (number of bytes of input data) &nout (<return> number of bytes of output data) Return: dataout (uncompressed data), or null on error
Notes: (1) See zlibCompress().
const l_int32 L_BUF_SIZE = 32768 [static] |
const l_int32 ZLIB_COMPRESSION_LEVEL = 6 [static] |