Classes | Defines | Typedefs | Functions | Variables
greymap.h File Reference
#include <stdio.h>
Include dependency graph for greymap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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_tgm_dup (greymap_t *gm)
void gm_free (greymap_t *gm)
greymap_tgm_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

Define Documentation

#define GM_BGET (   gm,
  x,
 
)    GM_UGET(gm, gm_bound(x, gm->w), gm_bound(y, gm->h))

Definition at line 37 of file greymap.h.

#define gm_bound (   x,
  m 
)    ((x)<0 ? 0 : (x)>=(m) ? (m)-1 : (x))

Definition at line 28 of file greymap.h.

#define GM_GET (   gm,
  x,
 
)    (gm_safe(gm, x, y) ? GM_UGET(gm, x, y) : 0)

Definition at line 33 of file greymap.h.

#define GM_INC (   gm,
  x,
  y,
 
)    (gm_safe(gm, x, y) ? GM_UINC(gm, x, y, b) : 0)

Definition at line 34 of file greymap.h.

#define gm_index (   gm,
  x,
 
)    (&(gm)->map[(x)+(y)*(gm)->w])

Definition at line 26 of file greymap.h.

#define GM_INV (   gm,
  x,
 
)    (gm_safe(gm, x, y) ? GM_UINV(gm, x, y) : 0)

Definition at line 35 of file greymap.h.

#define GM_MODE_NEGATIVE   4

Definition at line 46 of file greymap.h.

#define GM_MODE_NONZERO   1

Definition at line 43 of file greymap.h.

#define GM_MODE_ODD   2

Definition at line 44 of file greymap.h.

#define GM_MODE_POSITIVE   3

Definition at line 45 of file greymap.h.

#define GM_PUT (   gm,
  x,
  y,
 
)    (gm_safe(gm, x, y) ? GM_UPUT(gm, x, y, b) : 0)

Definition at line 36 of file greymap.h.

#define gm_safe (   gm,
  x,
 
)    ((int)(x)>=0 && (int)(x)<(gm)->w && (int)(y)>=0 && (int)(y)<(gm)->h)

Definition at line 27 of file greymap.h.

#define GM_UGET (   gm,
  x,
 
)    (*gm_index(gm, x, y))

Definition at line 29 of file greymap.h.

#define GM_UINC (   gm,
  x,
  y,
 
)    (*gm_index(gm, x, y) += (short int)(b))

Definition at line 30 of file greymap.h.

#define GM_UINV (   gm,
  x,
 
)    (*gm_index(gm, x, y) = 255 - *gm_index(gm, x, y))

Definition at line 31 of file greymap.h.

#define GM_UPUT (   gm,
  x,
  y,
 
)    (*gm_index(gm, x, y) = (short int)(b))

Definition at line 32 of file greymap.h.


Typedef Documentation

typedef struct greymap_s greymap_t

Definition at line 21 of file greymap.h.


Function Documentation

void gm_clear ( greymap_t gm,
int  b 
)

Definition at line 68 of file greymap.c.

Definition at line 58 of file greymap.c.

void gm_free ( greymap_t gm)

Definition at line 50 of file greymap.c.

greymap_t* gm_new ( int  w,
int  h 
)

Definition at line 29 of file greymap.c.

int gm_print ( FILE *  f,
greymap_t gm 
)

Definition at line 865 of file greymap.c.

int gm_read ( FILE *  f,
greymap_t **  gmp 
)

Definition at line 174 of file greymap.c.

int gm_writepgm ( FILE *  f,
greymap_t gm,
char *  comment,
int  raw,
int  mode,
double  gamma 
)

Definition at line 799 of file greymap.c.


Variable Documentation

Definition at line 172 of file greymap.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


portrait_painter
Author(s): Niklas Meinzer, Ina Baumgarten
autogenerated on Wed Dec 26 2012 16:00:43