HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
src
ttauri
icon.hpp
1
// Copyright Take Vos 2020-2021.
2
// Distributed under the Boost Software License, Version 1.0.
3
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5
#pragma once
6
7
#include "URL.hpp"
8
#include "pixel_map.hpp"
9
#include "color/sfloat_rgba16.hpp"
10
#include "text/font_glyph_ids.hpp"
11
#include "text/elusive_icon.hpp"
12
#include "text/ttauri_icon.hpp"
13
#include <variant>
14
15
namespace
tt {
16
19
class
icon
{
20
public
:
21
icon
(
URL
const
&url);
22
icon
(
pixel_map<sfloat_rgba16>
&&image)
noexcept
;
23
icon
(
font_glyph_ids
const
&glyph)
noexcept
;
24
icon
(elusive_icon
const
&
icon
)
noexcept
;
25
icon
(ttauri_icon
const
&
icon
)
noexcept
;
26
27
icon
()
noexcept
;
28
icon
(
icon
const
&)
noexcept
;
29
icon
(
icon
&&)
noexcept
=
default
;
30
icon
&operator=(
icon
const
&)
noexcept
;
31
icon
&operator=(
icon
&&)
noexcept
=
default
;
32
33
[[nodiscard]]
operator
bool ()
const
noexcept
34
{
35
return
!std::holds_alternative<std::monostate>(image);
36
}
37
38
[[nodiscard]]
friend
bool
operator==(
icon
const
&lhs,
icon
const
&rhs)
noexcept
39
{
40
return
lhs.image == rhs.image;
41
}
42
43
private
:
44
using
image_type = std::variant<std::monostate, font_glyph_ids, pixel_map<sfloat_rgba16>>;
45
46
image_type image;
47
48
friend
class
stencil
;
49
};
50
51
52
}
tt::pixel_map
A 2D canvas of pixels.
Definition
pixel_map.hpp:99
tt::icon
An image, in different formats.
Definition
icon.hpp:19
tt::stencil
Definition
stencil.hpp:15
tt::font_glyph_ids
Definition
font_glyph_ids.hpp:78
tt::URL
Definition
URL.hpp:46
Generated on Mon Apr 22 2024 12:53:51 for HikoGUI by
1.10.0