Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ersa::Rect Struct Reference

#include <types.h>

Public Member Functions

constexpr Rect ()=default
 
constexpr Rect (int16_t rx, int16_t ry, int16_t rw, int16_t rh)
 
constexpr bool isEmpty () const
 
constexpr bool contains (int16_t px, int16_t py) const
 

Public Attributes

int16_t x {0}
 
int16_t y {0}
 
int16_t w {0}
 
int16_t h {0}
 

Detailed Description

Half-open axis-aligned rectangle used for layout and partial refresh regions. Left/top are included and right/bottom are excluded; this convention matches framebuffer indexing and allows adjacent regions to share an edge safely.

Constructor & Destructor Documentation

◆ Rect() [1/2]

constexpr ersa::Rect::Rect ( )
constexprdefault

Construct an empty rectangle at the origin.

◆ Rect() [2/2]

constexpr ersa::Rect::Rect ( int16_t  rx,
int16_t  ry,
int16_t  rw,
int16_t  rh 
)
inlineconstexpr

Construct a rectangle with origin and width/height extents.

Member Function Documentation

◆ contains()

constexpr bool ersa::Rect::contains ( int16_t  px,
int16_t  py 
) const
inlineconstexpr

Test point containment using the half-open edge convention.

◆ isEmpty()

constexpr bool ersa::Rect::isEmpty ( ) const
inlineconstexpr

Return true if either extent is zero or negative.

Member Data Documentation

◆ h

int16_t ersa::Rect::h {0}

Vertical extent; non-positive values make the rectangle empty.

◆ w

int16_t ersa::Rect::w {0}

Horizontal extent; non-positive values make the rectangle empty.

◆ x

int16_t ersa::Rect::x {0}

Inclusive left edge in logical pixels.

◆ y

int16_t ersa::Rect::y {0}

Inclusive top edge in logical pixels.


The documentation for this struct was generated from the following file: