A set of indexed colors representing a palette.
More...
|
|
constexpr | Palette ()=default |
| | Default ctor.
|
| |
| constexpr | Palette (const PaletteRaw resource) |
| | Constructs from PaletteParam. More...
|
| |
|
constexpr | Palette (const Palette &other) |
| | Copy constructor.
|
| |
|
constexpr | Palette (Palette &&other) |
| | Move constructor.
|
| |
| | Palette (int ncolors) |
| | Create a palette structure with the specified number of color entries. More...
|
| |
|
constexpr const PaletteRaw | operator-> () const |
| | member access to underlying PaletteRaw.
|
| |
|
constexpr PaletteRaw | operator-> () |
| | member access to underlying PaletteRaw.
|
| |
|
| ~Palette () |
| | Destructor.
|
| |
|
Palette & | operator= (Palette other) |
| | Assignment operator.
|
| |
|
constexpr PaletteRaw | get () const |
| | Retrieves underlying PaletteRaw.
|
| |
|
constexpr PaletteRaw | release () |
| | Retrieves underlying PaletteRaw and clear this.
|
| |
|
constexpr auto | operator<=> (const Palette &other) const =default |
| | Comparison.
|
| |
|
constexpr bool | operator== (std::nullptr_t _) const |
| | Comparison.
|
| |
|
constexpr | operator bool () const |
| | Converts to bool.
|
| |
|
constexpr | operator PaletteParam () const |
| | Converts to PaletteParam.
|
| |
| void | Destroy () |
| | Free a palette created with Palette.Palette(). More...
|
| |
|
constexpr const ColorRaw * | data () const |
| | Access specific pallete colors.
|
| |
|
constexpr int | size () const |
| | Returns number of colors in the palette.
|
| |
|
constexpr ColorRaw | operator[] (int index) const |
| | Access specific pallete index.
|
| |
| void | SetColors (SpanRef< const ColorRaw > colors, int firstcolor=0) |
| | Set a range of colors in a palette. More...
|
| |
- Since
- This struct is available since SDL 3.2.0.
- See also
- Palette.SetColors
- Category:
- Resource
◆ Palette() [1/2]
| constexpr SDL::Palette::Palette |
( |
const PaletteRaw |
resource | ) |
|
|
inlineexplicitconstexpr |
- Parameters
-
| resource | a PaletteRaw to be wrapped. |
This assumes the ownership, call release() if you need to take back.
◆ Palette() [2/2]
| SDL::Palette::Palette |
( |
int |
ncolors | ) |
|
|
inline |
The palette entries are initialized to white.
- Parameters
-
| ncolors | represents the number of color entries in the color palette. |
- Postcondition
- a new Palette structure on success.
- Exceptions
-
- Thread safety:
- It is safe to call this function from any thread.
- Since
- This function is available since SDL 3.2.0.
- See also
- Palette.Destroy
-
Palette.SetColors
-
Surface.SetPalette
◆ Borrow()
- Parameters
-
This does not takes ownership!
The documentation for this class was generated from the following file: