FotoSHOCK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FotoSHOCKcore::IO::Encoder Class Referenceabstract

Base class for all image encoders. More...

#include <Codec.hpp>

Inheritance diagram for FotoSHOCKcore::IO::Encoder:
FotoSHOCKcore::IO::ExrEncoder FotoSHOCKcore::IO::JpgEncoder FotoSHOCKcore::IO::PngEncoder

Public Member Functions

virtual ~Encoder ()
 A destructor.
 
virtual void saveImage (ImageBufferBase *image, int quality)=0
 Save an image into the file. More...
 

Protected Member Functions

 Encoder (const std::string fileName)
 Construct a new encoder. More...
 

Protected Attributes

const std::string m_fileName
 

Detailed Description

Base class for all image encoders.

All image encoders must inherit from this class.

Note
IMPORTANT: all encoders must implement the following static function:
static Formats::Enum format();
This function must return the corresponding format defined in the FotoSHOCKcore::IO::Formats::Enum enum.

Constructor & Destructor Documentation

FotoSHOCKcore::IO::Encoder::Encoder ( const std::string  fileName)
protected

Construct a new encoder.

Parameters
fileNamename of the saved file.

Member Function Documentation

virtual void FotoSHOCKcore::IO::Encoder::saveImage ( ImageBufferBase image,
int  quality 
)
pure virtual

Save an image into the file.

Saves an image to the file specified in the Encoder's constructor.

Parameters
imageimage to save. The encoder should try to convert the image as needed.
qualityspecifies quality, especially for the lossy compressions such as JPEG. May have different meaning for lossless compressions.
Todo:
handle the quality

Implemented in FotoSHOCKcore::IO::PngEncoder, FotoSHOCKcore::IO::ExrEncoder, and FotoSHOCKcore::IO::JpgEncoder.


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