Classes | Defines | Typedefs | Functions | Variables
greymap.c File Reference
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <math.h>
#include "greymap.h"
Include dependency graph for greymap.c:

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_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)
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 INTBITS   (8*sizeof(int))

Definition at line 17 of file greymap.c.

#define mod (   a,
  n 
)    ((a)>=(n) ? (a)%(n) : (a)>=0 ? (a) : (n)-1-(-1-(a))%(n))

Definition at line 19 of file greymap.c.

#define TRY (   x)    if (x) goto try_error

Definition at line 481 of file greymap.c.

#define TRY_EOF (   x)    if (x) goto eof

Definition at line 482 of file greymap.c.


Typedef Documentation

typedef struct bmp_info_s bmp_info_t

Definition at line 417 of file greymap.c.


Function Documentation

static int bmp_forward ( FILE *  f,
int  pos 
) [static]

Definition at line 467 of file greymap.c.

static int bmp_pad ( FILE *  f) [static]

Definition at line 451 of file greymap.c.

static void bmp_pad_reset ( void  ) [static]

Definition at line 445 of file greymap.c.

static int bmp_readint ( FILE *  f,
int  n,
unsigned int *  p 
) [static]

Definition at line 426 of file greymap.c.

static int fgetc_ws ( FILE *  f) [static]

Definition at line 85 of file greymap.c.

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.

static int gm_readbody_bmp ( FILE *  f,
greymap_t **  gmp 
) [static]

Definition at line 491 of file greymap.c.

static int gm_readbody_pnm ( FILE *  f,
greymap_t **  gmp,
int  magic 
) [static]

Definition at line 201 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.

static int readbit ( FILE *  f) [static]

Definition at line 145 of file greymap.c.

static int readnum ( FILE *  f) [static]

Definition at line 110 of file greymap.c.


Variable Documentation

int bmp_count = 0 [static]

Definition at line 421 of file greymap.c.

int bmp_pos = 0 [static]

Definition at line 422 of file greymap.c.

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