FifeGUI 0.3.0
A C++ GUI library designed for games.
imageloader.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5#ifndef INCLUDE_FIFECHAN_IMAGELOADER_HPP_
6#define INCLUDE_FIFECHAN_IMAGELOADER_HPP_
7
8// Standard library includes
9#include <string>
10
11// Platform config include
12#include "fifechan/platform.hpp"
13
14namespace fcn
15{
16 class Image;
17
35 class FIFEGUI_API ImageLoader
36 {
37 public:
41 virtual ~ImageLoader() = default;
42
46 ImageLoader(ImageLoader const &) = default;
47
51 ImageLoader& operator=(ImageLoader const &) = default;
52
57
62
63 protected:
64 ImageLoader() = default;
65
66 public:
79 Image* load(std::string const & filename)
80 {
81 return load(filename, true);
82 }
83
91 virtual Image* load(std::string const & filename, bool convertToDisplayFormat) = 0;
92 };
93} // namespace fcn
94
95#endif // INCLUDE_FIFECHAN_IMAGELOADER_HPP_
ImageLoader(ImageLoader const &)=default
Copy constructor.
virtual Image * load(std::string const &filename, bool convertToDisplayFormat)=0
Loads an image, optionally converting it to display format.
ImageLoader & operator=(ImageLoader const &)=default
Copy assignment operator.
Image * load(std::string const &filename)
Loads an image.
ImageLoader(ImageLoader &&)=default
Move constructor.
virtual ~ImageLoader()=default
Virtual destructor.
ImageLoader & operator=(ImageLoader &&)=default
Move assignment operator.
Abstract holder for image data.
Definition image.hpp:34
Used replacement tokens by configure_file():