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 )(IN void *context, IN int x, IN int y)
typedef color_t(* pgmppm::ppm_pixel_fn )(IN void *context, IN int x, IN int y)
void pgmppm::writePgm (IO std::ostream &out, IN int width, IN int height, IN int max_gray,IN pgm_pixel_fn fn, IN void *context)
 write a pgm file to an output stream
void pgmppm::writePpm (IO std::ostream &out, IN int width, IN int height, IN int max_color, IN ppm_pixel_fn fn, IN 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)(IN void *context, IN int x, IN int y)

Definition at line 75 of file pgmppm.h.

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

Definition at line 92 of file pgmppm.h.


Function Documentation

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

write a pgm file to an output stream

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