#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <math.h>
#include "greymap.h"
Go to the source code of this file.
Classes |
struct | bmp_info_s |
Defines |
#define | INTBITS (8*sizeof(int)) |
#define | mod(a, n) ((a)>=(n) ? (a)%(n) : (a)>=0 ? (a) : (n)-1-(-1-(a))%(n)) |
#define | TRY(x) if (x) goto try_error |
#define | TRY_EOF(x) if (x) goto eof |
Typedefs |
typedef struct bmp_info_s | bmp_info_t |
Functions |
static int | bmp_forward (FILE *f, int pos) |
static int | bmp_pad (FILE *f) |
static void | bmp_pad_reset (void) |
static int | bmp_readint (FILE *f, int n, unsigned int *p) |
static int | fgetc_ws (FILE *f) |
void | gm_clear (greymap_t *gm, int b) |
greymap_t * | gm_dup (greymap_t *gm) |
void | gm_free (greymap_t *gm) |
greymap_t * | gm_new (int w, int h) |
int | gm_print (FILE *f, greymap_t *gm) |
int | gm_read (FILE *f, greymap_t **gmp) |
static int | gm_readbody_bmp (FILE *f, greymap_t **gmp) |
static int | gm_readbody_pnm (FILE *f, greymap_t **gmp, int magic) |
int | gm_writepgm (FILE *f, greymap_t *gm, char *comment, int raw, int mode, double gamma) |
static int | readbit (FILE *f) |
static int | readnum (FILE *f) |
Variables |
static int | bmp_count = 0 |
static int | bmp_pos = 0 |
char * | gm_read_error = NULL |
Define Documentation
#define mod |
( |
|
a, |
|
|
|
n |
|
) |
| ((a)>=(n) ? (a)%(n) : (a)>=0 ? (a) : (n)-1-(-1-(a))%(n)) |
#define TRY |
( |
|
x | ) |
if (x) goto try_error |
Typedef Documentation
Function Documentation
static int bmp_pad |
( |
FILE * |
f | ) |
[static] |
static int bmp_readint |
( |
FILE * |
f, |
|
|
int |
n, |
|
|
unsigned int * |
p |
|
) |
| [static] |
static int fgetc_ws |
( |
FILE * |
f | ) |
[static] |
static int readbit |
( |
FILE * |
f | ) |
[static] |
static int readnum |
( |
FILE * |
f | ) |
[static] |
Variable Documentation