Main Page | Class Hierarchy | Class List | Directories | Class Members

MntPnmFile Class Reference

This class provides static methods that read and write PPM and PGM files. More...

#include <mnt_pnm_file.h>

List of all members.

Static Public Member Functions

static int ppm_encode (MntByteImage *r, MntByteImage *g, MntByteImage *b, BitParser *bp)
 Assuming that the cursor of BitParser bp is pointing to the position after a PNM header, this method writes the pixel values from the given R, G, and B value out to the BitParser bp.
static int ppm_parse (BitParser *bp, MntByteImage *r, MntByteImage *g, MntByteImage *b)
 Assuming that the cursor of BitParser bp is pointing to the first byte of the image and the size of the three input byte images are set properly, this method reads the pixel values from a bitstream containing PPM image and stores it in the respective byte images according to its color plane.
static int pgm_encode (MntByteImage *byte, BitParser *bp)
 Assuming that the cursor of BitParser bp is pointing to the position after a PNM header, this method writes the pixel values from the given byte image out to a bitstream as PGM image.
static int pgm_parse (BitParser *bp, MntByteImage *byte)
 Assuming that the cursor of BitParser bp is pointing to the first byte of the image and the size of the input byte image is set properly, this method reads the pixel values from a bitstream containing PGM image and stores it in the byte image.


Detailed Description

This class provides static methods that read and write PPM and PGM files.


Member Function Documentation

int MntPnmFile::pgm_encode MntByteImage byte,
BitParser bp
[static]
 

Assuming that the cursor of BitParser bp is pointing to the position after a PNM header, this method writes the pixel values from the given byte image out to a bitstream as PGM image.

Parameters:
byte The image to be written to bitstream.
bp The bit parser to write the PGM image to.
Returns:
The number of bytes written.

int MntPnmFile::pgm_parse BitParser bp,
MntByteImage byte
[static]
 

Assuming that the cursor of BitParser bp is pointing to the first byte of the image and the size of the input byte image is set properly, this method reads the pixel values from a bitstream containing PGM image and stores it in the byte image.

Returns:
The number of bytes read.
Parameters:
bp Input bit parser with cursor pointing the first byte of image.
byte A byte image to store the PGM image.

int MntPnmFile::ppm_encode MntByteImage r,
MntByteImage g,
MntByteImage b,
BitParser bp
[static]
 

Assuming that the cursor of BitParser bp is pointing to the position after a PNM header, this method writes the pixel values from the given R, G, and B value out to the BitParser bp.

Parameters:
r The red plane of the image to be written to bitstream.
g The green plane of the image to be written to bitstream.
b The blue plane of the image to be written to bitstream.
bp The bit parser to write the PPM image to.
Returns:
The number of bytes written.

int MntPnmFile::ppm_parse BitParser bp,
MntByteImage r,
MntByteImage g,
MntByteImage b
[static]
 

Assuming that the cursor of BitParser bp is pointing to the first byte of the image and the size of the three input byte images are set properly, this method reads the pixel values from a bitstream containing PPM image and stores it in the respective byte images according to its color plane.

Returns:
The number of bytes read.
Parameters:
bp Input bit parser with cursor pointing the first byte of image.
r A byte image to store the red plane of the PPM image.
g A byte image to store the green plane of the PPM image.
b A byte image to store the blue plane of the PPM image.


The documentation for this class was generated from the following files:
Generated on Wed Sep 14 12:37:13 2005 for mnt by  doxygen 1.4.4