Vista     Main Page   Class List   Function List   File List   Examples  


Motion2DImage_PNG.cpp File Reference

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

#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <CMotion2DImage.h>
#include <Motion2DImage_PNG.h>
#include <png.h>
#include "readpng.h"
#include "writepng.h"

Functions

int ReadPNG (CMotion2DImage< unsigned char > &I, const char *filename)
int ReadPNG (CMotion2DImage< short > &I, const char *filename)
int WritePNG (CMotion2DImage< unsigned char > &I, const char *filename)
int WritePNG (CMotion2DImage< short > &I, const char *filename)


Detailed Description

Definition of PNG image format input/output functions.


Function Documentation

int ReadPNG CMotion2DImage< short > &    I,
const char *    filename
 

Read the contents of the PNG 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.

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:
ReadPGM(), ReadPPM(), WritePNG()

int ReadPNG CMotion2DImage< unsigned char > &    I,
const char *    filename
 

Read the contents of the PNG 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.

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:
ReadPGM(), ReadPPM(), WritePNG()

int WritePNG 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 PNG file.

Warning:
The resulted PNG image is a gray level image.
Returns:
false if an error occurs, or true otherwise.
See also:
ReadPNG(), WritePGM(), WritePPM()

int WritePNG 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 PNG file.

Warning:
The resulted PNG image is a gray level image.
Returns:
false if an error occurs, or true otherwise.
See also:
ReadPNG(), WritePGM(), WritePPM()


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