SNES Color container. More...
#include <snes_color.h>

Public Member Functions | |
| constexpr | SnesColor () |
| SnesColor (const ImVec4 val) | |
| Construct from ImVec4 (0.0-1.0 range) | |
| SnesColor (const uint16_t val) | |
| Construct from SNES 15-bit color. | |
| SnesColor (const snes_color val) | |
| Construct from snes_color struct (0-255 range) | |
| SnesColor (uint8_t r, uint8_t g, uint8_t b) | |
| Construct from RGB byte values (0-255) | |
| void | set_rgb (const ImVec4 val) |
| Set color from ImVec4 (0.0-1.0 range) | |
| void | set_snes (uint16_t val) |
| Set color from SNES 15-bit format. | |
| constexpr ImVec4 | rgb () const |
| Get RGB values (WARNING: stored as 0-255 in ImVec4) | |
| constexpr snes_color | rom_color () const |
| Get snes_color struct (0-255 RGB) | |
| constexpr uint16_t | snes () const |
| Get SNES 15-bit color. | |
| constexpr bool | is_modified () const |
| constexpr bool | is_transparent () const |
| constexpr void | set_transparent (bool t) |
| constexpr void | set_modified (bool m) |
Private Attributes | |
| ImVec4 | rgb_ |
| uint16_t | snes_ |
| snes_color | rom_color_ |
| bool | modified = false |
| bool | transparent = false |
SNES Color container.
Manages SNES colors in multiple formats for editing and display.
IMPORTANT: Internal storage format
When getting RGB for display:
Definition at line 109 of file snes_color.h.
|
inlineconstexpr |
Definition at line 111 of file snes_color.h.
|
inlineexplicit |
Construct from ImVec4 (0.0-1.0 range)
| val | ImVec4 with RGB in standard 0.0-1.0 range |
Definition at line 118 of file snes_color.h.
References snes_color::blue, yaze::gfx::ConvertRgbToSnes(), snes_color::green, yaze::gfx::kColorByteMax, yaze::gfx::kColorByteMaxF, snes_color::red, rgb_, rom_color_, and snes_.

|
inlineexplicit |
Construct from SNES 15-bit color.
| val | SNES color in 15-bit BGR format |
Definition at line 137 of file snes_color.h.
References snes_color::blue, yaze::gfx::ConvertSnesToRgb(), snes_color::green, yaze::gfx::kColorByteMaxF, snes_color::red, rgb_, and rom_color_.

|
inlineexplicit |
Construct from snes_color struct (0-255 range)
| val | snes_color with RGB in 0-255 range |
Definition at line 148 of file snes_color.h.
References yaze::gfx::ConvertRgbToSnes().

|
inline |
Construct from RGB byte values (0-255)
Definition at line 156 of file snes_color.h.
References snes_color::blue, yaze::gfx::ConvertRgbToSnes(), snes_color::green, yaze::gfx::kColorByteMaxF, snes_color::red, rgb_, rom_color_, and snes_.

| void yaze::gfx::SnesColor::set_rgb | ( | const ImVec4 | val | ) |
Set color from ImVec4 (0.0-1.0 range)
| val | ImVec4 with RGB in standard 0.0-1.0 range |
Definition at line 101 of file snes_color.cc.
References snes_color::blue, yaze::gfx::ConvertRgbToSnes(), snes_color::green, yaze::gfx::kColorByteMax, yaze::gfx::kColorByteMaxF, modified, snes_color::red, rgb_, rom_color_, and snes_.
Referenced by yaze::gfx::GetCgxColor(), yaze::gui::SnesColorEdit4(), yaze::gfx::SnesPalette::SnesPalette(), yaze::gfx::SnesPalette::SnesPalette(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), and yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F().

| void yaze::gfx::SnesColor::set_snes | ( | uint16_t | val | ) |
Set color from SNES 15-bit format.
| val | SNES color in 15-bit BGR format |
Definition at line 120 of file snes_color.cc.
References snes_color::blue, yaze::gfx::ConvertSnesToRgb(), snes_color::green, yaze::gfx::kColorByteMaxF, modified, snes_color::red, rgb_, rom_color_, and snes_.
Referenced by yaze::gfx::SnesPalette::SnesPalette(), yaze::gfx::SnesPalette::SnesPalette(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), and yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F().

|
inlineconstexpr |
Get RGB values (WARNING: stored as 0-255 in ImVec4)
Definition at line 182 of file snes_color.h.
References rgb_.
Referenced by yaze::gui::ColorInfoPanel(), yaze::gui::ConvertSnesColorToImVec4(), yaze::gui::PaletteEditorWidget::DrawColorEditControls(), yaze::editor::PaletteGroupCard::DrawColorInfo(), yaze::editor::palette_utility::DrawColorInfoTooltip(), yaze::gui::PaletteEditorWidget::DrawPaletteAnalysis(), yaze::editor::PaletteEditor::DrawQuickAccessCard(), yaze::editor::PaletteEditor::DrawQuickAccessTab(), yaze::gfx::Bitmap::FindColorIndex(), yaze::gui::PaletteColorButton(), yaze::test::TEST(), yaze::test::TEST(), yaze::gfx::anonymous_namespace{palette_manager_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{palette_manager_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), and yaze::gfx::ToFloatArray().
|
inlineconstexpr |
Get snes_color struct (0-255 RGB)
Definition at line 187 of file snes_color.h.
References rom_color_.
|
inlineconstexpr |
Get SNES 15-bit color.
Definition at line 192 of file snes_color.h.
References snes_.
Referenced by yaze::gui::ColorInfoPanel(), yaze::gui::PaletteEditorWidget::DrawColorEditControls(), yaze::editor::PaletteGroupCard::DrawColorInfo(), yaze::editor::palette_utility::DrawColorInfoTooltip(), yaze::editor::MapPropertiesSystem::DrawCustomBackgroundColorEditor(), yaze::editor::PaletteEditor::DrawQuickAccessCard(), yaze::editor::PaletteEditor::DrawQuickAccessTab(), yaze::gui::PaletteColorButton(), yaze::gui::SnesColorButton(), yaze::gfx::SnesPalette::SnesPalette(), yaze::gfx::SnesPalette::SnesPalette(), yaze::test::TEST(), yaze::test::TEST(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), and yaze::Rom::WriteColor().
|
inlineconstexpr |
Definition at line 194 of file snes_color.h.
References modified.
Referenced by yaze::Rom::SavePalette(), yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F(), and yaze::gfx::anonymous_namespace{snes_color_test.cc}::TEST_F().
|
inlineconstexpr |
Definition at line 195 of file snes_color.h.
References transparent.
|
inlineconstexpr |
Definition at line 196 of file snes_color.h.
References transparent.
|
inlineconstexpr |
Definition at line 197 of file snes_color.h.
References modified.
Referenced by yaze::Rom::SavePalette().
|
private |
Definition at line 200 of file snes_color.h.
Referenced by rgb(), set_rgb(), set_snes(), SnesColor(), SnesColor(), and SnesColor().
|
private |
Definition at line 201 of file snes_color.h.
Referenced by set_rgb(), set_snes(), snes(), SnesColor(), and SnesColor().
|
private |
Definition at line 202 of file snes_color.h.
Referenced by rom_color(), set_rgb(), set_snes(), SnesColor(), SnesColor(), and SnesColor().
|
private |
Definition at line 203 of file snes_color.h.
Referenced by is_modified(), set_modified(), set_rgb(), and set_snes().
|
private |
Definition at line 204 of file snes_color.h.
Referenced by is_transparent(), and set_transparent().