latest version v1.9 - last update 10 Apr 2010 |
Functor to save a Protable Network graphic (PNG) file. More...
#include <ltiPNGFunctor.h>
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 functor * | clone () const |
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.
lti::savePNG::savePNG | ( | ) |
default constructor
lti::savePNG::~savePNG | ( | ) |
destructor
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 | |||
) |
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.