class
#include <bn_bg_palette_ptr.h>
bg_palette_ptr std::shared_ptr like smart pointer that retains shared ownership of a background color palette.
Several bg_
The background color palette is released when the last remaining bg_
Public static functions
-
static auto find(const bg_
palette_ item& palette_item) -> optional<bg_ palette_ ptr> - Searches for a bg_
palette_ ptr which contains the given colors. -
static auto create(const bg_
palette_ item& palette_item) -> bg_ palette_ ptr - Searches for a bg_
palette_ ptr which contains the given colors. If it is not found, it creates a bg_ palette_ ptr which contains them. -
static auto create_new(const bg_
palette_ item& palette_item) -> bg_ palette_ ptr - Creates a bg_
palette_ ptr which contains the given colors. -
static auto create_optional(const bg_
palette_ item& palette_item) -> optional<bg_ palette_ ptr> - Searches for a bg_
palette_ ptr which contains the given colors. If it is not found, it creates a bg_ palette_ ptr which contains them. -
static auto create_new_optional(const bg_
palette_ item& palette_item) -> optional<bg_ palette_ ptr> - Creates a bg_
palette_ ptr which contains the given colors.
Constructors, destructors, conversion operators
-
bg_palette_ptr(const bg_
palette_ ptr& other) - Copy constructor.
-
bg_palette_ptr(bg_
palette_ ptr&& other) noexcept - Move constructor.
- ~bg_palette_ptr()
- Releases the referenced background color palette if no more bg_
palette_ ptr objects reference to it.
Public functions
-
auto operator=(const bg_
palette_ ptr& other) -> bg_ palette_ ptr& - Copy assignment operator.
-
auto operator=(bg_
palette_ ptr&& other) -> bg_ palette_ ptr& noexcept - Move assignment operator.
- auto id() const -> int
- Returns the internal id.
- auto colors_count() const -> int
- Returns the number of colors contained in this palette.
- auto colors() const -> span<const color>
- Returns the colors contained in this palette.
-
void set_colors(const bg_
palette_ item& palette_item) - Sets the colors contained in this palette.
- void set_color(int color_index, color color)
- Sets a single color in this palette.
-
auto bpp() const -> bpp_
mode - Returns the bits per pixel of this palette.
- auto inverted() const -> bool
- Indicates if the colors of this palette are inverted or not.
- void set_inverted(bool inverted)
- Sets if the colors of this palette must be inverted or not.
- auto grayscale_intensity() const -> fixed
- Returns the intensity of the grayscale effect applied to the colors of this palette.
- void set_grayscale_intensity(fixed intensity)
- Sets the intensity of the grayscale effect applied to the colors of this palette.
- auto hue_shift_intensity() const -> fixed
- Returns the intensity of the hue shift effect applied to the colors of this palette.
- void set_hue_shift_intensity(fixed intensity)
- Sets the intensity of the hue shift effect applied to the colors of this palette.
- auto fade_color() const -> color
- Returns the color of the fade effect applied to the colors of this palette.
- auto fade_intensity() const -> fixed
- Returns the intensity of the fade effect applied to the colors of this palette.
- void set_fade_color(color color)
- Sets the color of the fade effect applied to the colors of this palette.
- void set_fade_intensity(fixed intensity)
- Sets the intensity of the fade effect applied to the colors of this palette.
- void set_fade(color color, fixed intensity)
- Sets the color and the intensity of the fade effect applied to the colors of this palette.
- auto rotate_count() const -> int
- Returns the number of colors to rotate to the right in this palette.
- void set_rotate_count(int count)
- Sets the number of colors to rotate to the right in this palette.
- auto rotate_range_start() const -> int
- Returns the starting color index of the rotation range in this palette.
- auto rotate_range_size() const -> int
- Returns the number of colors of the rotation range in this palette.
- void set_rotate_range(int start, int size)
- Sets the rotation range of this palette.
-
void swap(bg_
palette_ ptr& other) - Exchanges the contents of this bg_
palette_ ptr with those of the other one.
Friends
-
void swap(bg_
palette_ ptr& a, bg_ palette_ ptr& b) - Exchanges the contents of a bg_
palette_ ptr with those of another one. -
auto operator==(const bg_
palette_ ptr& a, const bg_ palette_ ptr& b) -> bool defaulted - Default equal operator.
Function documentation
static optional<bg_ palette_ ptr> bn:: bg_palette_ptr:: find(const bg_ palette_ item& palette_item)
Searches for a bg_
Parameters | |
---|---|
palette_item | bg_ |
Returns | bg_ |
static bg_ palette_ ptr bn:: bg_palette_ptr:: create(const bg_ palette_ item& palette_item)
Searches for a bg_
Parameters | |
---|---|
palette_item | bg_ |
Returns | The requested bg_ |
static bg_ palette_ ptr bn:: bg_palette_ptr:: create_new(const bg_ palette_ item& palette_item)
Creates a bg_
Parameters | |
---|---|
palette_item | bg_ |
Returns | The requested bg_ |
static optional<bg_ palette_ ptr> bn:: bg_palette_ptr:: create_optional(const bg_ palette_ item& palette_item)
Searches for a bg_
Parameters | |
---|---|
palette_item | bg_ |
Returns | The requested bg_ |
static optional<bg_ palette_ ptr> bn:: bg_palette_ptr:: create_new_optional(const bg_ palette_ item& palette_item)
Creates a bg_
Parameters | |
---|---|
palette_item | bg_ |
Returns | The requested bg_ |
bn:: bg_palette_ptr:: bg_palette_ptr(const bg_ palette_ ptr& other)
Copy constructor.
Parameters | |
---|---|
other | bg_ |
bn:: bg_palette_ptr:: bg_palette_ptr(bg_ palette_ ptr&& other) noexcept
Move constructor.
Parameters | |
---|---|
other | bg_ |
bg_ palette_ ptr& bn:: bg_palette_ptr:: operator=(const bg_ palette_ ptr& other)
Copy assignment operator.
Parameters | |
---|---|
other | bg_ |
Returns | Reference to this. |
bg_ palette_ ptr& bn:: bg_palette_ptr:: operator=(bg_ palette_ ptr&& other) noexcept
Move assignment operator.
Parameters | |
---|---|
other | bg_ |
Returns | Reference to this. |
void bn:: bg_palette_ptr:: set_colors(const bg_ palette_ item& palette_item)
Sets the colors contained in this palette.
Parameters | |
---|---|
palette_item | bg_ |
void bn:: bg_palette_ptr:: set_grayscale_intensity(fixed intensity)
Sets the intensity of the grayscale effect applied to the colors of this palette.
Parameters | |
---|---|
intensity | New intensity in the range [0..1]. |
void bn:: bg_palette_ptr:: set_hue_shift_intensity(fixed intensity)
Sets the intensity of the hue shift effect applied to the colors of this palette.
Parameters | |
---|---|
intensity | New intensity in the range [0..1]. |
void bn:: bg_palette_ptr:: set_fade_intensity(fixed intensity)
Sets the intensity of the fade effect applied to the colors of this palette.
Parameters | |
---|---|
intensity | New intensity in the range [0..1]. |
void bn:: bg_palette_ptr:: set_rotate_count(int count)
Sets the number of colors to rotate to the right in this palette.
Parameters | |
---|---|
count | Number of colors to rotate to the right in the range [1 - rotate_ |
void bn:: bg_palette_ptr:: set_rotate_range(int start,
int size)
Sets the rotation range of this palette.
Parameters | |
---|---|
start | Starting color index in the range [0 .. colors_ |
size | Number of colors in the range [2 .. colors_ |
void bn:: bg_palette_ptr:: swap(bg_ palette_ ptr& other)
Exchanges the contents of this bg_
Parameters | |
---|---|
other | bg_ |
void swap(bg_ palette_ ptr& a,
bg_ palette_ ptr& b)
Exchanges the contents of a bg_
Parameters | |
---|---|
a | First bg_ |
b | Second bg_ |