neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_image.hpp
Go to the documentation of this file.
1// i_image.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
26
27namespace neogfx
28{
29 enum class color_format
30 {
31 RGBA8
32 };
33
34 class i_image : public i_resource
35 {
36 public:
37 struct unknown_image_format : std::runtime_error { unknown_image_format() : std::runtime_error("neogfx::i_image::unknown_image_format") {} };
38 public:
39 virtual ~i_image() = default;
40 public:
41 virtual dimension dpi_scale_factor() const = 0;
42 virtual neogfx::color_space color_space() const = 0;
44 virtual texture_sampling sampling() const = 0;
45 virtual texture_data_format data_format() const = 0;
46 virtual const neogfx::size& extents() const = 0;
47 virtual void resize(const neogfx::size& aNewSize) = 0;
48 virtual const void* cpixels() const = 0;
49 virtual const void* pixels() const = 0;
50 virtual void* pixels() = 0;
51 virtual color get_pixel(const point& aPoint) const = 0;
52 virtual void set_pixel(const point& aPoint, const color& aColor) = 0;
53 };
54}
virtual void set_pixel(const point &aPoint, const color &aColor)=0
virtual dimension dpi_scale_factor() const =0
virtual const neogfx::size & extents() const =0
virtual texture_data_format data_format() const =0
virtual const void * pixels() const =0
virtual neogfx::color_space color_space() const =0
virtual void * pixels()=0
virtual void resize(const neogfx::size &aNewSize)=0
virtual neogfx::color_format color_format() const =0
virtual texture_sampling sampling() const =0
virtual color get_pixel(const point &aPoint) const =0
virtual ~i_image()=default
virtual const void * cpixels() const =0
default_geometry_value_type dimension
color_format
Definition i_image.hpp:30
texture_data_format
Definition i_texture.hpp:56
texture_sampling
Definition i_texture.hpp:42