LCDGFX LCD display driver  1.2.0
Lightweight graphics library for SSD1306, SSD1325, SSD1327, SSD1331, SSD1351, SH1106, SH1107, IL9163, ST7735, ST7789, ILI9341, PCD8544 displays over I2C/SPI
_NanoRect Struct Reference

NanoRect structure describes rectangle area. More...

#include <rect.h>

Collaboration diagram for _NanoRect:

Public Member Functions

lcdint_t width () const
 returns width of NanoRect
 
const NanoPoint size () const
 returns size of NanoRect
 
const NanoPoint center () const
 returns center point of NanoRect
 
lcdint_t height () const
 returns height of NanoRect
 
void move (lcdint_t dx, lcdint_t dy)
 Shifts rectangle area by dx;dy pixels. More...
 
void addH (lcdint_t dx)
 Shifts rectangle area by dx pixels. More...
 
void addV (lcdint_t dy)
 Shifts rectangle area by dy pixels. More...
 
void setRect (lcdint_t l, lcdint_t t, lcdint_t r, lcdint_t b)
 Initializes NanoRect with specified values. More...
 
void crop (const _NanoRect &rect)
 Crops rectangle to fit specified area. More...
 
bool collisionX (lcdint_t x) const
 Returns true if specified x position is between left and right borders. More...
 
bool collisionY (lcdint_t y) const
 Returns true if specified y position is between left and right borders. More...
 
bool collision (const NanoPoint &p) const
 Returns true if specified point is inside rectangle area. More...
 
bool contains (const NanoPoint &p) const
 Returns true of point belongs to rectangle area. More...
 
bool contains (const _NanoRect &r) const
 Returns true if whole rectangle belongs to rectangle area. More...
 
bool containsPartOf (const _NanoRect &r) const
 Returns true if rectangle topleft or rightbottom points belong to rectangle area. More...
 
bool above (const NanoPoint &p) const
 Returns true if specified point is above rectangle area. More...
 
bool below (const NanoPoint &p) const
 Returns true if specified point is below rectangle area. More...
 
_NanoRect operator- (const _NanoPoint &p)
 Returns true if specified point is above rectangle area. More...
 
_NanoRect operator+ (const _NanoPoint &p)
 Add point to all points of rectangle. More...
 
_NanoRectoperator+= (const _NanoPoint &p)
 Subtracts point to all points of rectangle. More...
 
_NanoRect operator>> (const uint8_t bits) const
 Shifts right x,y value of the point by bits value. More...
 
_NanoRect operator<< (const uint8_t bits) const
 Shifts left x,y value of the point by bits value. More...
 

Public Attributes

NanoPoint p1
 top-left point of the rectangle area
 
NanoPoint p2
 right-bottom point of the rectangle area
 

Detailed Description

NanoRect structure describes rectangle area.

Definition at line 42 of file rect.h.

Member Function Documentation

◆ above()

bool _NanoRect::above ( const NanoPoint p) const
inline

Returns true if specified point is above rectangle area.

Parameters
p- point to check.

Definition at line 200 of file rect.h.

◆ addH()

void _NanoRect::addH ( lcdint_t  dx)
inline

Shifts rectangle area by dx pixels.

Parameters
dx- delta on x-axis

Definition at line 91 of file rect.h.

◆ addV()

void _NanoRect::addV ( lcdint_t  dy)
inline

Shifts rectangle area by dy pixels.

Parameters
dy- delta on y-axis

Definition at line 101 of file rect.h.

◆ below()

bool _NanoRect::below ( const NanoPoint p) const
inline

Returns true if specified point is below rectangle area.

Parameters
p- point to check.

Definition at line 209 of file rect.h.

◆ collision()

bool _NanoRect::collision ( const NanoPoint p) const
inline

Returns true if specified point is inside rectangle area.

Parameters
p- point to check.

Definition at line 161 of file rect.h.

◆ collisionX()

bool _NanoRect::collisionX ( lcdint_t  x) const
inline

Returns true if specified x position is between left and right borders.

Parameters
x- position to check

Definition at line 143 of file rect.h.

◆ collisionY()

bool _NanoRect::collisionY ( lcdint_t  y) const
inline

Returns true if specified y position is between left and right borders.

Parameters
y- position to check

Definition at line 152 of file rect.h.

◆ contains() [1/2]

bool _NanoRect::contains ( const NanoPoint p) const
inline

Returns true of point belongs to rectangle area.

Parameters
ppoint to check for

Definition at line 171 of file rect.h.

◆ contains() [2/2]

bool _NanoRect::contains ( const _NanoRect r) const
inline

Returns true if whole rectangle belongs to rectangle area.

Parameters
rrectangle to check

Definition at line 181 of file rect.h.

◆ containsPartOf()

bool _NanoRect::containsPartOf ( const _NanoRect r) const
inline

Returns true if rectangle topleft or rightbottom points belong to rectangle area.

Parameters
rrectangle to check

Definition at line 191 of file rect.h.

◆ crop()

void _NanoRect::crop ( const _NanoRect rect)
inline

Crops rectangle to fit specified area.

Parameters
rectrectangle to crop to

Definition at line 127 of file rect.h.

◆ move()

void _NanoRect::move ( lcdint_t  dx,
lcdint_t  dy 
)
inline

Shifts rectangle area by dx;dy pixels.

Parameters
dx- delta on x-axis
dy- delta on y-axis

Definition at line 79 of file rect.h.

◆ operator+()

_NanoRect _NanoRect::operator+ ( const _NanoPoint p)
inline

Add point to all points of rectangle.

Parameters
p- point to add.

Definition at line 228 of file rect.h.

◆ operator+=()

_NanoRect& _NanoRect::operator+= ( const _NanoPoint p)
inline

Subtracts point to all points of rectangle.

Parameters
p- point to subtract.

Definition at line 238 of file rect.h.

◆ operator-()

_NanoRect _NanoRect::operator- ( const _NanoPoint p)
inline

Returns true if specified point is above rectangle area.

Parameters
p- point to check.

Definition at line 218 of file rect.h.

◆ operator<<()

_NanoRect _NanoRect::operator<< ( const uint8_t  bits) const
inline

Shifts left x,y value of the point by bits value.

Parameters
bits- number of bits to shift

Definition at line 260 of file rect.h.

◆ operator>>()

_NanoRect _NanoRect::operator>> ( const uint8_t  bits) const
inline

Shifts right x,y value of the point by bits value.

Parameters
bits- number of bits to shift

Definition at line 251 of file rect.h.

◆ setRect()

void _NanoRect::setRect ( lcdint_t  l,
lcdint_t  t,
lcdint_t  r,
lcdint_t  b 
)
inline

Initializes NanoRect with specified values.

Parameters
l- left position
t- top position
r- right position
b- bottom position

Definition at line 114 of file rect.h.


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