Vista     Main Page   Class List   Function List   File List   Examples  


Motion2DImage_PNM.h File Reference

Definition of PNM image format input/output functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <CMotion2DImage.h>

Go to the source code of this file.

Functions

bool ReadPGM (CMotion2DImage< unsigned char > &I, const char filename[FILENAME_MAX])
bool ReadPGM (CMotion2DImage< short > &I, const char filename[FILENAME_MAX])
bool ReadPPM (CMotion2DImage< unsigned char > &I, const char filename[FILENAME_MAX])
bool ReadPPM (CMotion2DImage< short > &I, const char filename[FILENAME_MAX])
bool WritePGM (CMotion2DImage< unsigned char > I, const char *filename)
bool WritePGM (CMotion2DImage< short > I, const char *filename)
bool WritePPM (CMotion2DImage< unsigned char > I, const char *filename)
bool WritePPM (CMotion2DImage< short > I, const char *filename)


Detailed Description

Definition of PNM image format input/output functions.


Function Documentation

bool ReadPGM CMotion2DImage< short > &    I,
const char    filename[FILENAME_MAX]
 

Read the contents of the portable gray pixmap (PGM P5) filename, allocate memory for the corresponding image, and set the bitmap whith the content of the file.

Returns:
false if an error occurs, or true otherwise.
If the image has been already initialized, memory allocation is done only if the new image size is different, else we re-use the same memory space.

See also:
WritePGM(), ReadPPM(), ReadPNG()

bool ReadPGM CMotion2DImage< unsigned char > &    I,
const char    filename[FILENAME_MAX]
 

Read the contents of the portable gray pixmap (PGM P5) filename, allocate memory for the corresponding image, and set the bitmap whith the content of the file.

Returns:
false if an error occurs, or true otherwise.
If the image has been already initialized, memory allocation is done only if the new image size is different, else we re-use the same memory space.

See also:
WritePGM(), ReadPPM(), ReadPNG()

bool ReadPPM CMotion2DImage< short > &    I,
const char    filename[FILENAME_MAX]
 

Read the contents of the portable pixmap (PPM P6) filename, allocate memory for the corresponding gray level image, convert the data in gray level, and set the bitmap whith the gray level data. That means that the image I is a "black and white" rendering of the original image in filename, as in a black and white photograph. The quantization formula used is .

Returns:
false if an error occurs, or true otherwise.
If the image has been already initialized, memory allocation is done only if the new image size is different, else we re-use the same memory space.

See also:
WritePPM(), ReadPGM(), ReadPNG()

bool ReadPPM CMotion2DImage< unsigned char > &    I,
const char    filename[FILENAME_MAX]
 

Read the contents of the portable pixmap (PPM P6) filename, allocate memory for the corresponding gray level image, convert the data in gray level, and set the bitmap whith the gray level data. That means that the image I is a "black and white" rendering of the original image in filename, as in a black and white photograph. The quantization formula used is .

Returns:
false if an error occurs, or true otherwise.
If the image has been already initialized, memory allocation is done only if the new image size is different, else we re-use the same memory space.

See also:
WritePPM(), ReadPGM(), ReadPNG()

bool WritePGM CMotion2DImage< short >    I,
const char *    filename
 

Write the content of the bitmap in the file which name is given by filename. This function writes a portable gray pixmap (PGM P5) file.

Warning:
Cast the content of the bitmap from short values to unsigned char values. Be aware, data can be lost.
Returns:
false if an error occurs, or true otherwise.
See also:
ReadPGM(), WritePPM(), WritePNG()

bool WritePGM CMotion2DImage< unsigned char >    I,
const char *    filename
 

Write the content of the bitmap in the file which name is given by filename. This function writes a portable gray pixmap (PGM P5) file.

Returns:
false if an error occurs, or true otherwise.
See also:
ReadPGM(), WritePPM(), WritePNG()
Examples:
Motion2D.cpp.

bool WritePPM CMotion2DImage< short >    I,
const char *    filename
 

Write the content of the bitmap in the file which name is given by filename. This function writes a portable pixmap (PPM P5) file.

Warning:
The resulted PPM P6 image is a gray level image.
Returns:
false if an error occurs, or true otherwise.
See also:
ReadPPM(), WritePGM(), WritePNG()

bool WritePPM CMotion2DImage< unsigned char >    I,
const char *    filename
 

Write the content of the bitmap in the file which name is given by filename. This function writes a portable pixmap (PPM P5) file.

Warning:
The resulted PPM P6 image is a gray level image.
Returns:
false if an error occurs, or true otherwise.
See also:
ReadPPM(), WritePGM(), WritePNG()


Motion2D is Copyright © 1995-2005 by Inria
This documentation was generated on 31 Jan 2005 by Fabien Spindler for Motion2D 1.3.11 using doxygen1.2.18 written by Dimitri van Heesch, © 1997-2005