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

Base class for all image decoders. More...

#include <Codec.hpp>

Inheritance diagram for FotoSHOCKcore::IO::Decoder:
FotoSHOCKcore::IO::ExrDecoder FotoSHOCKcore::IO::JpgDecoder FotoSHOCKcore::IO::PngDecoder

Public Member Functions

virtual ~Decoder ()
 A destructor.
 
virtual ImageBufferBaseloadImage (unsigned int tileExtent)=0
 Load an image. More...
 
virtual ImageBufferBaseloadImage (unsigned int tileExtent, PixelData format)=0
 Load an image using a specified format. More...
 

Protected Member Functions

 Decoder (const std::string fileName)
 Construct a new decoder. More...
 

Protected Attributes

const std::string m_fileName
 

Detailed Description

Base class for all image decoders.

All image decoders must inherit from this class.

Note
IMPORTANT: all decoders must implement the following static function:
static bool canDecode(const std::string fileName);

Constructor & Destructor Documentation

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

Construct a new decoder.

Parameters
fileNamename of the file to be loaded.

Member Function Documentation

virtual ImageBufferBase* FotoSHOCKcore::IO::Decoder::loadImage ( unsigned int  tileExtent)
pure virtual

Load an image.

This function loads an image into an ImageBuffer with the specified tileExtent. The format of ImageBuffer is guessed from the input file.

Parameters
tileExtenttileExtent of the created ImageBuffer
Returns
pointer to dynamically allocated ImageBufferBase object containing the image

Implemented in FotoSHOCKcore::IO::JpgDecoder, FotoSHOCKcore::IO::PngDecoder, and FotoSHOCKcore::IO::ExrDecoder.

virtual ImageBufferBase* FotoSHOCKcore::IO::Decoder::loadImage ( unsigned int  tileExtent,
PixelData  format 
)
pure virtual

Load an image using a specified format.

This overload tries to load an image into a buffer with the format format.

Parameters
tileExtenttileExtent of the created ImageBuffer
formatthe format of the returned buffer
Returns
pointer to dynamically allocated ImageBufferBase object containing the image

Implemented in FotoSHOCKcore::IO::JpgDecoder, FotoSHOCKcore::IO::PngDecoder, and FotoSHOCKcore::IO::ExrDecoder.


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