Classes |
struct | greymap_s |
Defines |
#define | GM_BGET(gm, x, y) GM_UGET(gm, gm_bound(x, gm->w), gm_bound(y, gm->h)) |
#define | gm_bound(x, m) ((x)<0 ? 0 : (x)>=(m) ? (m)-1 : (x)) |
#define | GM_GET(gm, x, y) (gm_safe(gm, x, y) ? GM_UGET(gm, x, y) : 0) |
#define | GM_INC(gm, x, y, b) (gm_safe(gm, x, y) ? GM_UINC(gm, x, y, b) : 0) |
#define | gm_index(gm, x, y) (&(gm)->map[(x)+(y)*(gm)->w]) |
#define | GM_INV(gm, x, y) (gm_safe(gm, x, y) ? GM_UINV(gm, x, y) : 0) |
#define | GM_MODE_NEGATIVE 4 |
#define | GM_MODE_NONZERO 1 |
#define | GM_MODE_ODD 2 |
#define | GM_MODE_POSITIVE 3 |
#define | GM_PUT(gm, x, y, b) (gm_safe(gm, x, y) ? GM_UPUT(gm, x, y, b) : 0) |
#define | gm_safe(gm, x, y) ((int)(x)>=0 && (int)(x)<(gm)->w && (int)(y)>=0 && (int)(y)<(gm)->h) |
#define | GM_UGET(gm, x, y) (*gm_index(gm, x, y)) |
#define | GM_UINC(gm, x, y, b) (*gm_index(gm, x, y) += (short int)(b)) |
#define | GM_UINV(gm, x, y) (*gm_index(gm, x, y) = 255 - *gm_index(gm, x, y)) |
#define | GM_UPUT(gm, x, y, b) (*gm_index(gm, x, y) = (short int)(b)) |
Typedefs |
typedef struct greymap_s | greymap_t |
Functions |
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) |
int | gm_writepgm (FILE *f, greymap_t *gm, char *comment, int raw, int mode, double gamma) |
Variables |
char * | gm_read_error |