class
#include <bn_bg_palette_item.h>
bg_palette_item Contains the required information to generate background color palettes.
The assets conversion tools generate an object of this type in the build folder for each *.bmp file with regular_bg
or affine_bg
types.
The colors are not copied but referenced, so they should outlive the bg_
Constructors, destructors, conversion operators
-
bg_palette_item(const span<const color>& colors_ref,
bpp_
mode bpp) constexpr - Constructor.
-
bg_palette_item(const span<const color>& colors_ref,
bpp_
mode bpp, compression_ type compression) constexpr - Constructor.
Public functions
- auto colors_ref() const -> const span<const color>& constexpr
- Returns the referenced array of multiples of 16 colors.
-
auto bpp() const -> bpp_
mode constexpr - Returns the bits per pixel of the color palettes to create.
-
auto compression() const -> compression_
type constexpr - Returns the compression type.
-
auto decompress(span<color> decompressed_colors_ref) const -> bg_
palette_ item - Decompresses the stored data in the colors referenced by decompressed_colors_ref.
-
auto find_palette() const -> optional<bg_
palette_ ptr> - Searches for a bg_
palette_ ptr which contains the colors referenced by this item. -
auto create_palette() const -> bg_
palette_ ptr - Searches for a bg_
palette_ ptr which contains the colors referenced by this item. If it is not found, it creates a bg_ palette_ ptr which contains them. -
auto create_new_palette() const -> bg_
palette_ ptr - Creates a new bg_
palette_ ptr which contains the colors referenced by this item. -
auto create_palette_optional() const -> optional<bg_
palette_ ptr> - Searches for a bg_
palette_ ptr which contains the colors referenced by this item. If it is not found, it creates a bg_ palette_ ptr which contains them. -
auto create_new_palette_optional() const -> optional<bg_
palette_ ptr> - Creates a new bg_
palette_ ptr which contains the colors referenced by this item.
Friends
-
auto operator==(const bg_
palette_ item& a, const bg_ palette_ item& b) -> bool defaulted constexpr - Default equal operator.
Function documentation
bn:: bg_palette_item:: bg_palette_item(const span<const color>& colors_ref,
bpp_ mode bpp) constexpr
Constructor.
Parameters | |
---|---|
colors_ref | Reference to an array of multiples of 16 colors. |
bpp | Bits per pixel of the color palettes to create. |
The colors are not copied but referenced, so they should outlive the bg_
bn:: bg_palette_item:: bg_palette_item(const span<const color>& colors_ref,
bpp_ mode bpp,
compression_ type compression) constexpr
Constructor.
Parameters | |
---|---|
colors_ref | Reference to an array of multiples of 16 colors. |
bpp | Bits per pixel of the color palettes to create. |
compression | Compression type. |
The colors are not copied but referenced, so they should outlive the bg_
const span<const color>& bn:: bg_palette_item:: colors_ref() const constexpr
Returns the referenced array of multiples of 16 colors.
The colors are not copied but referenced, so they should outlive the bg_
bg_ palette_ item bn:: bg_palette_item:: decompress(span<color> decompressed_colors_ref) const
Decompresses the stored data in the colors referenced by decompressed_colors_ref.
Parameters | |
---|---|
decompressed_colors_ref | Destination of the decompressed colors. |
Returns | A bg_ |
If the source and destination colors overlap, the behavior is undefined.
optional<bg_ palette_ ptr> bn:: bg_palette_item:: find_palette() const
Searches for a bg_
Returns | bg_ |
---|
bg_ palette_ ptr bn:: bg_palette_item:: create_palette() const
Searches for a bg_
Returns | bg_ |
---|
bg_ palette_ ptr bn:: bg_palette_item:: create_new_palette() const
Creates a new bg_
Returns | bg_ |
---|
optional<bg_ palette_ ptr> bn:: bg_palette_item:: create_palette_optional() const
Searches for a bg_
Returns | bg_ |
---|
optional<bg_ palette_ ptr> bn:: bg_palette_item:: create_new_palette_optional() const
Creates a new bg_
Returns | bg_ |
---|