palette_bitmap_item class
#include <bn_palette_bitmap_item.h>
Contains the required information to generate palette bitmaps.
The assets conversion tools generate an object of this type in the build folder for each *.bmp file with palette_bitmap type.
Pixels and colors are not copied but referenced, so they should outlive the palette_
Constructors, destructors, conversion operators
- palette_bitmap_item(const uint8_t& pixels_ref, const size& dimensions, const span<const color>& colors_ref) constexpr
- Constructor.
-
palette_bitmap_item(const palette_
bitmap_ pixels_ item& pixels_item, const bg_ palette_ item& palette_item) constexpr - Constructor.
Public functions
-
auto pixels_item() const -> const palette_
bitmap_ pixels_ item& constexpr - Returns the item that references the pixels of the bitmap.
-
auto palette_item() const -> const bg_
palette_ item& constexpr - Returns the item that references the colors of the bitmap.
-
auto decompress(span<uint8_t> decompressed_pixels_ref,
span<color> decompressed_colors_ref) const -> palette_
bitmap_ item - Decompresses the stored data in the pixels referenced by decompressed_pixels_ref and the colors referenced by decompressed_colors_ref.
Friends
-
auto operator==(const palette_
bitmap_ item& a, const palette_ bitmap_ item& b) -> bool defaulted constexpr - Default equal operator.
Function documentation
bn:: palette_bitmap_item:: palette_bitmap_item(const uint8_t& pixels_ref,
const size& dimensions,
const span<const color>& colors_ref) constexpr
Constructor.
| Parameters | |
|---|---|
| pixels_ref | Reference to the palette bitmap pixels. |
| dimensions | Size in pixels of the referenced palette bitmap pixels. |
| colors_ref | Reference to an array of multiples of 16 colors. |
The pixels are not copied but referenced, so they should outlive the palette_
The colors are not copied but referenced, so they should outlive the palette_
bn:: palette_bitmap_item:: palette_bitmap_item(const palette_ bitmap_ pixels_ item& pixels_item,
const bg_ palette_ item& palette_item) constexpr
Constructor.
| Parameters | |
|---|---|
| pixels_item | It references the pixels of the bitmap. |
| palette_item | It references the colors of the bitmap. |
palette_ bitmap_ item bn:: palette_bitmap_item:: decompress(span<uint8_t> decompressed_pixels_ref,
span<color> decompressed_colors_ref) const
Decompresses the stored data in the pixels referenced by decompressed_pixels_ref and the colors referenced by decompressed_colors_ref.
| Parameters | |
|---|---|
| decompressed_pixels_ref | Destination of the decompressed pixels. |
| decompressed_colors_ref | Destination of the decompressed colors. |
| Returns | A sprite_ |
If the source and destination pixels or colors overlap, the behavior is undefined.