Classes | Modules

File Writing
[PGM/PPM Library]

To write a file, the caller specifies the dimensions and a callback. More...

Collaboration diagram for File Writing:

Classes

struct  pgmppm::color_t

Modules

 File Reading
 

Caller provides the stream to be read, and two callbacks.




typedef int(* pgmppm::pgm_pixel_fn )(void *context, int x, int y)
typedef color_t(* pgmppm::ppm_pixel_fn )(void *context, int x, int y)
void pgmppm::writePgm (std::ostream &out,int width,int height,int max_gray,pgm_pixel_fn fn,void *context)
 write a pgm file to an output stream
void pgmppm::writePpm (std::ostream &out, int width, int height, int max_color, ppm_pixel_fn fn, void *context)

Detailed Description

To write a file, the caller specifies the dimensions and a callback.

The file-writing routine will call back to retrieve per-pixel info.

These are designed to be safe and agnostic to image storage, not fast.


Typedef Documentation

typedef int(* pgmppm::pgm_pixel_fn)(void *context,int x,int y)

Definition at line 75 of file pgmppm.h.

typedef color_t(* pgmppm::ppm_pixel_fn)(void *context,int x,int y)

Definition at line 92 of file pgmppm.h.


Function Documentation

void pgmppm::writePgm ( std::ostream &  out,
int  width,
int  height,
int  max_gray,
pgm_pixel_fn  fn,
void *  context 
)

write a pgm file to an output stream

void pgmppm::writePpm ( std::ostream &  out,
int  width,
int  height,
int  max_color,
ppm_pixel_fn  fn,
void *  context 
)