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

lti::savePNG Class Reference

Functor to save a Protable Network graphic (PNG) file. More...

#include <ltiPNGFunctor.h>

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

List of all members.

Public Member Functions

 savePNG ()
 ~savePNG ()
virtual const char * getTypeName () const
bool apply (const image &theImage)
bool apply (const channel &theChannel)
bool apply (const channel8 &theChannel, const lti::palette &colors=emptyPalette)
bool save (const std::string &filename, const image &theImage)
bool save (const std::string &filename, const channel8 &theChannel, const lti::palette &colors=emptyPalette)
bool save (const std::string &filename, const channel &theChannel)
virtual functorclone () const

Detailed Description

Functor to save a Protable Network graphic (PNG) file.

To save a PNG image just initialize the parameters of the "savePNG" object and call the apply member.

Example:

 lti::image anImg;                      // an image
 ...
 lti::savePNG saveImg;                  // the save functor
 lti::savePNG::parameters param;        // functor parameters
 param.filename = "~/tmp/theFile.png";  // name of the PNG file
 saveImg.setParameters(param);          // set the functor parameters
 saveImg.apply(anImg);                  // save the file

You can also use the more confortable shortcut:

 lti::image anImg;                      // an image
 ...
 lti::savePNG saveImg;                  // the save functor
 saveImg.save("~/tmp/theFile.png",img); // save the image.
See also:
loadPNG
image
savePNG::parameters

Constructor & Destructor Documentation

lti::savePNG::savePNG (  ) 

default constructor

lti::savePNG::~savePNG (  ) 

destructor


Member Function Documentation

bool lti::savePNG::apply ( const channel8 theChannel,
const lti::palette colors = emptyPalette 
) [virtual]

save 8-bit channel as 24-bbit RGB by assigning each R, G and B the same grey-value

Reimplemented from lti::ioFunctor.

bool lti::savePNG::apply ( const channel theChannel  )  [virtual]

save float channel as grey image

Reimplemented from lti::ioFunctor.

bool lti::savePNG::apply ( const image theImage  )  [virtual]

save image as PNG

Reimplemented from lti::ioFunctor.

virtual functor* lti::savePNG::clone (  )  const [virtual]

returns a pointer to a clone of the functor.

Implements lti::functor.

virtual const char* lti::savePNG::getTypeName (  )  const [virtual]

returns the name of this type

Reimplemented from lti::ioPNG.

bool lti::savePNG::save ( const std::string &  filename,
const channel theChannel 
)

save a channel as a grey image (0 = Black, 1 = White) the given color palette

bool lti::savePNG::save ( const std::string &  filename,
const channel8 theChannel,
const lti::palette colors = emptyPalette 
) [virtual]

save an "indexed" image contained in the given channel8 (indices) and the given color palette

Reimplemented from lti::ioFunctor.

bool lti::savePNG::save ( const std::string &  filename,
const image theImage 
) [virtual]

this will save an image as a 24 bit RGB bitmap image

Reimplemented from lti::ioFunctor.


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

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