Vista     Main Page   Class List   Function List   File List   Examples  


CImageReader Class Reference

The CImageReader class implements an image reader. More...

Inheritance diagram for CImageReader:

CReader List of all members.

Public Methods

 ~CImageReader ()
string getFileName ()
bool getFrame (CMotion2DImage< unsigned char > &I, unsigned nbsubsample, unsigned nrows=0, unsigned ncols=0)
bool getFrame (CMotion2DImage< short > &I, unsigned nbsubsample, unsigned nrows=0, unsigned ncols=0)
bool openStream ()
bool closeStream ()
void getType ()
EReaderFormat getFormat ()
unsigned getNbSubsample ()

Detailed Description

The CImageReader class implements an image reader.

Image reading manipulations are restricted and only supported for PNG (see ReadPNG() function), RAW and PNM file format. We support RAW 8 bits (for graylevel images between 0 and 255, see ReadRAW8()), and RAW 16 bits (for graylevel images between 0 and 65534, see ReadRAW16()) image format. The different PNM formats are PGM P5 (see function ReadPGM()) and PPM P6 (see function ReadPPM()). To know more about this image file format: man png, man pgm or man ppm.

Examples:

Motion2D.cpp, and Warping.cpp.


Constructor & Destructor Documentation

CImageReader::~CImageReader  
 

Image reader destructor.


Member Function Documentation

bool CImageReader::closeStream   [inline, virtual]
 

Close an image or video stream.

Reimplemented from CReader.

string CImageReader::getFileName   [virtual]
 

Compute and return the image filename.

See also:
setFileName(), setFrameNumber()

Reimplemented from CReader.

CReader::EReaderFormat CImageReader::getFormat   [virtual]
 

Return the reader image file format.

Reimplemented from CReader.

bool CImageReader::getFrame CMotion2DImage< short > &    I,
unsigned    nbsubsample,
unsigned    nrows = 0,
unsigned    ncols = 0
[virtual]
 

Read an image from a file. Only PNG, PNM (PGM P5 and PPM P6), RAW 8 bits and RAW 16 bits image format are implemented. The considered format depends on the filename extension. Color images are converted in grey level using the formula:

Depending on the nbsubsample parameter, the extracted frame can be subsampled.

Parameters:
I  The grey level image eventually subsampled.
nbsubsample  The number of subsampling to apply to the image. No subsampling is performed if this parameter is equal to zero.
nrows  Specify the number of rows for images in RAW8 or RAW16 format. Other image format are not concerned by this parameter.
ncols  Specify the number of columns for images in RAW8 or RAW16 format. Other image format are not concerned by this parameter.
Returns:
true if the frame was extracted, false otherwise.

Reimplemented from CReader.

bool CImageReader::getFrame CMotion2DImage< unsigned char > &    I,
unsigned    nbsubsample,
unsigned    nrows = 0,
unsigned    ncols = 0
[virtual]
 

Read an image from a file. Only PNG, PNM (PGM P5 and PPM P6) and RAW 8 bits image format are implemented. The considered format depends on the filename extension. Color images are converted in grey level using the formula:

Depending on the nbsubsample parameter, the extracted frame can be subsampled.

Parameters:
I  The grey level image eventually subsampled.
nbsubsample  The number of subsampling to apply to the image. No subsampling is performed if this parameter is equal to zero.
nrows  Specify the number of rows for images in RAW8 format. Other image format are not concerned by this parameter.
ncols  Specify the number of columns for images in RAW8 format. Other image format are not concerned by this parameter.
Returns:
true if the frame was extracted, false otherwise.

Reimplemented from CReader.

unsigned CImageReader::getNbSubsample   [virtual]
 

Returns:
The number of subsampling applied to the image. If no subsampling is performed, this parameter is equal to zero.

Reimplemented from CReader.

void CImageReader::getType   [inline, virtual]
 

Print the type of the reader.

Reimplemented from CReader.

bool CImageReader::openStream   [inline, virtual]
 

Open an image or video stream.

Reimplemented from CReader.


The documentation for this class was generated from the following files:
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