latest version v1.9 - last update 10 Apr 2010 |
Functor to save a bitmap (LTI) file. More...
#include <ltiLTIFunctor.h>
Public Member Functions | |||||||
saveLTI () | |||||||
~saveLTI () | |||||||
virtual const char * | getTypeName () const | ||||||
virtual functor * | clone () const | ||||||
Apply methods. | |||||||
save image as LTI. Note that if the parameters contain a number of bits per pixels less than 24 (this means 8, 4 or 1)(see lti::ioLTI::parameters), this method will apply a quantization algorithm, which will reduce the number of used colors as requested. This is very time consuming! For 24 images this method is relativly fast. For a faster 8-bit LTI use the method apply(const channel8&,const lti::palette).
Save matrix of any type. There is a template implementation for the types image (matrix<rgbPixel>), imatrix (matrix<int>), channel (matrix<float>) and channel8 (matrix<ubyte>).
| |||||||
bool | apply (const matrix< rgbPixel > &theChannel) | ||||||
bool | apply (const fmatrix &theChannel) | ||||||
bool | apply (const matrix< ubyte > &theChannel) | ||||||
bool | apply (const imatrix &theChannel) | ||||||
bool | apply (const dmatrix &theChannel) | ||||||
bool | save (const std::string &filename, const matrix< rgbPixel > &theImage) | ||||||
bool | save (const std::string &filename, const imatrix &theImage) | ||||||
bool | save (const std::string &filename, const dmatrix &theImage) | ||||||
bool | save (const std::string &filename, const fmatrix &theImage) | ||||||
bool | save (const std::string &filename, const matrix< ubyte > &theImage) |
Functor to save a bitmap (LTI) file.
To save a LTI image just initialize the parameters of the "%saveLTI" object and call the apply member, or use one of the shortcuts.
Example:
lti::image anImg; // an image lti::channel8 aChnl; // an 8-bit Channel ... lti::saveLTI saveImg; // the save functor // save the image as a 24 bit bitmap file: saveImg.save("/tmp/theFile.lti",anImg); // save the channel as a 8 bit bitmap file: saveImg.save("/the/theChnl8.lti",aChnl); // save the channel as a 24 bit bitmap file: lti::saveLTI::parameters param; // functor parameters param.filename = "~/tmp/theChnl24.lti"; // name of the LTI file param.bitsPerPixel = 24; // use 24 bits! saveImg.setParameters(param); // set the functor parameters saveImg.apply(aChnl); // save the channel
lti::saveLTI::saveLTI | ( | ) |
default constructor
lti::saveLTI::~saveLTI | ( | ) | [inline] |
destructor
bool lti::saveLTI::apply | ( | const dmatrix & | theChannel | ) |
bool lti::saveLTI::apply | ( | const imatrix & | theChannel | ) |
bool lti::saveLTI::apply | ( | const fmatrix & | theChannel | ) |
virtual functor* lti::saveLTI::clone | ( | ) | const [virtual] |
returns a pointer to a clone of the functor.
Implements lti::functor.
virtual const char* lti::saveLTI::getTypeName | ( | ) | const [virtual] |
returns the name of this type
Reimplemented from lti::ioLTI.
bool lti::saveLTI::save | ( | const std::string & | filename, | |
const fmatrix & | theImage | |||
) |
bool lti::saveLTI::save | ( | const std::string & | filename, | |
const dmatrix & | theImage | |||
) |
bool lti::saveLTI::save | ( | const std::string & | filename, | |
const imatrix & | theImage | |||
) |