Represents a palette of colors for the Super Nintendo Entertainment System (SNES). More...
#include <snes_palette.h>
Public Member Functions | |
template<typename T> | |
SnesPalette (const std::vector< T > &data) | |
SnesPalette ()=default | |
SnesPalette (char *snesPal) | |
SnesPalette (const unsigned char *snes_pal) | |
SnesPalette (const std::vector< ImVec4 > &) | |
SnesPalette (const std::vector< snes_color > &) | |
SnesPalette (const std::vector< SnesColor > &) | |
void | Create (const std::vector< SnesColor > &cols) |
void | Create (std::ranges::range auto &&cols) |
void | AddColor (const SnesColor &color) |
void | AddColor (const snes_color &color) |
void | AddColor (uint16_t color) |
absl::StatusOr< SnesColor > | GetColor (int i) const |
auto | mutable_color (int i) |
void | clear () |
auto | size () const |
auto | empty () const |
auto | begin () |
auto | end () |
SnesColor & | operator[] (int i) |
void | operator() (int i, const SnesColor &color) |
void | operator() (int i, const ImVec4 &color) |
SnesPalette | sub_palette (int start, int end) const |
Private Attributes | |
std::vector< SnesColor > | colors |
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
The SnesPalette
class provides functionality to create, modify, and access colors in an SNES palette. It supports various constructors to initialize the palette with different types of data. The palette can be modified by adding or changing colors, and it can be cleared to remove all colors. Colors in the palette can be accessed using index-based access or through the GetColor
method. The class also provides a method to create a sub-palette by selecting a range of colors from the original palette.
Definition at line 108 of file snes_palette.h.
|
inlineexplicit |
|
default |
|
explicit |
Definition at line 223 of file snes_palette.cc.
References snes_color::blue, colors, yaze::gfx::ConvertSnesToRgb(), snes_color::green, snes_color::red, yaze::gfx::SnesColor::set_rgb(), yaze::gfx::SnesColor::set_snes(), and yaze::gfx::SnesColor::snes().
|
explicit |
Definition at line 235 of file snes_palette.cc.
References snes_color::blue, colors, yaze::gfx::ConvertSnesToRgb(), snes_color::green, snes_color::red, yaze::gfx::SnesColor::set_rgb(), yaze::gfx::SnesColor::set_snes(), and yaze::gfx::SnesColor::snes().
|
explicit |
Definition at line 247 of file snes_palette.cc.
References colors, and yaze::gfx::SnesColor::set_rgb().
|
explicit |
Definition at line 255 of file snes_palette.cc.
References colors, yaze::gfx::ConvertRgbToSnes(), and yaze::gfx::SnesColor::set_snes().
|
explicit |
Definition at line 263 of file snes_palette.cc.
References colors.
|
inline |
Definition at line 124 of file snes_palette.h.
References colors.
Referenced by yaze::zelda3::palette_internal::SetColorsPalette().
|
inline |
Definition at line 130 of file snes_palette.h.
References colors.
|
inline |
Definition at line 134 of file snes_palette.h.
References colors.
Referenced by yaze::gfx::CreatePaletteGroupFromColFile(), yaze::gfx::CreatePaletteGroupFromLargePalette(), sub_palette(), and yaze::test::TEST().
|
inline |
Definition at line 135 of file snes_palette.h.
References colors.
|
inline |
Definition at line 136 of file snes_palette.h.
References colors.
|
inline |
Definition at line 138 of file snes_palette.h.
References colors.
Referenced by yaze::editor::DisplayPalette(), yaze::gui::DisplayPalette(), yaze::editor::PaletteEditor::DrawPaletteGroup(), yaze::editor::PaletteEditor::EditColorInPalette(), and yaze::editor::PaletteEditor::ResetColorToOriginal().
|
inline |
Definition at line 145 of file snes_palette.h.
References colors.
Referenced by yaze::editor::PaletteEditor::DrawPaletteGroup().
|
inline |
Definition at line 147 of file snes_palette.h.
References colors.
|
inline |
Definition at line 148 of file snes_palette.h.
References colors.
Referenced by yaze::gfx::CreatePaletteGroupFromLargePalette(), yaze::editor::DisplayPalette(), yaze::gui::DisplayPalette(), yaze::editor::anonymous_namespace{gfx_group_editor.cc}::DrawPaletteFromPaletteGroup(), yaze::editor::PaletteEditor::DrawPaletteGroup(), yaze::editor::PaletteEditor::EditColorInPalette(), yaze::editor::PaletteEditor::ResetColorToOriginal(), yaze::Rom::SavePalette(), yaze::gui::SelectablePalettePipeline(), and yaze::test::TEST().
|
inline |
Definition at line 149 of file snes_palette.h.
References colors.
Referenced by yaze::editor::anonymous_namespace{gfx_group_editor.cc}::DrawPaletteFromPaletteGroup().
|
inline |
Definition at line 150 of file snes_palette.h.
References colors.
|
inline |
|
inline |
Definition at line 153 of file snes_palette.h.
References colors.
|
inline |
Definition at line 161 of file snes_palette.h.
References colors.
|
inline |
Definition at line 168 of file snes_palette.h.
References colors.
|
inline |
Definition at line 177 of file snes_palette.h.
References AddColor(), colors, end(), and SnesPalette().
|
private |
The colors in the palette.
Definition at line 186 of file snes_palette.h.
Referenced by AddColor(), AddColor(), AddColor(), begin(), clear(), Create(), Create(), empty(), end(), GetColor(), mutable_color(), operator()(), operator()(), operator[](), size(), SnesPalette(), SnesPalette(), SnesPalette(), SnesPalette(), SnesPalette(), SnesPalette(), and sub_palette().