| 1 |
#ifndef RUNLENGTH_INCLUDED |
| 2 |
#define RUNLENGTH_INCLUDED |
| 3 |
|
| 4 |
#include "pm_config.h" |
| 5 |
|
| 6 |
#include <limits.h> |
| 7 |
|
| 8 |
#ifdef __cplusplus |
| 9 |
extern "C" { |
| 10 |
#endif |
| 11 |
#if 0 |
| 12 |
} /* to fake out automatic code indenters */ |
| 13 |
#endif |
| 14 |
|
| 15 |
|
| 16 |
enum pm_RleMode { PM_RLE_PACKBITS, /* most common mode */ |
| 17 |
PM_RLE_GRAPHON, /* reserved */ |
| 18 |
PM_RLE_PPA, /* reserved */ |
| 19 |
PM_RLE_SGI8, /* reserved */ |
| 20 |
PM_RLE_SGI16, |
| 21 |
PM_RLE_PALM16, |
| 22 |
PM_RLE_PALMPDB |
| 23 |
}; |
| 24 |
|
| 25 |
size_t |
| 26 |
pm_rlenc_maxbytes (size_t const inSize, |
| 27 |
enum pm_RleMode const mode); |
| 28 |
|
| 29 |
void |
| 30 |
pm_rlenc_allocoutbuf(unsigned char ** const outbufP, |
| 31 |
size_t const inSize, |
| 32 |
enum pm_RleMode const mode); |
| 33 |
|
| 34 |
|
| 35 |
void |
| 36 |
pm_rlenc_freebuf(void * const buf); |
| 37 |
|
| 38 |
void |
| 39 |
pm_rlenc_compressbyte(const unsigned char * const inbuf, |
| 40 |
unsigned char * const outbuf, |
| 41 |
enum pm_RleMode const mode, |
| 42 |
size_t const inSize, |
| 43 |
size_t * const outputSizeP); |
| 44 |
|
| 45 |
void |
| 46 |
pm_rlenc_compressword(const uint16_t * const inbuf, |
| 47 |
unsigned char * const outbuf, |
| 48 |
enum pm_RleMode const mode, |
| 49 |
size_t const itemCnt, |
| 50 |
size_t * const outputSizeP); |
| 51 |
|
| 52 |
#endif |