bn::palette_bitmap_pixels_item class

Contains the required information to generate palette bitmap pixels.

The assets conversion tools generate an object of this type in the build folder for each *.bmp file with palette_bitmap_pixels type.

The pixels are not copied but referenced, so they should outlive the palette_bitmap_pixels_item to avoid dangling references.

Constructors, destructors, conversion operators

palette_bitmap_pixels_item(const uint8_t& pixels_ref, const size& dimensions) constexpr
Constructor.
palette_bitmap_pixels_item(const uint8_t& pixels_ref, const size& dimensions, compression_type compression) constexpr
Constructor.

Public functions

auto pixels_ptr() const -> const uint8_t* constexpr
Returns a pointer to the referenced palette bitmap pixels.
auto pixels_ref() const -> const uint8_t& constexpr
Returns the referenced palette bitmap pixels.
auto dimensions() const -> const size& constexpr
Returns the size in pixels of the referenced palette bitmap pixels.
auto pixels_count() const -> int constexpr
Returns the number of referenced palette bitmap pixels.
auto pixel_index(int x, int y) const -> int constexpr
Returns the index of the referenced pixel in the specified pixel coordinates.
auto pixel_index(const point& position) const -> int constexpr
Returns the index of the referenced pixel in the specified pixel coordinates.
auto pixel(int x, int y) const -> uint8_t constexpr
Returns the referenced palette bitmap pixel in the specified pixel coordinates.
auto pixel(const point& position) const -> uint8_t constexpr
Returns the referenced palette bitmap pixel in the specified pixel coordinates.
auto compression() const -> compression_type constexpr
Returns the compression type.
auto decompress(span<uint8_t> decompressed_pixels_ref) const -> palette_bitmap_pixels_item
Decompresses the stored data in the pixels referenced by decompressed_pixels_ref.

Friends

auto operator==(const palette_bitmap_pixels_item& a, const palette_bitmap_pixels_item& b) -> bool defaulted constexpr
Default equal operator.

Function documentation

bn::palette_bitmap_pixels_item::palette_bitmap_pixels_item(const uint8_t& pixels_ref, const size& dimensions) constexpr

Constructor.

Parameters
pixels_ref Reference to the palette bitmap pixels.
dimensions Size in pixels of the referenced palette bitmap pixels.

The pixels are not copied but referenced, so they should outlive the palette_bitmap_pixels_item to avoid dangling references.

bn::palette_bitmap_pixels_item::palette_bitmap_pixels_item(const uint8_t& pixels_ref, const size& dimensions, compression_type compression) constexpr

Constructor.

Parameters
pixels_ref Reference to the palette bitmap pixels.
dimensions Size in pixels of the referenced palette bitmap pixels.
compression Compression type.

The pixels are not copied but referenced, so they should outlive the palette_bitmap_pixels_item to avoid dangling references.

const uint8_t* bn::palette_bitmap_pixels_item::pixels_ptr() const constexpr

Returns a pointer to the referenced palette bitmap pixels.

The pixels are not copied but referenced, so they should outlive the palette_bitmap_pixels_item to avoid dangling references.

const uint8_t& bn::palette_bitmap_pixels_item::pixels_ref() const constexpr

Returns the referenced palette bitmap pixels.

The pixels are not copied but referenced, so they should outlive the palette_bitmap_pixels_item to avoid dangling references.

const size& bn::palette_bitmap_pixels_item::dimensions() const constexpr

Returns the size in pixels of the referenced palette bitmap pixels.

The pixels are not copied but referenced, so they should outlive the palette_bitmap_pixels_item to avoid dangling references.

int bn::palette_bitmap_pixels_item::pixels_count() const constexpr

Returns the number of referenced palette bitmap pixels.

The pixels are not copied but referenced, so they should outlive the palette_bitmap_pixels_item to avoid dangling references.

int bn::palette_bitmap_pixels_item::pixel_index(int x, int y) const constexpr

Returns the index of the referenced pixel in the specified pixel coordinates.

Parameters
x Horizontal position of the palette bitmap pixel [0..dimensions().width()).
y Vertical position of the palette bitmap pixel [0..dimensions().height()).
Returns The index of the referenced palette bitmap pixel.

The pixels are not copied but referenced, so they should outlive the palette_bitmap_pixels_item to avoid dangling references.

int bn::palette_bitmap_pixels_item::pixel_index(const point& position) const constexpr

Returns the index of the referenced pixel in the specified pixel coordinates.

Parameters
position Position of the palette bitmap pixel.
Returns The index of the referenced palette bitmap pixel.

The pixels are not copied but referenced, so they should outlive the palette_bitmap_pixels_item to avoid dangling references.

uint8_t bn::palette_bitmap_pixels_item::pixel(int x, int y) const constexpr

Returns the referenced palette bitmap pixel in the specified pixel coordinates.

Parameters
x Horizontal position of the palette bitmap pixel [0..dimensions().width()).
y Vertical position of the palette bitmap pixel [0..dimensions().height()).
Returns The referenced palette bitmap pixel.

The pixels are not copied but referenced, so they should outlive the palette_bitmap_pixels_item to avoid dangling references.

uint8_t bn::palette_bitmap_pixels_item::pixel(const point& position) const constexpr

Returns the referenced palette bitmap pixel in the specified pixel coordinates.

Parameters
position Position of the palette bitmap pixel.
Returns The referenced palette bitmap pixel.

The pixels are not copied but referenced, so they should outlive the palette_bitmap_pixels_item to avoid dangling references.

palette_bitmap_pixels_item bn::palette_bitmap_pixels_item::decompress(span<uint8_t> decompressed_pixels_ref) const

Decompresses the stored data in the pixels referenced by decompressed_pixels_ref.

Parameters
decompressed_pixels_ref Destination of the decompressed pixels.
Returns An palette_bitmap_pixels_item pointing to the decompressed pixels.

If the source and destination pixels overlap, the behavior is undefined.