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::array<uint32_t, 16> getPalette(const VDP* vdp) const;
26
27public:
29 int whichPalette = PALETTE_VDP;
30
31private:
32 static constexpr int PALETTE_VDP = 0;
33 static constexpr int PALETTE_CUSTOM = 1;
34 static constexpr int PALETTE_FIXED = 2;
35 int selectedColor = 0;
36
37 std::array<uint16_t, 16> customPalette; // palette in MSX format: 0GRB nibbles
38
39 static constexpr auto persistentElements = std::tuple{
42 // manually handle "customPalette"
43 };
44};
45
46} // namespace openmsx
47
48#endif
im::WindowStatus window
void save(ImGuiTextBuffer &buf) override
std::array< uint32_t, 16 > getPalette(const VDP *vdp) const
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