BLRegion Class Reference

2D region [C++ API].

Region is a set of rectangles sorted and coalesced by their Y/X coordinates.

Member Functions

Construction & Destruction
Overloaded Operators
Common Functionality
Region Content
Region Operations
Hit Testing

Static Functions

Additional Inherited Members

- Public Attributes inherited from BLRegionCore

Member Function Documentation

bool BLRegion::isNone() const

Tests whether the region is a built-in null instance.

bool BLRegion::empty() const

Tests whether the region is empty.

bool BLRegion::equals(const BLRegion& other) const

Tests whether this region and other are equal.

uint32_t BLRegion::type() const

Returns the type of the region, see BLRegionType.

This inline method has also a C API equivalent blRegionGetType().

bool BLRegion::isRect() const

Tests whether the region is one rectangle.

bool BLRegion::isComplex() const

Tests whether the region is complex.

size_t BLRegion::size() const

Returns the region size.

size_t BLRegion::capacity() const

Returns the region capacity.

const BLBoxI* BLRegion::data() const

Returns a const pointer to the region data.

const BLBoxI* BLRegion::begin() const

Returns a const pointer to the beginning of region data (iterator compatibility).

const BLBoxI* BLRegion::end() const

Returns a const pointer to the end of region data (iterator compatibility).

const BLBoxI& BLRegion::boundingBox() const

Returns the region's bounding box.

const BLRegionView& BLRegion::view() const

Returns the region data as BLRegionView.

BLResult BLRegion::reserve(size_t n)

Reserves at least n boxes in this region.

BLResult BLRegion::shrink()

Shrinks the region data so it consumes only memory it requires.

BLResult BLRegion::translate(const BLPointI& pt)

Translates the region by the given point pt.

Possible overflow will be handled by clipping to a maximum region boundary, so the final region could be smaller than the region before translation.

BLResult BLRegion::translateAndClip(const BLPointI& pt, const BLBoxI& clipBox)

Translates the region by the given point pt and clip it to the given clipBox.

BLResult BLRegion::intersectAndClip(const BLRegion& r, const BLBoxI& clipBox)

Translates the region with r and clip it to the given clipBox.

uint32_t BLRegion::hitTest(const BLPointI& pt) const[1/2]

Tests if a given point pt is in region, returns BLHitTest.

uint32_t BLRegion::hitTest(const BLBoxI& box) const[2/2]

Tests if a given box is in region, returns BLHitTest.