LTI-Lib latest version v1.9 - last update 24 Nov 2005
Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

lti::ioFunctor Class Reference

Base class to all io functors. More...

#include <ltiIOFunctor.h>

Inheritance diagram for lti::ioFunctor:

Inheritance graph
[legend]
Collaboration diagram for lti::ioFunctor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ioFunctor ()
 ioFunctor (const parameters &theParam)
 ioFunctor (const std::string &theFilename)
virtual ~ioFunctor ()
const parametersgetParameters () const
virtual bool apply (image &theImage)
virtual bool apply (channel8 &theChannel, lti::palette &colors)
virtual int apply (image &theImage, channel8 &theChannel, lti::palette &colors)
virtual bool apply (const image &theImage)
virtual bool apply (const channel &theChannel)
virtual bool apply (const channel8 &theChannel, const lti::palette &colors=emptyPalette)
virtual bool save (const std::string &filename, const image &theImage)
virtual bool save (const std::string &filename, const channel8 &theChannel, const lti::palette &colors=emptyPalette)
virtual bool load (const std::string &filename, image &theImage)
virtual bool load (const std::string &filename, channel8 &theChannel, lti::palette &colors)
virtual const char * getTypeName () const

Classes

class  parameters
 ioFunctor parameters class More...

Detailed Description

Base class to all io functors.

All functors to load and save images are considered io functors.

This is an abstract class and therefore no instances of this class should exist!


Constructor & Destructor Documentation

lti::ioFunctor::ioFunctor  )  [inline]
 

default constructor

lti::ioFunctor::ioFunctor const parameters theParam  ) 
 

constructor, sets the parameters

lti::ioFunctor::ioFunctor const std::string &  theFilename  ) 
 

constructor, sets the filename

virtual lti::ioFunctor::~ioFunctor  )  [virtual]
 

destructor


Member Function Documentation

virtual bool lti::ioFunctor::apply const channel8 theChannel,
const lti::palette colors = emptyPalette
[inline, virtual]
 

save 8-bit channel with the given color palette.

Parameters:
theChannel the channel to be saved
colors if a color palette is given, theChannel will be considered to contain indices to this palette. If nothing (or an empty palette) is given, theChannel will be considered as a gray valued channel.
Returns:
false if error, otherwise true

Reimplemented in lti::saveImage, lti::saveBMP, and lti::savePNG.

virtual bool lti::ioFunctor::apply const channel theChannel  )  [inline, virtual]
 

save float channel

Parameters:
theChannel channel to be stored. This channel must contain values between 0.0f and 1.0f.
Returns:
false if error, otherwise true

Reimplemented in lti::saveImage, lti::saveBMP, lti::saveJPEG, and lti::savePNG.

virtual bool lti::ioFunctor::apply const image theImage  )  [inline, virtual]
 

save image.

The file name is specified in the parameters.

Parameters:
theImage the image to be stored.
Returns:
false if error, otherwise true

Reimplemented in lti::saveImage, lti::saveBMP, lti::saveJPEG, and lti::savePNG.

virtual int lti::ioFunctor::apply image theImage,
channel8 theChannel,
lti::palette colors
[inline, virtual]
 

this method loads an image or a channel8, depending on the contents of the file header.

if the number of bits per pixel is 24, the image will be initialized, if the number of bits is less or equal 8, the channel and palette will be initialized.

If the file contains an indexed image, the palette will contain the corresponding colors. If the file contains a "true color" image, the palette will have size 0.

Parameters:
theImage if the file contains a 24-bit image, this parameter will be initialized
theChannel if the channel contains an 8-bit image, this parameters will contain the readed data
colors if the channel was loaded this parameter will contain the used colors.
Returns:
the number of bits per pixel of the loaded image or 0 if an error occured. The valid values are 1, 4, 8, or 24

Reimplemented in lti::loadBMP.

virtual bool lti::ioFunctor::apply channel8 theChannel,
lti::palette colors
[inline, virtual]
 

load Channel Use this method if you know that the file contains a gray valued image.

Parameters:
theChannel the image on the file will be loaded here
colors theChannel contains just indexes to the pixel values in this palette (vector or rgbPixel).
Returns:
true if successful, false otherwise.

Reimplemented in lti::loadImage, lti::loadBMP, lti::loadImageList, and lti::loadPNG.

virtual bool lti::ioFunctor::apply image theImage  )  [inline, virtual]
 

load Image

Parameters:
theImage the file specified in the parameters will be loaded in this image. Note that independently of the sort of image in the file, this will always be converted to a color lti::image.
Returns:
a reference to the loaded image.

Reimplemented in lti::loadImage, lti::loadBMP, lti::loadJPEG, lti::loadImageList, and lti::loadPNG.

const parameters& lti::ioFunctor::getParameters  )  const
 

returns current parameters.

Reimplemented from lti::functor.

Reimplemented in lti::ioImage, lti::ioBMP, lti::configFileHandler, lti::ioJPEG, lti::lncFeatureFile, lti::saveLnc, lti::loadImageList, lti::loadVectorImageList, lti::ioLTI, lti::ioPNG, lti::uciDataReader, and lti::uciDataWriter.

virtual const char* lti::ioFunctor::getTypeName  )  const [virtual]
 

returns the name of this type

Reimplemented from lti::functor.

Reimplemented in lti::ioImage, lti::loadImage, lti::saveImage, lti::ioBMP, lti::loadBMP, lti::saveBMP, lti::configFileHandler, lti::ioJPEG, lti::loadJPEG, lti::saveJPEG, lti::loadImageList, lti::loadVectorImageList, lti::ioLTI, lti::loadLTI, lti::saveLTI, lti::ioPNG, lti::loadPNG, lti::savePNG, lti::uciDataReader, and lti::uciDataWriter.

virtual bool lti::ioFunctor::load const std::string &  filename,
channel8 theChannel,
lti::palette colors
[inline, virtual]
 

shortcut for load image.

Use this method if you know that the file contains a gray valued image.

Parameters:
filename name of the file to be readed
theChannel variable where the image will be stored
colors the palette used will be stored here

Reimplemented in lti::loadImage, lti::loadBMP, and lti::loadPNG.

virtual bool lti::ioFunctor::load const std::string &  filename,
image theImage
[inline, virtual]
 

shortcut for load image

Parameters:
filename name of the file to be readed
theImage variable where the image will to be stored

Reimplemented in lti::loadImage, lti::loadBMP, lti::loadJPEG, and lti::loadPNG.

virtual bool lti::ioFunctor::save const std::string &  filename,
const channel8 theChannel,
const lti::palette colors = emptyPalette
[inline, virtual]
 

this will save a channel8

Parameters:
filename name of the destination file
theChannel the channel to be save
colors the palette to be used

Reimplemented in lti::saveImage, lti::saveBMP, and lti::savePNG.

virtual bool lti::ioFunctor::save const std::string &  filename,
const image theImage
[inline, virtual]
 

this will save an image as a 24 bit RGB image

Reimplemented in lti::saveImage, lti::saveBMP, lti::saveJPEG, and lti::savePNG.


The documentation for this class was generated from the following file:
Generated on Thu Nov 24 16:52:56 2005 for LTI-Lib by Doxygen 1.4.4