LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::saveLTI Class Reference

Functor to save a bitmap (LTI) file. More...

#include <ltiLTIFunctor.h>

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

List of all members.

Public Member Functions

 saveLTI ()
 ~saveLTI ()
virtual const char * getTypeName () const
virtual functorclone () 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).

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

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>).

Parameters:
theChannel matrix to be stored.


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)

Detailed Description

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
See also:
ioLTI::parameters

Constructor & Destructor Documentation

lti::saveLTI::saveLTI (  ) 

default constructor

lti::saveLTI::~saveLTI (  )  [inline]

destructor


Member Function Documentation

bool lti::saveLTI::apply ( const dmatrix theChannel  ) 

This will save a matrix in the appropriate file format.

Parameters:
filename the name of the file which will receive the matrix
theImage the matrix to be written
Returns:
true, iff the matrix could be saved successfully
bool lti::saveLTI::apply ( const imatrix theChannel  ) 

This will save a matrix in the appropriate file format.

Parameters:
filename the name of the file which will receive the matrix
theImage the matrix to be written
Returns:
true, iff the matrix could be saved successfully
bool lti::saveLTI::apply ( const matrix< ubyte > &  theChannel  ) 

This will save a matrix in the appropriate file format.

Parameters:
filename the name of the file which will receive the matrix
theImage the matrix to be written
Returns:
true, iff the matrix could be saved successfully
bool lti::saveLTI::apply ( const fmatrix theChannel  ) 

This will save a matrix in the appropriate file format.

Parameters:
filename the name of the file which will receive the matrix
theImage the matrix to be written
Returns:
true, iff the matrix could be saved successfully
bool lti::saveLTI::apply ( const matrix< rgbPixel > &  theChannel  ) 

This will save a matrix in the appropriate file format.

Parameters:
filename the name of the file which will receive the matrix
theImage the matrix to be written
Returns:
true, iff the matrix could be saved successfully
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 matrix< ubyte > &  theImage 
)

This will save a matrix in the appropriate file format.

Parameters:
filename the name of the file which will receive the matrix
theImage the matrix to be written
Returns:
true, iff the matrix could be saved successfully
bool lti::saveLTI::save ( const std::string &  filename,
const fmatrix theImage 
)

This will save a matrix in the appropriate file format.

Parameters:
filename the name of the file which will receive the matrix
theImage the matrix to be written
Returns:
true, iff the matrix could be saved successfully
bool lti::saveLTI::save ( const std::string &  filename,
const dmatrix theImage 
)

This will save a matrix in the appropriate file format.

Parameters:
filename the name of the file which will receive the matrix
theImage the matrix to be written
Returns:
true, iff the matrix could be saved successfully
bool lti::saveLTI::save ( const std::string &  filename,
const imatrix theImage 
)

This will save a matrix in the appropriate file format.

Parameters:
filename the name of the file which will receive the matrix
theImage the matrix to be written
Returns:
true, iff the matrix could be saved successfully
bool lti::saveLTI::save ( const std::string &  filename,
const matrix< rgbPixel > &  theImage 
)

This will save a matrix in the appropriate file format.

Parameters:
filename the name of the file which will receive the matrix
theImage the matrix to be written
Returns:
true, iff the matrix could be saved successfully

The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:28:05 2010 for LTI-Lib by Doxygen 1.6.1