openMSX
ImGuiPalette.hh
Go to the documentation of this file.
1#ifndef IMGUI_PALETTE_HH
2#define IMGUI_PALETTE_HH
3
4#include "ImGuiCpp.hh"
5#include "ImGuiPart.hh"
6
7#include <array>
8#include <cstdint>
9#include <span>
10
11namespace openmsx {
12
13class VDP;
14
15class ImGuiPalette final : public ImGuiPart
16{
17public:
18 explicit ImGuiPalette(ImGuiManager& manager_);
19
20 [[nodiscard]] zstring_view iniName() const override { return "Palette editor"; }
21 void save(ImGuiTextBuffer& buf) override;
22 void loadLine(std::string_view name, zstring_view value) override;
23 void paint(MSXMotherBoard* motherBoard) override;
24
25 std::span<const uint16_t, 16> getPalette(const VDP* vdp) const;
26 static uint32_t toRGBA(uint16_t msxColor);
27
28public:
30 int whichPalette = PALETTE_VDP;
31
32private:
33 static constexpr int PALETTE_VDP = 0;
34 static constexpr int PALETTE_CUSTOM = 1;
35 static constexpr int PALETTE_FIXED = 2;
36 int selectedColor = 0;
37
38 std::array<uint16_t, 16> customPalette; // palette in MSX format: 0GRB nibbles
39
40 static constexpr auto persistentElements = std::tuple{
43 // manually handle "customPalette"
44 };
45};
46
47} // namespace openmsx
48
49#endif
im::WindowStatus window
void save(ImGuiTextBuffer &buf) override
std::span< const uint16_t, 16 > getPalette(const VDP *vdp) const
static uint32_t toRGBA(uint16_t msxColor)
zstring_view iniName() const override
void loadLine(std::string_view name, zstring_view value) override
void paint(MSXMotherBoard *motherBoard) override
Unified implementation of MSX Video Display Processors (VDPs).
Definition VDP.hh:67
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
This file implemented 3 utility functions:
Definition Autofire.cc:11