A set of indexed colors representing a palette.
More...
|
constexpr int | GetSize () const |
| Return the number of colors.
|
|
constexpr Color | operator[] (int index) const |
| Get the index color.
|
|
void | SetColors (SpanRef< const SDL_Color > colors, int firstcolor=0) |
| Set a range of colors in a palette.
|
|
constexpr | Resource (T resource={}) |
| Constructs from the underlying resource.
|
|
constexpr | Resource (const ResourceHandle< Resource< T > > auto &resource) |
| Constructs from pointer like.
|
|
constexpr | Resource (std::nullptr_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (std::nullopt_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (SDL_Palette * resource={}) |
| Constructs from the underlying resource.
|
|
constexpr | Resource (const ResourceHandle< Resource< SDL_Palette * > > auto &resource) |
| Constructs from pointer like.
|
|
constexpr | Resource (std::nullptr_t) |
| Equivalent to default ctor.
|
|
constexpr | Resource (std::nullopt_t) |
| Equivalent to default ctor.
|
|
constexpr | operator bool () const |
| True if contains a valid resource.
|
|
constexpr | operator value_type () const |
| Converts back to underlying type.
|
|
constexpr bool | operator== (const Resource &other) const=default |
| Comparison.
|
|
constexpr bool | operator== (std::nullopt_t) const |
| Comparison.
|
|
constexpr bool | operator== (std::nullptr_t) const |
| Comparison.
|
|
constexpr SDL_Palette * | get () const |
| Return contained resource;.
|
|
constexpr const SDL_Palette * | operator-> () const |
| Access to fields.
|
|
constexpr SDL_Palette * | operator-> () |
| Access to fields.
|
|
|
using | value_type = SDL_Palette * |
| The raw resource type.
|
|
- Since
- This struct is available since SDL 3.2.0.
- Category:
- Resource
- See also
- PaletteRef.SetColors
-
Palette
◆ reset()
static void SDL::PaletteRef::reset |
( |
SDL_Palette * |
resource | ) |
|
|
inlinestatic |
- Parameters
-
- Thread safety:
- It is safe to call this function from any thread, as long as the palette is not modified or destroyed in another thread.
- Since
- This function is available since SDL 3.2.0.
- See also
- Palette.Create
◆ SetColors()
void SDL::PaletteRef::SetColors |
( |
SpanRef< const SDL_Color > |
colors, |
|
|
int |
firstcolor = 0 |
|
) |
| |
|
inline |
- Parameters
-
colors | an array of Color structures to copy into the palette. |
firstcolor | the index of the first palette entry to modify. |
- Exceptions
-
- Thread safety:
- It is safe to call this function from any thread, as long as the palette is not modified or destroyed in another thread.
- Since
- This function is available since SDL 3.2.0.
The documentation for this struct was generated from the following file: