HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Image.hpp
1// Copyright 2020 Pokitec
2// All rights reserved.
3
4#pragma once
5
6#include "TTauri/Foundation/URL.hpp"
7#include "TTauri/Foundation/PixelMap.hpp"
8#include "TTauri/Foundation/R16G16B16A16SFloat.hpp"
9#include "TTauri/Text/FontGlyphIDs.hpp"
10#include "TTauri/Cells/ImageCell.hpp"
11#include <variant>
12
13namespace tt {
14class DrawContext;
15
18class Image {
19public:
20 using image_type = std::variant<FontGlyphIDs,PixelMap<R16G16B16A16SFloat>>;
21
22 image_type image;
23public:
24 Image(URL const &url);
25 Image(PixelMap<R16G16B16A16SFloat> &&image) noexcept;
26 Image(FontGlyphIDs const &glyph) noexcept;
27
28 Image() = default;
29 Image(Image const &) noexcept;
30 Image(Image &&) noexcept = default;
31 Image &operator=(Image const &) noexcept;
32 Image &operator=(Image &&) noexcept = default;
33
34 [[nodiscard]] std::unique_ptr<ImageCell> makeCell() const noexcept;
35};
36
37
38}
An image, in different formats.
Definition Image.hpp:18
A 2D canvas of pixels.
Definition PixelMap.hpp:83
Definition URL.hpp:45
Definition FontGlyphIDs.hpp:77