clan::ImageProviderFactory Class Reference - ClanLib SDK
Description: clan::ImageProviderFactory Class Reference

Static Public Member Functions | List of all members
clan::ImageProviderFactory Class Reference
clanDisplay Image Providers

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.
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'.
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'.

## Detailed Description

Image Provider factory.

## Member Function Documentation

## ◆ load() [1/3]

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.

## ◆ load() [2/3]

static PixelBuffer clan::ImageProviderFactory::load | ( | const std::string & | fullname,
|  | const std::string & | type = std::string(),
|  | bool | srgb = false )
| static

## ◆ load() [3/3]

static PixelBuffer clan::ImageProviderFactory::load | ( | IODevice & | file,
|  | const std::string & | type,
|  | bool | srgb = false )
| static

## ◆ save() [1/3]

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

## ◆ save() [2/3]

static void clan::ImageProviderFactory::save | ( | PixelBuffer | buffer,
|  | const std::string & | fullname,
|  | const std::string & | type = std::string() )
| static

## ◆ save() [3/3]

static void clan::ImageProviderFactory::save | ( | PixelBuffer | buffer,
|  | IODevice & | file,
|  | const std::string & | type )
| static

## ◆ try_load()

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:

- provider_factory.h