Vista     Main Page   Class List   Function List   File List   Examples  


Motion2DImage_RAW.h File Reference

Definition of RAW 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 ReadRAW8 (CMotion2DImage< unsigned char > &I, const char filename[FILENAME_MAX], unsigned nb_rows, unsigned nb_cols)
bool ReadRAW8 (CMotion2DImage< short > &I, const char filename[FILENAME_MAX], unsigned nb_rows, unsigned nb_cols)
bool ReadRAW16 (CMotion2DImage< short > &I, const char filename[FILENAME_MAX], unsigned nb_rows, unsigned nb_cols)
bool WriteRAW8 (CMotion2DImage< unsigned char > I, const char *filename)
bool WriteRAW8 (CMotion2DImage< short > I, const char *filename)
bool WriteRAW16 (CMotion2DImage< short > I, const char *filename)


Detailed Description

Definition of RAW image format input/output functions.

RAW file format images are simply made of the list of pixel values with no header. That is why the number of columns and of rows must be given by the user.

Two sets of functions exist, one for the traditional 8-bits images named RAW8 (see functions ReadRAW8() and WriteRAW8()), the other for 9 to 16 bits images named RAW16 (see functions ReadRAW16() and WriteRAW16()).


Function Documentation

bool ReadRAW16 CMotion2DImage< short > &    I,
const char    filename[FILENAME_MAX],
unsigned    nb_rows,
unsigned    nb_cols
 

Read the contents of the purely raw images (without header), allocate memory for the corresponding gray level image, convert the data in gray level, and set the bitmap with the gray level data. It process 16 bits data (level between 0 and 65534) 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:
ReadRAW8(), WriteRAW8(), WriteRAW16()
Returns:
false if an error occurs, or true otherwise.

bool ReadRAW8 CMotion2DImage< short > &    I,
const char    filename[FILENAME_MAX],
unsigned    nb_rows,
unsigned    nb_cols
 

Read the contents of the purely raw images (without header), allocate memory for the corresponding gray level image, convert the data in gray level, and set the bitmap with the gray level data. It process 8-bits data (graylevel between 0 and 255).

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.

Returns:
false if an error occurs, or true otherwise.
See also:
ReadRAW16(), WriteRAW8(), WriteRAW16()

bool ReadRAW8 CMotion2DImage< unsigned char > &    I,
const char    filename[FILENAME_MAX],
unsigned    nb_rows,
unsigned    nb_cols
 

Read the contents of the purely raw images (without header), allocate memory for the corresponding gray level image, convert the data in gray level, and set the bitmap with the gray level data. It process 8-bits data (graylevel between 0 and 255).

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.

Returns:
false if an error occurs, or true otherwise.
See also:
ReadRAW16(), WriteRAW8(), WriteRAW16()

bool WriteRAW16 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 RAW pixmap ("just a list of grayvalues") file without header.

It process 16 bits data (level between 0 and 65534).

Returns:
false if an error occurs, or true otherwise.
See also:
WriteRAW8(), ReadRAW8(), ReadRAW16(),

bool WriteRAW8 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 RAW pixmap ("just a list of grayvalues") file without header.

It process 8-bits data (graylevel between 0 and 255).

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:
WriteRAW16(), ReadRAW8(), ReadRAW16()

bool WriteRAW8 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 RAW pixmap ("just a list of grayvalues") file without header.

It process 8-bits data (graylevel between 0 and 255).

Returns:
false if an error occurs, or true otherwise.
See also:
WriteRAW16(), ReadRAW8(), ReadRAW16()


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