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 File Reference
#include "pbmplus.h"
Include dependency graph for pbm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PBM_WHITE   0
 
#define PBM_BLACK   1
 
#define PBM_MAGIC1   'P'
 
#define PBM_MAGIC2   '1'
 
#define RPBM_MAGIC2   '4'
 
#define PBM_FORMAT   (PBM_MAGIC1 * 256 + PBM_MAGIC2)
 
#define RPBM_FORMAT   (PBM_MAGIC1 * 256 + RPBM_MAGIC2)
 
#define PBM_TYPE   PBM_FORMAT
 
#define PBM_FORMAT_TYPE(f)    ((f) == PBM_FORMAT || (f) == RPBM_FORMAT ? PBM_TYPE : -1)
 
#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)
 

Typedefs

typedef unsigned char bit
 

Functions

void pbm_init ()
 
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)
 
char * pm_read_unknown_size (FILE *file, long *buf)
 
void pbm_writepbm (FILE *file, bit **bits, int cols, int rows, int forceplain)
 
void pbm_writepbminit (FILE *file, int cols, int rows, int forceplain)
 
void pbm_writepbmrow (FILE *file, bit *bitrow, int cols, int forceplain)
 
void pbm_writepbmrow_packed (FILE *const file, const unsigned char *const packed_bits, const int cols, const int format)
 

Macro Definition Documentation

◆ pbm_allocarray

#define pbm_allocarray (   cols,
  rows 
)     ((bit**) pm_allocarray(cols, rows, sizeof(bit)))

Definition at line 34 of file pbm.h.

◆ pbm_allocrow

#define pbm_allocrow (   cols)    ((bit*) pm_allocrow( cols, sizeof(bit)))

Definition at line 36 of file pbm.h.

◆ PBM_BLACK

#define PBM_BLACK   1

Definition at line 11 of file pbm.h.

◆ PBM_FORMAT

#define PBM_FORMAT   (PBM_MAGIC1 * 256 + PBM_MAGIC2)

Definition at line 19 of file pbm.h.

◆ PBM_FORMAT_TYPE

#define PBM_FORMAT_TYPE (   f)     ((f) == PBM_FORMAT || (f) == RPBM_FORMAT ? PBM_TYPE : -1)

Definition at line 26 of file pbm.h.

◆ pbm_freearray

#define pbm_freearray (   bits,
  rows 
)    pm_freearray((char**) bits, rows)

Definition at line 37 of file pbm.h.

◆ pbm_freerow

#define pbm_freerow (   bitrow)    pm_freerow((char*) bitrow)

Definition at line 38 of file pbm.h.

◆ PBM_MAGIC1

#define PBM_MAGIC1   'P'

Definition at line 16 of file pbm.h.

◆ PBM_MAGIC2

#define PBM_MAGIC2   '1'

Definition at line 17 of file pbm.h.

◆ pbm_packed_bytes

#define pbm_packed_bytes (   cols)    (((cols)+7)/8)

Definition at line 39 of file pbm.h.

◆ PBM_TYPE

#define PBM_TYPE   PBM_FORMAT

Definition at line 21 of file pbm.h.

◆ PBM_WHITE

#define PBM_WHITE   0

Definition at line 10 of file pbm.h.

◆ RPBM_FORMAT

#define RPBM_FORMAT   (PBM_MAGIC1 * 256 + RPBM_MAGIC2)

Definition at line 20 of file pbm.h.

◆ RPBM_MAGIC2

#define RPBM_MAGIC2   '4'

Definition at line 18 of file pbm.h.

Typedef Documentation

◆ bit

typedef unsigned char bit

Definition at line 9 of file pbm.h.

Function Documentation

◆ pbm_init()

void pbm_init ( )

◆ pbm_readpbm()

bit** pbm_readpbm ( FILE file,
int colsP,
int rowsP 
)

Definition at line 161 of file libpbm2.c.

References bits, format, pbm_allocarray, pbm_readpbminit(), pbm_readpbmrow(), and row.

Referenced by fill_map(), main(), pbm_loadpbmfont(), and readcharacter().

◆ pbm_readpbminit()

void pbm_readpbminit ( FILE file,
int colsP,
int rowsP,
int formatP 
)

Definition at line 62 of file libpbm2.c.

References PBM_FORMAT_TYPE, pbm_readmagicnumber(), pbm_readpbminitrest(), PBM_TYPE, and pm_error.

Referenced by main(), and pbm_readpbm().

◆ pbm_readpbmrow()

void pbm_readpbmrow ( FILE file,
bit bitrow,
int  cols,
int  format 
)

◆ pbm_readpbmrow_packed()

void pbm_readpbmrow_packed ( FILE *const  file,
unsigned char *const  packed_bits,
const int  cols,
const int  format 
)

Definition at line 121 of file libpbm2.c.

References col, cols, feof, format, fread, mask, PBM_FORMAT, pbm_getbit(), pbm_packed_bytes, pm_error, and RPBM_FORMAT.

◆ pbm_writepbm()

void pbm_writepbm ( FILE file,
bit **  bits,
int  cols,
int  rows,
int  forceplain 
)

Definition at line 136 of file libpbm3.c.

References cols, pbm_writepbminit(), pbm_writepbmrow(), row, and rows.

Referenced by main(), and pgm_hist().

◆ pbm_writepbminit()

void pbm_writepbminit ( FILE file,
int  cols,
int  rows,
int  forceplain 
)

Definition at line 22 of file libpbm3.c.

References cols, fprintf, PBM_MAGIC1, PBM_MAGIC2, rows, and RPBM_MAGIC2.

Referenced by main(), output_pbm(), pbm_writepbm(), pnm_writepnminit(), and write_raw_pbm().

◆ pbm_writepbmrow()

void pbm_writepbmrow ( FILE file,
bit bitrow,
int  cols,
int  forceplain 
)

◆ pbm_writepbmrow_packed()

void pbm_writepbmrow_packed ( FILE *const  file,
const unsigned char *const  packed_bits,
const int  cols,
const int  format 
)

◆ pm_read_unknown_size()

char* pm_read_unknown_size ( FILE file,
long *  buf 
)

Definition at line 799 of file libpbm1.c.

References buf, EOF, getc, malloc, NULL, PM_BUF_SIZE, pm_error(), PM_MAX_BUF_INC, realloc, and val.

Referenced by main().