direct_bitmap_item class
#include <bn_direct_bitmap_item.h>
Contains the required information to generate direct bitmaps.
The assets conversion tools generate an object of this type in the build folder for each *.bmp file with direct_bitmap type.
The colors are not copied but referenced, so they should outlive the direct_
Constructors, destructors, conversion operators
-
direct_bitmap_item(const bn::
color& colors_ref, const size& dimensions) constexpr - Constructor.
-
direct_bitmap_item(const bn::
color& colors_ref, const size& dimensions, compression_ type compression) constexpr - Constructor.
Public functions
-
auto colors_ptr() const -> const bn::
color* constexpr - Returns a pointer to the referenced bitmap colors.
-
auto colors_ref() const -> const bn::
color& constexpr - Returns the referenced bitmap colors.
- auto dimensions() const -> const size& constexpr
- Returns the size in pixels of the referenced bitmap.
- auto colors_count() const -> int constexpr
- Returns the number of referenced colors.
- auto color_index(int x, int y) const -> int constexpr
- Returns the index of the referenced color in the specified pixel coordinates.
- auto color_index(const point& position) const -> int constexpr
- Returns the index of the referenced color in the specified pixel coordinates.
-
auto color(int x,
int y) const -> bn::
color constexpr - Returns the referenced bitmap color in the specified pixel coordinates.
-
auto color(const point& position) const -> bn::
color constexpr - Returns the referenced bitmap color in the specified pixel coordinates.
-
auto compression() const -> compression_
type constexpr - Returns the compression type.
-
auto decompress(span<bn::
color> decompressed_colors_ref) const -> direct_ bitmap_ item - Decompresses the stored data in the colors referenced by decompressed_colors_ref.
Friends
-
auto operator==(const direct_
bitmap_ item& a, const direct_ bitmap_ item& b) -> bool defaulted constexpr - Default equal operator.
Function documentation
bn:: direct_bitmap_item:: direct_bitmap_item(const bn:: color& colors_ref,
const size& dimensions) constexpr
Constructor.
| Parameters | |
|---|---|
| colors_ref | Reference to the bitmap colors. |
| dimensions | Size in pixels of the referenced bitmap. |
The colors are not copied but referenced, so they should outlive the direct_
bn:: direct_bitmap_item:: direct_bitmap_item(const bn:: color& colors_ref,
const size& dimensions,
compression_ type compression) constexpr
Constructor.
| Parameters | |
|---|---|
| colors_ref | Reference to the bitmap colors. |
| dimensions | Size in pixels of the referenced bitmap. |
| compression | Compression type. |
The colors are not copied but referenced, so they should outlive the direct_
const bn:: color* bn:: direct_bitmap_item:: colors_ptr() const constexpr
Returns a pointer to the referenced bitmap colors.
The colors are not copied but referenced, so they should outlive the direct_
const bn:: color& bn:: direct_bitmap_item:: colors_ref() const constexpr
Returns the referenced bitmap colors.
The colors are not copied but referenced, so they should outlive the direct_
const size& bn:: direct_bitmap_item:: dimensions() const constexpr
Returns the size in pixels of the referenced bitmap.
The colors are not copied but referenced, so they should outlive the direct_
int bn:: direct_bitmap_item:: colors_count() const constexpr
Returns the number of referenced colors.
The colors are not copied but referenced, so they should outlive the direct_
int bn:: direct_bitmap_item:: color_index(int x,
int y) const constexpr
Returns the index of the referenced color in the specified pixel coordinates.
| Parameters | |
|---|---|
| x | Horizontal position of the bitmap color [0..dimensions().width()). |
| y | Vertical position of the bitmap color [0..dimensions().height()). |
| Returns | The index of the referenced bitmap color. |
The colors are not copied but referenced, so they should outlive the direct_
int bn:: direct_bitmap_item:: color_index(const point& position) const constexpr
Returns the index of the referenced color in the specified pixel coordinates.
| Parameters | |
|---|---|
| position | Position of the bitmap color. |
| Returns | The index of the referenced bitmap color. |
The colors are not copied but referenced, so they should outlive the direct_
bn:: color bn:: direct_bitmap_item:: color(int x,
int y) const constexpr
Returns the referenced bitmap color in the specified pixel coordinates.
| Parameters | |
|---|---|
| x | Horizontal position of the bitmap color [0..dimensions().width()). |
| y | Vertical position of the bitmap color [0..dimensions().height()). |
| Returns | The referenced bitmap color. |
The colors are not copied but referenced, so they should outlive the direct_
bn:: color bn:: direct_bitmap_item:: color(const point& position) const constexpr
Returns the referenced bitmap color in the specified pixel coordinates.
| Parameters | |
|---|---|
| position | Position of the bitmap color. |
| Returns | The referenced bitmap color. |
The colors are not copied but referenced, so they should outlive the direct_
direct_ bitmap_ item bn:: direct_bitmap_item:: decompress(span<bn:: 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 | An direct_ |
If the source and destination colors overlap, the behavior is undefined.