Image Provider factory. More...

#include <provider_factory.h>

Static Public Member Functions

static PixelBuffer load (const std::string &filename, const FileSystem &fs, const std::string &type=std::string(), bool srgb=false)
 Loads an image file from 'filename', using the provider. More...
 
static PixelBuffer load (const std::string &fullname, const std::string &type=std::string(), bool srgb=false)
 
static PixelBuffer load (IODevice &file, const std::string &type, bool srgb=false)
 
static void save (PixelBuffer buffer, const std::string &filename, FileSystem &fs, const std::string &type=std::string())
 Saves the given PixelBuffer to the file given by 'filename'. More...
 
static void save (PixelBuffer buffer, const std::string &fullname, const std::string &type=std::string())
 
static void save (PixelBuffer buffer, IODevice &file, const std::string &type)
 
static PixelBuffer try_load (const std::string &filename, const std::string &type=std::string(), const FileSystem &fs=FileSystem(), std::string *out_failure_reason=nullptr, bool srgb=false)
 Attempts to load an image file from 'filename', using the provider identified by 'type'. More...
 

Detailed Description

Image Provider factory.

Member Function Documentation

static PixelBuffer clan::ImageProviderFactory::load ( const std::string filename,
const FileSystem fs,
const std::string type = std::string(),
bool  srgb = false 
)
static

Loads an image file from 'filename', using the provider.

identified by 'type'.

If the type is an empty string, it uses the extension of the filename to determine what type it is.

The virtual directory will be used as a the source.

static PixelBuffer clan::ImageProviderFactory::load ( const std::string fullname,
const std::string type = std::string(),
bool  srgb = false 
)
static
static PixelBuffer clan::ImageProviderFactory::load ( IODevice file,
const std::string type,
bool  srgb = false 
)
static
static void clan::ImageProviderFactory::save ( PixelBuffer  buffer,
const std::string filename,
FileSystem fs,
const std::string type = std::string() 
)
static

Saves the given PixelBuffer to the file given by 'filename'.

If the type is an empty string, it uses the extension of the filename to determine what type it is

static void clan::ImageProviderFactory::save ( PixelBuffer  buffer,
const std::string fullname,
const std::string type = std::string() 
)
static
static void clan::ImageProviderFactory::save ( PixelBuffer  buffer,
IODevice file,
const std::string type 
)
static
static PixelBuffer clan::ImageProviderFactory::try_load ( const std::string filename,
const std::string type = std::string(),
const FileSystem fs = FileSystem(),
std::string out_failure_reason = nullptr,
bool  srgb = false 
)
static

Attempts to load an image file from 'filename', using the provider identified by 'type'.

Returns
If the function fails to load the image, a null pixel buffer object is returned.

If the type is an empty string, it uses the extension of the filename to determine what type it is.

The virtual directory will be used as a the source.


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