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 | 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 |
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 107 of file snes_palette.h.
|
inlineexplicit |
Definition at line 110 of file snes_palette.h.
References colors.
|
default |
|
explicit |
Definition at line 226 of file snes_palette.cc.
References snes_color::blue, colors, yaze::app::gfx::ConvertSnesToRgb(), snes_color::green, snes_color::red, yaze::app::gfx::SnesColor::set_rgb(), yaze::app::gfx::SnesColor::set_snes(), and yaze::app::gfx::SnesColor::snes().
|
explicit |
Definition at line 238 of file snes_palette.cc.
References snes_color::blue, colors, yaze::app::gfx::ConvertSnesToRgb(), snes_color::green, snes_color::red, yaze::app::gfx::SnesColor::set_rgb(), yaze::app::gfx::SnesColor::set_snes(), and yaze::app::gfx::SnesColor::snes().
|
explicit |
Definition at line 250 of file snes_palette.cc.
References colors, and yaze::app::gfx::SnesColor::set_rgb().
|
explicit |
Definition at line 258 of file snes_palette.cc.
References colors, yaze::app::gfx::ConvertRgbToSnes(), and yaze::app::gfx::SnesColor::set_snes().
|
explicit |
Definition at line 266 of file snes_palette.cc.
References colors.
|
inline |
Definition at line 123 of file snes_palette.h.
References colors.
Referenced by yaze::app::zelda3::overworld::palette_internal::SetColorsPalette().
|
inline |
Definition at line 129 of file snes_palette.h.
References colors.
Referenced by yaze::app::gfx::CreatePaletteGroupFromColFile(), yaze::app::gfx::CreatePaletteGroupFromLargePalette(), yaze::app::editor::MessageEditor::Initialize(), sub_palette(), and yaze::test::gfx::TEST().
|
inline |
Definition at line 130 of file snes_palette.h.
References colors.
|
inline |
Definition at line 131 of file snes_palette.h.
References colors.
|
inline |
Definition at line 133 of file snes_palette.h.
References colors.
Referenced by yaze::app::gfx::Bitmap::ApplyPaletteFromPaletteGroup(), yaze::app::editor::DisplayPalette(), yaze::app::gui::DisplayPalette(), yaze::app::editor::PaletteEditor::DrawPaletteGroup(), yaze::app::editor::PaletteEditor::EditColorInPalette(), and yaze::app::editor::PaletteEditor::ResetColorToOriginal().
|
inline |
Definition at line 140 of file snes_palette.h.
References colors.
Referenced by yaze::app::editor::PaletteEditor::DrawPaletteGroup(), and yaze::app::editor::MessageEditor::Initialize().
|
inline |
Definition at line 142 of file snes_palette.h.
References colors.
Referenced by yaze::app::gfx::Bitmap::Cleanup(), and yaze::app::gfx::Tilesheet::clear().
|
inline |
Definition at line 143 of file snes_palette.h.
References colors.
Referenced by yaze::app::gfx::Bitmap::ApplyPaletteFromPaletteGroup(), yaze::app::gfx::CreatePaletteGroupFromLargePalette(), yaze::app::editor::DisplayPalette(), yaze::app::gui::DisplayPalette(), yaze::app::editor::GraphicsEditor::DrawPaletteControls(), yaze::app::editor::anonymous_namespace{gfx_group_editor.cc}::DrawPaletteFromPaletteGroup(), yaze::app::editor::PaletteEditor::DrawPaletteGroup(), yaze::app::editor::PaletteEditor::EditColorInPalette(), yaze::app::editor::MessageEditor::Initialize(), yaze::app::gfx::Bitmap::palette_size(), yaze::app::editor::PaletteEditor::ResetColorToOriginal(), yaze::app::Rom::SavePalette(), yaze::app::gui::SelectablePalettePipeline(), and yaze::test::gfx::TEST().
|
inline |
Definition at line 144 of file snes_palette.h.
References colors.
Referenced by yaze::app::editor::anonymous_namespace{gfx_group_editor.cc}::DrawPaletteFromPaletteGroup().
|
inline |
Definition at line 146 of file snes_palette.h.
References colors.
|
inline |
Definition at line 154 of file snes_palette.h.
References colors.
|
inline |
Definition at line 161 of file snes_palette.h.
References colors.
|
inline |
Definition at line 170 of file snes_palette.h.
References AddColor(), and colors.
Referenced by yaze::app::gfx::Bitmap::ApplyPaletteFromPaletteGroup(), and yaze::app::gfx::Bitmap::ApplyPaletteWithTransparent().
|
private |
The colors in the palette.
Definition at line 179 of file snes_palette.h.
Referenced by AddColor(), AddColor(), AddColor(), clear(), Create(), empty(), GetColor(), mutable_color(), operator()(), operator()(), operator[](), size(), SnesPalette(), SnesPalette(), SnesPalette(), SnesPalette(), SnesPalette(), SnesPalette(), and sub_palette().