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 SnesPalettepalette_ref (int i) const
 
auto mutable_palette (int i)
 
SnesPalettepalette_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 SnesPaletteoperator[] (int i) const
 

Private Attributes

std::string name_
 
std::vector< SnesPalettepalettes
 

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

Definition at line 230 of file snes_palette.h.

References name_.

◆ size()

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

◆ empty()

bool yaze::gfx::PaletteGroup::empty ( ) const
inline

Definition at line 232 of file snes_palette.h.

References palettes.

◆ palette()

auto yaze::gfx::PaletteGroup::palette ( int  i) const
inline

Definition at line 235 of file snes_palette.h.

References palettes.

◆ palette_ref() [1/2]

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

Definition at line 236 of file snes_palette.h.

References palettes.

◆ mutable_palette()

auto yaze::gfx::PaletteGroup::mutable_palette ( int  i)
inline

◆ 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.

◆ 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.

◆ 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 289 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 300 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: