bn::palette_bitmap_roi class

Contains the required information to represent a region of interest (RoI) of a palette bitmap pixels item.

The item is not copied but referenced, so it should outlive the palette_bitmap_roi to avoid dangling references.

Constructors, destructors, conversion operators

palette_bitmap_roi(const palette_bitmap_pixels_item& item_ref, int x, int y, int width, int height) constexpr
Constructor.
palette_bitmap_roi(const palette_bitmap_pixels_item& item_ref, const point& position, const size& dimensions) constexpr
Constructor.

Public functions

auto item_ref() const -> const palette_bitmap_pixels_item& constexpr
Returns the referenced palette bitmap pixels item.
auto x() const -> int constexpr
Returns the horizontal position of the top-left corner of the region of interest.
auto y() const -> int constexpr
Returns the vertical position of the top-left corner of the region of interest.
auto position() const -> const point& constexpr
Returns the position of the top-left corner of the region of interest.
auto width() const -> int constexpr
Returns the width in pixels of the region of interest.
auto height() const -> int constexpr
Returns the height in pixels of the region of interest.
auto dimensions() const -> const size& constexpr
Returns the size in pixels of the region of interest.
auto pixels_count() const -> int constexpr
Returns the number of referenced 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.

Friends

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

Function documentation

bn::palette_bitmap_roi::palette_bitmap_roi(const palette_bitmap_pixels_item& item_ref, int x, int y, int width, int height) constexpr

Constructor.

Parameters
item_ref Reference to the palette bitmap pixels item.
x Horizontal position of the top-left corner of the region of interest.
y Vertical position of the top-left corner of the region of interest.
width Width in pixels of the region of interest.
height Height in pixels of the region of interest.

The item is not copied but referenced, so it should outlive the palette_bitmap_roi to avoid dangling references.

bn::palette_bitmap_roi::palette_bitmap_roi(const palette_bitmap_pixels_item& item_ref, const point& position, const size& dimensions) constexpr

Constructor.

Parameters
item_ref Reference to the palette bitmap pixels item.
position Position of the top-left corner of the region of interest.
dimensions Size in pixels of the region of interest.

The item is not copied but referenced, so it should outlive the palette_bitmap_roi to avoid dangling references.

const palette_bitmap_pixels_item& bn::palette_bitmap_roi::item_ref() const constexpr

Returns the referenced palette bitmap pixels item.

The item is not copied but referenced, so it should outlive the palette_bitmap_roi to avoid dangling references.

int bn::palette_bitmap_roi::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 item is not copied but referenced, so it should outlive the palette_bitmap_roi to avoid dangling references.

int bn::palette_bitmap_roi::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 item is not copied but referenced, so it should outlive the palette_bitmap_roi to avoid dangling references.

uint8_t bn::palette_bitmap_roi::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 item is not copied but referenced, so it should outlive the palette_bitmap_roi to avoid dangling references.

uint8_t bn::palette_bitmap_roi::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 item is not copied but referenced, so it should outlive the palette_bitmap_roi to avoid dangling references.