All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::CodecRegistry Class Reference

CodecRegistry keeps track of different registered ImageCodecs that can be used to load images. More...

#include <Luminous/CodecRegistry.hpp>

Public Member Functions

std::shared_ptr< ImageCodecgetCodec (const QString &filename, QFile *file=nullptr)
 Try to get a codec that could load a given file. More...
 
void registerCodec (std::shared_ptr< ImageCodec > codec)
 Register a new codec that can be used to load images. More...
 

Detailed Description

CodecRegistry keeps track of different registered ImageCodecs that can be used to load images.

Member Function Documentation

std::shared_ptr<ImageCodec> Luminous::CodecRegistry::getCodec ( const QString &  filename,
QFile *  file = nullptr 
)

Try to get a codec that could load a given file.

Parameters
filenamename of the file to load
filethe file to query
Returns
returns a pointer to a codec that reports it can load the given file or NULL if no codec is found.
void Luminous::CodecRegistry::registerCodec ( std::shared_ptr< ImageCodec codec)

Register a new codec that can be used to load images.

Parameters
codecthe new codec