diff options
Diffstat (limited to 'lib/pbm.h')
-rw-r--r-- | lib/pbm.h | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/lib/pbm.h b/lib/pbm.h index 1591c77f..24574d07 100644 --- a/lib/pbm.h +++ b/lib/pbm.h @@ -1,7 +1,7 @@ #ifndef PBM_H_INCLUDED #define PBM_H_INCLUDED -#include "pm.h" +#include <netpbm/pm.h> #ifdef __cplusplus extern "C" { @@ -33,13 +33,18 @@ typedef unsigned char bit; /* Declarations of routines. */ -void pbm_init ARGS(( int* argcP, char* argv[] )); +void +pbm_init(int * const argcP, + char ** const argv); + void pbm_nextimage(FILE *file, int * const eofP); +bit * +pbm_allocrow(unsigned int const cols); + #define pbm_allocarray(cols, rows) \ ((bit**) pm_allocarray(cols, rows, sizeof(bit))) -#define pbm_allocrow(cols) ((bit*) pm_allocrow(cols, sizeof(bit))) #define pbm_freearray(bits, rows) pm_freearray((char**) bits, rows) #define pbm_freerow(bitrow) pm_freerow((char*) bitrow) #define pbm_packed_bytes(cols) (((cols)+7)/8) @@ -56,9 +61,19 @@ pbm_nextimage(FILE *file, int * const eofP); bit** pbm_readpbm(FILE* file, int* colsP, int* rowsP); void pbm_readpbminit(FILE* file, int* colsP, int* rowsP, int* formatP); void pbm_readpbmrow(FILE* file, bit* bitrow, int cols, int format); -void pbm_readpbmrow_packed( - FILE* const file, unsigned char * const packed_bits, - const int cols, const int format); + +void +pbm_readpbmrow_packed(FILE * const file, + unsigned char * const packedBits, + int const cols, + int const format); + +void +pbm_readpbmrow_bitoffset(FILE * const fileP, + unsigned char * const packedBits, + int const cols, + int const format, + unsigned int const offset); void pbm_writepbminit(FILE * const fileP, @@ -74,10 +89,10 @@ pbm_writepbm(FILE * const fileP, int const forceplain); void -pbm_writepbmrow(FILE * const fileP, - bit * const bitrow, - int const cols, - int const forceplain); +pbm_writepbmrow(FILE * const fileP, + const bit * const bitrow, + int const cols, + int const forceplain); void pbm_writepbmrow_packed(FILE * const fileP, @@ -86,10 +101,22 @@ pbm_writepbmrow_packed(FILE * const fileP, int const forceplain); void +pbm_writepbmrow_bitoffset(FILE * const ifP, + unsigned char * const packedBits, + unsigned int const cols, + int const format, + unsigned int const offset); + +void pbm_check(FILE * file, const enum pm_check_type check_type, const int format, const int cols, const int rows, enum pm_check_code * const retval_p); +bit +pbm_backgroundbitrow(const unsigned char * const packedBits, + unsigned int const cols, + unsigned int const offset); + #ifdef __cplusplus } #endif |