latest version v1.9 - last update 10 Apr 2010 |
Base class to all io functors. More...
#include <ltiIOFunctor.h>
Classes | |
class | parameters |
ioFunctor parameters class More... | |
Public Member Functions | |
ioFunctor () | |
ioFunctor (const parameters &theParam) | |
ioFunctor (const std::string &theFilename) | |
virtual | ~ioFunctor () |
const parameters & | getParameters () const |
virtual bool | apply (image &) |
virtual bool | apply (channel8 &, lti::palette &) |
virtual int | apply (image &, channel8 &, lti::palette &) |
virtual bool | apply (const image &) |
virtual bool | apply (const channel &) |
virtual bool | apply (const channel8 &, const lti::palette &=emptyPalette) |
virtual bool | save (const std::string &, const image &) |
virtual bool | save (const std::string &, const channel8 &, const lti::palette &=emptyPalette) |
virtual bool | load (const std::string &, image &) |
virtual bool | load (const std::string &, channel8 &, lti::palette &) |
virtual const char * | getTypeName () const |
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!
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
virtual bool lti::ioFunctor::apply | ( | const channel8 & | , | |
const lti::palette & | = emptyPalette | |||
) | [inline, virtual] |
save 8-bit channel with the given color palette.
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. |
Reimplemented in lti::saveImage, lti::saveBMP, and lti::savePNG.
virtual bool lti::ioFunctor::apply | ( | const channel & | ) | [inline, virtual] |
save float channel
theChannel | channel to be stored. This channel must contain values between 0.0f and 1.0f. |
Reimplemented in lti::saveImage, lti::saveBMP, lti::saveJPEG, and lti::savePNG.
virtual bool lti::ioFunctor::apply | ( | const image & | ) | [inline, virtual] |
save image.
The file name is specified in the parameters.
theImage | the image to be stored. |
Reimplemented in lti::saveImage, lti::saveBMP, lti::saveJPEG, and lti::savePNG.
virtual int lti::ioFunctor::apply | ( | image & | , | |
channel8 & | , | |||
lti::palette & | ||||
) | [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.
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. |
Reimplemented in lti::loadBMP.
virtual bool lti::ioFunctor::apply | ( | channel8 & | , | |
lti::palette & | ||||
) | [inline, virtual] |
load Channel Use this method if you know that the file contains a gray valued image.
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). |
Reimplemented in lti::loadImage, lti::loadBMP, lti::loadImageList, and lti::loadPNG.
virtual bool lti::ioFunctor::apply | ( | image & | ) | [inline, virtual] |
load Image
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. |
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 & | , | |
channel8 & | , | |||
lti::palette & | ||||
) | [inline, virtual] |
shortcut for load image.
Use this method if you know that the file contains a gray valued image.
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 & | , | |
image & | ||||
) | [inline, virtual] |
shortcut for load image
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 & | , | |
const channel8 & | , | |||
const lti::palette & | = emptyPalette | |||
) | [inline, virtual] |
this will save a channel8
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 & | , | |
const image & | ||||
) | [inline, virtual] |
this will save an image as a 24 bit RGB image
Reimplemented in lti::saveImage, lti::saveBMP, lti::saveJPEG, and lti::savePNG.