WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Public Member Functions | List of all members
WXP::PngFile Class Reference

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)
 

Detailed Description

This class reads and write PNG image files.

Author
Dan Vietor

Constructor & Destructor Documentation

◆ PngFile() [1/2]

PngFile::PngFile ( )

Constructor

References init().

◆ ~PngFile()

PngFile::~PngFile ( )

Destructor

References WXP::File::close().

◆ PngFile() [2/2]

PngFile::PngFile ( const char *  filename,
int  raccess 
)

Constructor. Opens the file

Parameters
filenamePNG filename
raccessAccess (FileAttr:READ, FileAttr::WRITE)

References init(), and open().

Member Function Documentation

◆ close()

int PngFile::close ( )

Closes the file

References WXP::File::close().

Referenced by WXP::ImageFile::close(), and read().

◆ init()

int PngFile::init ( )

Initializes the class

Referenced by PngFile(), and PngFile().

◆ isOpen()

bool PngFile::isOpen ( )

Returns true if file open

Referenced by WXP::ImageFile::open().

◆ open()

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

Opens the file

Parameters
filenamePNG filename
raccessAccess (FileAttr:READ, FileAttr::WRITE)

References WXP::File::isOpen(), WXP::File::open(), WXP::FileAttr::READ, and WXP::FileAttr::WRITE.

Referenced by WXP::ImageFile::open(), WXP::SatFile::open(), PngFile(), read(), and write().

◆ read() [1/2]

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

Reads in an image from file

Parameters
filenameThe image filename
Return values
imageThe output image

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

◆ read() [2/2]

int PngFile::read ( Image image)

◆ setComment()

int PngFile::setComment ( const char *  str)

Sets a comment to be saved with image

Parameters
strComment

References WXP::StrLib::copy().

◆ setInterlace()

int PngFile::setInterlace ( int  val)

Set up interlacing (not used)

Parameters
valInterlace type

◆ setTitle()

int PngFile::setTitle ( const char *  str)

Sets a title to be attached to the image file

Parameters
strImage title

References WXP::StrLib::copy().

◆ write() [1/2]

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

Writes an image to a file.

Parameters
filenameThe output filename
imageImage to write

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

◆ write() [2/2]

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.

Parameters
imageImage to write

References WXP::StrLib::acopy(), WXP::File::close(), 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(), and WXP::ImageFile::write().


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