|
WXP C++ Library Version 6.74.9
|
This class reads and write PNG image files. More...
#include "../include/PngFile.h"
Public Member Functions | |
| PngFile () | |
| ~PngFile () | |
| int | init () |
| PngFile (const char *filename, int access) | |
| int | open (const char *filename, int access) |
| bool | isOpen () |
| int | close () |
| int | setInterlace (int val) |
| int | setTitle (const char *str) |
| int | setComment (const char *str) |
| int | read (Image &image) |
| int | read (const char *filename, Image &image) |
| int | write (Image &image) |
| int | write (const char *filename, Image &image) |
This class reads and write PNG image files.
| PngFile::PngFile | ( | ) |
Constructor
References init().
| PngFile::~PngFile | ( | ) |
Destructor
| PngFile::PngFile | ( | const char * | filename, |
| int | raccess ) |
Constructor. Opens the file
| filename | PNG filename |
| raccess | Access (FileAttr:READ, FileAttr::WRITE) |
| int PngFile::close | ( | ) |
Closes the file
Referenced by read().
| bool PngFile::isOpen | ( | ) |
Returns true if file open
| int PngFile::open | ( | const char * | filename, |
| int | raccess ) |
Opens the file
| filename | PNG filename |
| raccess | Access (FileAttr:READ, FileAttr::WRITE) |
References WXP::FileAttr::READ, and WXP::FileAttr::WRITE.
| int PngFile::read | ( | const char * | filename, |
| Image & | image ) |
Reads in an image from file
| filename | The image filename |
| image | The output image |
References open(), WXP::FileAttr::READ, and read().
| int PngFile::read | ( | Image & | image | ) |
Reads the image from an open file
| image | The output image |
References WXP::Image::allocColors(), WXP::Image::allocData(), close(), WXP::DateTool::decode(), WXP::DomainTool::decode(), WXP::Strings::equal(), WXP::StrLib::equal(), WXP::Strings::getNum(), WXP::Strings::getString(), WXP::Wxp::outDebug(), WXP::Image::setBlu(), WXP::Image::setGrn(), WXP::Image::setPixel(), and WXP::Image::setRed().
Referenced by read().
| int PngFile::setComment | ( | const char * | str | ) |
| int PngFile::setInterlace | ( | int | val | ) |
Set up interlacing (not used)
| val | Interlace type |
| int PngFile::setTitle | ( | const char * | str | ) |
Sets a title to be attached to the image file
| str | Image title |
References WXP::StrLib::copy().
| int PngFile::write | ( | const char * | filename, |
| Image & | image ) |
Writes an image to a file.
| filename | The output filename |
| image | Image to write |
References open(), WXP::FileAttr::WRITE, and write().
| int PngFile::write | ( | Image & | image | ) |
Writes an image to an open file. In addition, the info label, date/time and domain information will be saved in a text string in the file.
| image | Image to write |
References WXP::StrLib::acopy(), WXP::StrLib::copy(), WXP::DateTool::getCurrent(), WXP::Image::getPixel(), WXP::Image::getRow(), WXP::Const::MISS, WXP::Wxp::outDebug(), WXP::ImageMath::toIndex(), WXP::Domain::toString(), and WXP::StrLib::valid().
Referenced by write().