w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pbm.h
Go to the documentation of this file.
1 /* pbm.h - header file for libpbm portable bitmap library
2 */
3 
4 #ifndef _PBM_H_
5 #define _PBM_H_
6 
7 #include "pbmplus.h"
8 
9 typedef unsigned char bit;
10 #define PBM_WHITE 0
11 #define PBM_BLACK 1
12 
13 
14 /* Magic constants. */
15 
16 #define PBM_MAGIC1 'P'
17 #define PBM_MAGIC2 '1'
18 #define RPBM_MAGIC2 '4'
19 #define PBM_FORMAT (PBM_MAGIC1 * 256 + PBM_MAGIC2)
20 #define RPBM_FORMAT (PBM_MAGIC1 * 256 + RPBM_MAGIC2)
21 #define PBM_TYPE PBM_FORMAT
22 
23 
24 /* Macro for turning a format number into a type number. */
25 
26 #define PBM_FORMAT_TYPE(f) \
27  ((f) == PBM_FORMAT || (f) == RPBM_FORMAT ? PBM_TYPE : -1)
28 
29 
30 /* Declarations of routines. */
31 
32 void pbm_init ARGS(( int* argcP, char* argv[] ));
33 
34 #define pbm_allocarray(cols, rows) \
35  ((bit**) pm_allocarray(cols, rows, sizeof(bit)))
36 #define pbm_allocrow(cols) ((bit*) pm_allocrow( cols, sizeof(bit)))
37 #define pbm_freearray(bits, rows) pm_freearray((char**) bits, rows)
38 #define pbm_freerow(bitrow) pm_freerow((char*) bitrow)
39 #define pbm_packed_bytes(cols) (((cols)+7)/8)
40 
41 bit** pbm_readpbm(FILE* file, int* colsP, int* rowsP);
42 void pbm_readpbminit(FILE* file, int* colsP, int* rowsP, int* formatP);
43 void pbm_readpbmrow(FILE* file, bit* bitrow, int cols, int format);
45  FILE* const file, unsigned char * const packed_bits,
46  const int cols, const int format);
47 char* pm_read_unknown_size(FILE* file, long* buf);
48 
49 void pbm_writepbm (FILE* file, bit** bits, int cols, int rows, int forceplain);
50 void pbm_writepbminit(FILE* file, int cols, int rows, int forceplain);
51 void pbm_writepbmrow (FILE* file, bit* bitrow, int cols, int forceplain);
53  FILE* const file, const unsigned char * const packed_bits,
54  const int cols, const int format);
55 
56 #endif /*_PBM_H_*/
57 
#define buf
void pbm_readpbmrow_packed(FILE *const file, unsigned char *const packed_bits, const int cols, const int format)
Definition: libpbm2.c:121
char * pm_read_unknown_size(FILE *file, long *buf)
Definition: libpbm1.c:799
void pbm_writepbminit(FILE *file, int cols, int rows, int forceplain)
Definition: libpbm3.c:22
bit ** pbm_readpbm(FILE *file, int *colsP, int *rowsP)
Definition: libpbm2.c:161
unsigned char bit
Definition: pbm.h:9
void pbm_writepbmrow(FILE *file, bit *bitrow, int cols, int forceplain)
Definition: libpbm3.c:95
void pbm_writepbm(FILE *file, bit **bits, int cols, int rows, int forceplain)
Definition: libpbm3.c:136
void pbm_writepbmrow_packed(FILE *const file, const unsigned char *const packed_bits, const int cols, const int format)
Definition: libpbm3.c:110
void pbm_init()
void pbm_readpbminit(FILE *file, int *colsP, int *rowsP, int *formatP)
Definition: libpbm2.c:62
void pbm_readpbmrow(FILE *file, bit *bitrow, int cols, int format)
Definition: libpbm2.c:82
static int rows
Definition: pbmclean.c:15
static int format
Definition: pbmclean.c:15
static int cols
Definition: pbmmask.c:21
#define ARGS(alist)
Definition: pbmplus.h:235
Definition: namelist.c:170
Definition: filedef.h:30
#define FILE
Definition: t1stdio.h:34
#define argv
Definition: xmain.c:270