Typedefs | Functions | Variables

File Reading
[File WritingPGM/PPM Library]

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

Collaboration diagram for File Reading:


typedef bool(* pgmppm::notify_size_fn )(void *context, int width, int length, int max_val)
typedef void(* pgmppm::pgm_write_pixel_fn )(void *context, int x, int y, int height)


bool pgmppm::readPgm (std::istream &in, notify_size_fn notify, pgm_write_pixel_fn write_pixel, void *context)


int pgmppm::color_t::green
int pgmppm::color_t::blue

Detailed Description

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

The first callback (notify_size) lets the caller know the size of the image. The second callback (write_pixel) is called per pixel in the image.

Again, designed for reusability and safety, not speed.

Typedef Documentation

typedef bool(* pgmppm::notify_size_fn)(void *context,int width,int length,int max_val)

Definition at line 120 of file pgmppm.h.

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

Definition at line 125 of file pgmppm.h.

Function Documentation

bool pgmppm::readPgm ( std::istream &  in,
notify_size_fn  notify,
pgm_write_pixel_fn  write_pixel,
void *  context 

Variable Documentation

int pgmppm::color_t::green [inherited]

Definition at line 88 of file pgmppm.h.

int pgmppm::color_t::blue [inherited]

Definition at line 89 of file pgmppm.h.