yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::gfx::PaletteGroup Struct Reference

Represents a group of palettes. More...

#include <snes_palette.h>

Public Member Functions

 PaletteGroup ()=default
 
 PaletteGroup (const std::string &name)
 
void AddPalette (SnesPalette pal)
 
void AddColor (SnesColor color)
 
void clear ()
 
void resize (size_t new_size)
 
auto name () const
 
auto size () const
 
bool empty () const
 
auto palette (int i) const
 
const SnesPalette & palette_ref (int i) const
 
auto mutable_palette (int i)
 
SnesPalette & palette_ref (int i)
 
SnesColor GetColor (int palette_index, int color_index) const
 Get a specific color from a palette.
 
bool SetColor (int palette_index, int color_index, const SnesColor &color)
 Set a specific color in a palette.
 
SnesPalette operator[] (int i)
 
const SnesPalette & operator[] (int i) const
 

Private Attributes

std::string name_
 
std::vector< SnesPalette > palettes
 

Detailed Description

Represents a group of palettes.

Supports adding palettes and colors, clearing the group, and accessing palettes and colors by index.

Definition at line 210 of file snes_palette.h.

Constructor & Destructor Documentation

◆ PaletteGroup() [1/2]

yaze::gfx::PaletteGroup::PaletteGroup ( )
default

◆ PaletteGroup() [2/2]

yaze::gfx::PaletteGroup::PaletteGroup ( const std::string & name)
inline

Definition at line 212 of file snes_palette.h.

Member Function Documentation

◆ AddPalette()

◆ AddColor()

void yaze::gfx::PaletteGroup::AddColor ( SnesColor color)
inline

Definition at line 218 of file snes_palette.h.

References palettes.

Referenced by yaze::gfx::palette_group_internal::LoadGrassColors().

◆ clear()

void yaze::gfx::PaletteGroup::clear ( )
inline

◆ resize()

void yaze::gfx::PaletteGroup::resize ( size_t new_size)
inline

Definition at line 226 of file snes_palette.h.

References palettes.

◆ name()

auto yaze::gfx::PaletteGroup::name ( ) const
inline

◆ size()

auto yaze::gfx::PaletteGroup::size ( ) const
inline

Definition at line 231 of file snes_palette.h.

References palettes.

Referenced by yaze::cli::handlers::anonymous_namespace{palette_commands.cc}::AnalyzeGroup(), yaze::zelda3::BindLyraTerrainSource(), yaze::editor::sprite_authoring::BindPaletteRows(), yaze::zelda3::anonymous_namespace{object_tile_editor.cc}::BuildCombinedPaletteBanks(), yaze::editor::internal::DefaultSpritePreviewPalettes(), yaze::editor::GraphicsEditor::DrawPaletteControls(), yaze::editor::PaletteEditor::DrawPaletteGroup(), yaze::editor::ImageImportView::DrawPaletteImport(), yaze::gui::PaletteEditorWidget::DrawPaletteSelector(), yaze::gfx::PaletteGroupMap::empty(), getRomPaletteGroup(), yaze::zelda3::anonymous_namespace{gfx_sheet_png.cc}::LoadRoomWithPalettes(), yaze::editor::sprite_graphics_context::Make(), yaze::editor::SpriteEditor::OpenBoundBinInScratch(), yaze::zelda3::ProcessSheetBitmap(), yaze::editor::DungeonEditorV2::RefreshRomBackedState(), yaze::editor::DungeonEditorV2::RefreshRoomMetadataViews(), yaze::editor::RenderDungeonMapTilesGfxPreview(), yaze::editor::sprite_graphics_context::RenderFrameBuffer(), yaze::editor::SpriteEditor::RenderVanillaSprite(), yaze::editor::SpriteEditor::RenderZSpriteFrame(), yaze::gfx::PaletteManager::ResolveColorAddress(), yaze::zelda3::anonymous_namespace{object_tile_editor.cc}::ResolvePaletteIndex(), yaze::zelda3::anonymous_namespace{room.cc}::ResolvePaletteOrFirst(), yaze::editor::internal::ResolveRoleDefaultPalette(), yaze::test::RomDependentTestSuite::RunTile16EditorTest(), yaze::zelda3::SaveGameData(), yaze::editor::DungeonCanvasViewer::SetCurrentPaletteGroup(), and yaze::editor::DungeonObjectInteraction::SetCurrentPaletteGroup().

◆ empty()

◆ palette()

◆ palette_ref() [1/2]

◆ mutable_palette()

◆ palette_ref() [2/2]

SnesPalette & yaze::gfx::PaletteGroup::palette_ref ( int i)
inline

Definition at line 240 of file snes_palette.h.

References palettes.

◆ GetColor()

SnesColor yaze::gfx::PaletteGroup::GetColor ( int palette_index,
int color_index ) const
inline

Get a specific color from a palette.

Parameters
palette_indexThe palette index
color_indexThe color index within the palette
Returns
The color, or SnesColor() if indices are invalid

Definition at line 250 of file snes_palette.h.

References palettes.

Referenced by yaze::zelda3::ResolveMenuPaletteFromHud().

◆ SetColor()

bool yaze::gfx::PaletteGroup::SetColor ( int palette_index,
int color_index,
const SnesColor & color )
inline

Set a specific color in a palette.

Parameters
palette_indexThe palette index
color_indexThe color index within the palette
colorThe new color value
Returns
true if color was set successfully

Definition at line 267 of file snes_palette.h.

References palettes.

Referenced by yaze::zelda3::BuildDungeonRenderPaletteGroup().

◆ operator[]() [1/2]

SnesPalette yaze::gfx::PaletteGroup::operator[] ( int i)
inline

Definition at line 280 of file snes_palette.h.

References palettes, and yaze::gfx::SnesPalette::size().

Here is the call graph for this function:

◆ operator[]() [2/2]

const SnesPalette & yaze::gfx::PaletteGroup::operator[] ( int i) const
inline

Definition at line 290 of file snes_palette.h.

References palettes, and yaze::gfx::SnesPalette::size().

Here is the call graph for this function:

Member Data Documentation

◆ name_

std::string yaze::gfx::PaletteGroup::name_
private

Definition at line 302 of file snes_palette.h.

Referenced by name().

◆ palettes

std::vector<SnesPalette> yaze::gfx::PaletteGroup::palettes
private

The documentation for this struct was generated from the following file: