WXP C++ Library Version 6.74.6
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
WXP::ImageFile Class Reference

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)
 

Detailed Description

This class reads and writes image files.

Author
Dan Vietor

Member Enumeration Documentation

◆ Type

Type of image file

Enumerator
UNK 

Unknown type

IMG 

Uncompressed WXP image

IMGZ 

Compressed WXP image

TIFF 

TIFF image

GIF 

GIF image

PNG 

PNG image

GINIP 

GINI PNG compressed image

Constructor & Destructor Documentation

◆ ImageFile()

ImageFile::ImageFile ( )

Constructor. Initializes class values

References UNK.

Member Function Documentation

◆ checkFilename()

int ImageFile::checkFilename ( const char *  filename)
static

Checks for the type of data in the file based on filename

Parameters
filenameThe file type

References GIF, GINIP, WXP::StrLib::iequal(), IMG, IMGZ, PNG, TIFF, and UNK.

Referenced by open().

◆ checkType()

int ImageFile::checkType ( const char *  filename)
static

Checks the type of data in the file based on contents

Parameters
filenameFile to check

References WXP::File::close(), WXP::StrLib::equal(), GIF, IMG, WXP::File::isOpen(), PNG, WXP::File::read(), TIFF, and UNK.

Referenced by open().

◆ close()

int ImageFile::close ( )

◆ getType()

int ImageFile::getType ( const char *  str)

Gets the satellite type based on string

Parameters
strThe type string

References WXP::StrLib::equal(), GIF, GINIP, IMG, IMGZ, PNG, TIFF, and UNK.

Referenced by open().

◆ isOpen()

bool WXP::ImageFile::isOpen ( )
inline

Returns if file is open or not

Referenced by WXP::ImagePlot::draw(), WXP::RadPlot::draw(), and WXP::ImagePlot::getDomain().

◆ open() [1/4]

int ImageFile::open ( const char *  filename)

Opens a file for read (unknown type)

Parameters
filenameFile to open

References open(), WXP::FileAttr::READ, and UNK.

◆ open() [2/4]

int ImageFile::open ( const char *  filename,
int  raccess 
)

Opens a file (unknown type)

Parameters
filenameFile to open
raccessFile access (FileAttr::READ, FileAttr::WRITE)

References open(), and UNK.

◆ open() [3/4]

int ImageFile::open ( const char *  filename,
int  access,
const char *  rtype 
)

Opens a image file

Parameters
filenameFile to open
accessAccess (File::READ, File::WRITE)
rtypeFile type (unk, img, imgz, gif, png)

References getType(), and open().

◆ open() [4/4]

int ImageFile::open ( const char *  filename,
int  raccess,
int  rtype 
)

◆ read() [1/2]

int ImageFile::read ( const char *  filename,
Image image 
)

Opens and reads an image from the file

Parameters
filenameFile to read
Return values
imageImage class to put file data into

References close(), open(), WXP::FileAttr::READ, and read().

◆ read() [2/2]

int ImageFile::read ( Image image)

◆ setVer()

int ImageFile::setVer ( int  v)

Sets the version number of data

Parameters
vThe version
See also
ImgWxpFile

References WXP::ImgWxpFile::setVer().

◆ write() [1/3]

int ImageFile::write ( const char *  filename,
Image image 
)

Writes an image to file

Parameters
filenameFile to write to
imageImage class to write to file

References close(), open(), WXP::FileAttr::WRITE, and write().

◆ write() [2/3]

int ImageFile::write ( const char *  filename,
int  rtype,
Image image 
)

Writes an image to file

Parameters
filenameFile to write to
rtypeType of file to write (IMG, IMGZ, GIF, PNG)
imageImage class to write to file

References close(), open(), WXP::FileAttr::WRITE, and write().

◆ write() [3/3]

int ImageFile::write ( Image image)

Writes an image to file

Parameters
imageImage to write

References GIF, GINIP, IMG, IMGZ, PNG, WXP::FileAttr::WRITE, WXP::GiniFile::write(), WXP::GifFile::write(), WXP::ImgWxpFile::write(), and WXP::PngFile::write().

Referenced by write().


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