WXP C++ Library Version 6.74.9
|
This class reads and writes image files. More...
#include "../include/ImageFile.h"
Public Types | |
enum | Type { UNK , IMG , IMGZ , TIFF , GIF , PNG , GINIP } |
Public Member Functions | |
ImageFile () | |
int | setVer (int v) |
int | open (const char *filename, int raccess, int rtype) |
int | open (const char *filename, int raccess, const char *rtype) |
int | open (const char *filename, int raccess) |
int | open (const char *filename) |
bool | isOpen () |
int | close () |
int | getType (const char *str) |
int | read (Image &image) |
int | read (const char *filename, Image &image) |
int | write (Image &image) |
int | write (const char *filename, int rtype, Image &image) |
int | write (const char *filename, Image &image) |
Static Public Member Functions | |
static int | checkType (const char *filename) |
static int | checkFilename (const char *filename) |
This class reads and writes image files.
enum WXP::ImageFile::Type |
ImageFile::ImageFile | ( | ) |
Constructor. Initializes class values
References UNK.
|
static |
|
static |
Checks the type of data in the file based on contents
filename | File to check |
References WXP::File::close(), WXP::StrLib::equal(), GIF, IMG, WXP::File::isOpen(), PNG, WXP::File::read(), TIFF, and UNK.
Referenced by open().
int ImageFile::close | ( | ) |
Closes the file
References WXP::GifFile::close(), WXP::GiniFile::close(), WXP::ImgWxpFile::close(), WXP::PngFile::close(), WXP::TiffFile::close(), GIF, GINIP, IMG, IMGZ, PNG, and TIFF.
int ImageFile::getType | ( | const char * | str | ) |
|
inline |
Returns if file is open or not
Referenced by WXP::ImagePlot::draw(), WXP::RadPlot::draw(), and WXP::ImagePlot::getDomain().
int ImageFile::open | ( | const char * | filename | ) |
Opens a file for read (unknown type)
filename | File to open |
References open(), WXP::FileAttr::READ, and UNK.
int ImageFile::open | ( | const char * | filename, |
int | raccess | ||
) |
Opens a file (unknown type)
filename | File to open |
raccess | File access (FileAttr::READ, FileAttr::WRITE) |
int ImageFile::open | ( | const char * | filename, |
int | access, | ||
const char * | rtype | ||
) |
Opens a image file
filename | File to open |
access | Access (File::READ, File::WRITE) |
rtype | File type (unk, img, imgz, gif, png) |
int ImageFile::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 checkFilename(), checkType(), GIF, GINIP, IMG, WXP::ImgWxpFile::IMG, IMGZ, WXP::ImgWxpFile::IMGZ, WXP::GifFile::isOpen(), WXP::GiniFile::isOpen(), WXP::ImgWxpFile::isOpen(), WXP::PngFile::isOpen(), WXP::TiffFile::isOpen(), WXP::GifFile::open(), WXP::PngFile::open(), WXP::TiffFile::open(), WXP::ImgWxpFile::open(), WXP::GiniFile::open(), PNG, WXP::FileAttr::READ, TIFF, UNK, and WXP::FileAttr::WRITE.
Referenced by WXP::ImagePlot::draw(), WXP::RadPlot::draw(), WXP::ImagePlot::getDomain(), open(), open(), open(), read(), write(), and write().
int ImageFile::read | ( | const char * | filename, |
Image & | image | ||
) |
int ImageFile::read | ( | Image & | image | ) |
Reads an image from the file
image | Image class to put file data into |
References GIF, GINIP, IMG, IMGZ, PNG, WXP::FileAttr::READ, WXP::GiniFile::read(), WXP::GifFile::read(), WXP::ImgWxpFile::read(), WXP::PngFile::read(), WXP::TiffFile::read(), and TIFF.
Referenced by WXP::ImagePlot::draw(), WXP::RadPlot::draw(), WXP::ImagePlot::getDomain(), and read().
int ImageFile::setVer | ( | int | v | ) |
Sets the version number of data
v | The version |
References WXP::ImgWxpFile::setVer().
int ImageFile::write | ( | const char * | filename, |
Image & | image | ||
) |
int ImageFile::write | ( | const char * | filename, |
int | rtype, | ||
Image & | image | ||
) |
int ImageFile::write | ( | Image & | image | ) |
Writes an image to file
image | Image to write |
References GIF, GINIP, IMG, IMGZ, PNG, WXP::FileAttr::WRITE, WXP::GiniFile::write(), WXP::GifFile::write(), WXP::ImgWxpFile::write(), and WXP::PngFile::write().