provider_factory.h
1/*
2** ClanLib SDK
3** Copyright (c) 1997-2020 The ClanLib Team
4**
5** This software is provided 'as-is', without any express or implied
6** warranty. In no event will the authors be held liable for any damages
7** arising from the use of this software.
8**
9** Permission is granted to anyone to use this software for any purpose,
10** including commercial applications, and to alter it and redistribute it
11** freely, subject to the following restrictions:
12**
13** 1. The origin of this software must not be misrepresented; you must not
14** claim that you wrote the original software. If you use this software
15** in a product, an acknowledgment in the product documentation would be
16** appreciated but is not required.
17** 2. Altered source versions must be plainly marked as such, and must not be
18** misrepresented as being the original software.
19** 3. This notice may not be removed or altered from any source distribution.
20**
21** Note: Some of the libraries ClanLib may link to may have additional
22** requirements or restrictions.
23**
24** File Author(s):
25**
26** Magnus Norddahl
27** Mark Page
28*/
29
30#pragma once
31
32#include <map>
33#include "../../Core/IOData/file_system.h"
34
35namespace clan
36{
39
40 class PixelBuffer;
41 class ImageProviderType;
42
45 {
46 public:
54 const std::string &filename,
55 const std::string &type = std::string(),
56 const FileSystem &fs = FileSystem(),
57 std::string *out_failure_reason = nullptr,
58 bool srgb = false);
59
62
66 const std::string &filename,
67 const FileSystem &fs,
68 const std::string &type = std::string(),
69 bool srgb = false);
70
72 const std::string &fullname,
73 const std::string &type = std::string(),
74 bool srgb = false);
75
77 IODevice &file,
78 const std::string &type,
79 bool srgb = false);
80
82
84 static void save(
85 PixelBuffer buffer,
86 const std::string &filename,
87 FileSystem &fs,
88 const std::string &type = std::string());
89
90 static void save(
91 PixelBuffer buffer,
92 const std::string &fullname,
93 const std::string &type = std::string());
94
95 static void save(
96 PixelBuffer buffer,
97 IODevice &file,
98 const std::string &type);
99 };
100
102}
Virtual File System (VFS).
Definition file_system.h:47
I/O Device interface.
Definition iodevice.h:50
Image Provider factory.
Definition provider_factory.h:45
static void save(PixelBuffer buffer, IODevice &file, const std::string &type)
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 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'.
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 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 void save(PixelBuffer buffer, const std::string &fullname, const std::string &type=std::string())
Pixel data container.
Definition pixel_buffer.h:68
Definition clanapp.h:36