bn::direct_bitmap_roi class

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

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

Constructors, destructors, conversion operators

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

Public functions

auto item_ref() const -> const direct_bitmap_item& constexpr
Returns the referenced direct bitmap 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 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 direct bitmap color in the specified pixel coordinates.
auto color(const point& position) const -> bn::color constexpr
Returns the referenced direct bitmap color in the specified pixel coordinates.

Friends

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

Function documentation

bn::direct_bitmap_roi::direct_bitmap_roi(const direct_bitmap_item& item_ref, int x, int y, int width, int height) constexpr

Constructor.

Parameters
item_ref Reference to the direct bitmap 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 direct_bitmap_roi to avoid dangling references.

bn::direct_bitmap_roi::direct_bitmap_roi(const direct_bitmap_item& item_ref, const point& position, const size& dimensions) constexpr

Constructor.

Parameters
item_ref Reference to the direct bitmap 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 direct_bitmap_roi to avoid dangling references.

const direct_bitmap_item& bn::direct_bitmap_roi::item_ref() const constexpr

Returns the referenced direct bitmap item.

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

int bn::direct_bitmap_roi::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 direct bitmap color [0..dimensions().width()).
y Vertical position of the direct bitmap color [0..dimensions().height()).
Returns The index of the referenced direct bitmap color.

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

int bn::direct_bitmap_roi::color_index(const point& position) const constexpr

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

Parameters
position Position of the direct bitmap color.
Returns The index of the referenced direct bitmap color.

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

bn::color bn::direct_bitmap_roi::color(int x, int y) const constexpr

Returns the referenced direct bitmap color in the specified pixel coordinates.

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

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

bn::color bn::direct_bitmap_roi::color(const point& position) const constexpr

Returns the referenced direct bitmap color in the specified pixel coordinates.

Parameters
position Position of the direct bitmap color.
Returns The referenced direct bitmap color.

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