WXP C++ Library Version 6.74.9
|
This class reads and writes image files. More...
#include "../include/ImgWxpFile.h"
Public Types | |
enum | Type { UNK , IMG , IMGZ } |
Public Member Functions | |
ImgWxpFile () | |
int | setVer (int v) |
int | open (const char *filename, int raccess, int rtype) |
int | open (const char *filename, int raccess) |
int | open (const char *filename) |
bool | isOpen () |
int | close () |
int | read (Image &image) |
int | readHeader (Image &image) |
int | readData (Image &image) |
int | read (const char *filename, Image &image) |
int | write (Image &image) |
int | write (const char *filename, int rtype, Image &image) |
This class reads and writes image files.
ImgWxpFile::ImgWxpFile | ( | ) |
Constructor. Initializes class values
int ImgWxpFile::close | ( | ) |
bool ImgWxpFile::isOpen | ( | ) |
int ImgWxpFile::open | ( | const char * | filename | ) |
Opens a file for read (unknown type)
filename | File to open |
References open(), WXP::FileAttr::READ, and UNK.
int ImgWxpFile::open | ( | const char * | filename, |
int | raccess | ||
) |
Opens a file (unknown type)
filename | File to open |
raccess | File access (FileAttr::READ, FileAttr::WRITE) |
int ImgWxpFile::open | ( | const char * | filename, |
int | raccess, | ||
int | rtype | ||
) |
Opens an image file
filename | File to open |
raccess | Access to the file (FileAttr::READ, FileAttr::WRITE) |
rtype | Type of image file (UNK, IMG, IMGZ, GIF, PNG) |
References WXP::File::close(), WXP::StrLib::equal(), IMG, WXP::File::isOpen(), WXP::File::open(), WXP::File::read(), WXP::FileAttr::READ, and WXP::FileAttr::WRITE.
Referenced by open(), open(), WXP::ImageFile::open(), WXP::SatFile::open(), read(), and write().
int ImgWxpFile::read | ( | const char * | filename, |
Image & | image | ||
) |
int ImgWxpFile::read | ( | Image & | image | ) |
Reads in a WXP formatted image file
image | Image class to put satellite image |
References WXP::File::isOpen(), readData(), and readHeader().
Referenced by read(), WXP::SatFile::read(), and WXP::ImageFile::read().
int ImgWxpFile::readData | ( | Image & | image | ) |
Reads a WXP image file
image | Image class to put data into |
References WXP::Image::allocData(), WXP::File::close(), WXP::Zlib::decomp(), WXP::Zlib::finish(), WXP::Zlib::getAvailIn(), WXP::Zlib::getAvailOut(), WXP::Zlib::isError(), WXP::File::isOpen(), WXP::Zlib::print(), WXP::File::read(), WXP::File::scanf(), WXP::Zlib::set(), and WXP::Image::setPixel().
Referenced by read().
int ImgWxpFile::readHeader | ( | Image & | image | ) |
Reads a WXP image file
image | Image class to put data into |
References WXP::DomainVal::clat, WXP::DomainVal::clon, WXP::DateTool::decode(), WXP::DomainTool::decode(), WXP::DomainVal::dx, WXP::DomainVal::dy, WXP::StrLib::equal(), WXP::File::getLine(), WXP::StrLib::iequal(), WXP::StrLib::index(), WXP::Image::init(), WXP::Domain::LAMB, WXP::Domain::LATLON, WXP::StrLib::length(), WXP::Domain::MERC, WXP::DomainVal::nx, WXP::DomainVal::ny, WXP::DomainVal::param, WXP::DomainVal::plat, WXP::DomainVal::plon, WXP::DomainVal::proj, WXP::Domain::PSTEREO, WXP::Domain::SAT, WXP::File::scanf(), WXP::Image::set(), and WXP::StrLib::trimWS().
Referenced by WXP::SatFile::getHeader(), and read().
int ImgWxpFile::setVer | ( | int | v | ) |
int ImgWxpFile::write | ( | const char * | filename, |
int | rtype, | ||
Image & | image | ||
) |
Writes an image to file
filename | File to write to |
rtype | Type of file to write (IMG, IMGZ, GIF, PNG) |
image | Image class to write to file |
References open(), WXP::FileAttr::WRITE, and write().
int ImgWxpFile::write | ( | Image & | image | ) |
Writes a WXP image file
image | Image class to write to file |
References WXP::File::close(), WXP::Zlib::comp(), WXP::Zlib::COMP, WXP::Zlib::finish(), WXP::Zlib::FINISH, WXP::String::get(), WXP::Domain::getCLat(), WXP::Domain::getCLon(), WXP::Domain::getDx(), WXP::Domain::getDy(), WXP::Domain::getNx(), WXP::Domain::getNy(), WXP::Domain::getParam(), WXP::Image::getPixel(), WXP::Domain::getPLat(), WXP::Domain::getPLon(), WXP::Domain::getProj(), WXP::Zlib::getTotalOut(), IMG, IMGZ, WXP::Zlib::init(), WXP::File::isOpen(), WXP::Domain::LAMB, WXP::Domain::LATLON, WXP::Domain::MERC, WXP::Const::MISS, WXP::File::printf(), WXP::Domain::PSTEREO, WXP::Domain::SAT, WXP::Zlib::set(), WXP::Domain::toString(), and WXP::File::write().
Referenced by write(), and WXP::ImageFile::write().