class
#include <bn_sprite_palette_item.h>
sprite_palette_item Contains the required information to generate sprite color palettes.
The assets conversion tools generate an object of this type in the build folder for each *.bmp file with sprite
type.
The colors are not copied but referenced, so they should outlive the sprite_
Constructors, destructors, conversion operators
-
sprite_palette_item(const span<const color>& colors_ref,
bpp_
mode bpp) constexpr - Constructor.
-
sprite_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 -> sprite_
palette_ item - Decompresses the stored data in the colors referenced by decompressed_colors_ref.
-
auto find_palette() const -> optional<sprite_
palette_ ptr> - Searches for a sprite_
palette_ ptr which contains the colors referenced by this item. -
auto create_palette() const -> sprite_
palette_ ptr - Searches for a sprite_
palette_ ptr which contains the colors referenced by this item. If it is not found, it creates a sprite_ palette_ ptr which contains them. -
auto create_new_palette() const -> sprite_
palette_ ptr - Creates a new sprite_
palette_ ptr which contains the colors referenced by this item. -
auto create_palette_optional() const -> optional<sprite_
palette_ ptr> - Searches for a sprite_
palette_ ptr which contains the colors referenced by this item. If it is not found, it creates a sprite_ palette_ ptr which contains them. -
auto create_new_palette_optional() const -> optional<sprite_
palette_ ptr> - Creates a new sprite_
palette_ ptr which contains the colors referenced by this item.
Friends
-
auto operator==(const sprite_
palette_ item& a, const sprite_ palette_ item& b) -> bool defaulted constexpr - Default equal operator.
Function documentation
bn:: sprite_palette_item:: sprite_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 sprite_
bn:: sprite_palette_item:: sprite_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 sprite_
const span<const color>& bn:: sprite_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 sprite_
sprite_ palette_ item bn:: sprite_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 sprite_ |
If the source and destination colors overlap, the behavior is undefined.
optional<sprite_ palette_ ptr> bn:: sprite_palette_item:: find_palette() const
Searches for a sprite_
Returns | sprite_ |
---|
sprite_ palette_ ptr bn:: sprite_palette_item:: create_palette() const
Searches for a sprite_
Returns | sprite_ |
---|
sprite_ palette_ ptr bn:: sprite_palette_item:: create_new_palette() const
Creates a new sprite_
Returns | sprite_ |
---|
optional<sprite_ palette_ ptr> bn:: sprite_palette_item:: create_palette_optional() const
Searches for a sprite_
Returns | sprite_ |
---|
optional<sprite_ palette_ ptr> bn:: sprite_palette_item:: create_new_palette_optional() const
Creates a new sprite_
Returns | sprite_ |
---|