WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
WXP::ImgWxpFile Class Reference

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)

Detailed Description

This class reads and writes image files.

Author
Dan Vietor

Member Enumeration Documentation

◆ Type

Enumerator
UNK 

Unknown type

IMG 

Uncompressed WXP image

IMGZ 

Compressed WXP image

Constructor & Destructor Documentation

◆ ImgWxpFile()

ImgWxpFile::ImgWxpFile ( )

Constructor. Initializes class values

Member Function Documentation

◆ close()

int ImgWxpFile::close ( )

Closes the file

Referenced by read().

◆ isOpen()

bool ImgWxpFile::isOpen ( )

Returns if file is open or not

Returns
True if opened

◆ open() [1/3]

int ImgWxpFile::open ( const char * filename)

Opens a file for read (unknown type)

Parameters
filenameFile to open

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

◆ open() [2/3]

int ImgWxpFile::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/3]

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

Opens an image file

Parameters
filenameFile to open
raccessAccess to the file (FileAttr::READ, FileAttr::WRITE)
rtypeType of image file (UNK, IMG, IMGZ, GIF, PNG)

References WXP::File::close(), WXP::StrLib::equal(), IMG, WXP::File::isOpen(), WXP::File::open(), WXP::FileAttr::READ, WXP::File::read(), and WXP::FileAttr::WRITE.

Referenced by open(), open(), read(), and write().

◆ read() [1/2]

int ImgWxpFile::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 ImgWxpFile::read ( Image & image)

Reads in a WXP formatted image file

Return values
imageImage class to put satellite image

References readData(), and readHeader().

Referenced by read().

◆ readData()

◆ readHeader()

◆ setVer()

int ImgWxpFile::setVer ( int v)

Sets the output file version

Parameters
vThe version

◆ write() [1/2]

int ImgWxpFile::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 open(), WXP::FileAttr::WRITE, and write().

◆ write() [2/2]


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