Porytiles
Loading...
Searching...
No Matches
porytiles::ColorIndex Class Reference

Represents a color index value for palette operations. More...

#include <color_index.hpp>

Public Member Functions

 ColorIndex (std::size_t index)
 
auto operator<=> (const ColorIndex &) const =default
 
 operator const std::size_t & () const &
 
 operator std::size_t && () &&
 
const std::size_t & value () const &
 
std::size_t && value () &&
 
std::size_t index () const
 

Detailed Description

Represents a color index value for palette operations.

ColorIndex is a semantic wrapper around an integer that represents a unique identifier for a unique color in the global ColorIndexMap construction process. This type provides type safety and semantic clarity when working with color indices, distinguishing them from other integer values in the codebase.

Unlike IndexPixel, ColorIndex does not follow the SupportsTransparency concept, as it is used to represent the sequential indices assigned to non-transparent colors in the ColorIndexMap. A ColorSet is a collection of ColorIndexes, which can be redeemed for their original colors by consulting the ColorIndexMap.

Definition at line 25 of file color_index.hpp.

Constructor & Destructor Documentation

◆ ColorIndex()

porytiles::ColorIndex::ColorIndex ( std::size_t  index)
inline

Definition at line 28 of file color_index.hpp.

Member Function Documentation

◆ index()

std::size_t porytiles::ColorIndex::index ( ) const
inline

Definition at line 54 of file color_index.hpp.

◆ operator const std::size_t &()

porytiles::ColorIndex::operator const std::size_t & ( ) const &
inline

Definition at line 33 of file color_index.hpp.

◆ operator std::size_t &&()

porytiles::ColorIndex::operator std::size_t && ( ) &&
inline

Definition at line 39 of file color_index.hpp.

◆ operator<=>()

auto porytiles::ColorIndex::operator<=> ( const ColorIndex ) const
default

◆ value() [1/2]

std::size_t && porytiles::ColorIndex::value ( ) &&
inline

Definition at line 49 of file color_index.hpp.

◆ value() [2/2]

const std::size_t & porytiles::ColorIndex::value ( ) const &
inline

Definition at line 44 of file color_index.hpp.


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