LCDGFX LCD display driver  1.1.5
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
_NanoRect Struct Reference

#include <rect.h>

Collaboration diagram for _NanoRect:

Public Member Functions

lcdint_t width () const
 
const NanoPoint size () const
 
const NanoPoint center () const
 
lcdint_t height () const
 
void move (lcdint_t dx, lcdint_t dy)
 
void addH (lcdint_t dx)
 
void addV (lcdint_t dy)
 
void setRect (lcdint_t l, lcdint_t t, lcdint_t r, lcdint_t b)
 
void crop (const _NanoRect &rect)
 
bool collisionX (lcdint_t x) const
 
bool collisionY (lcdint_t y) const
 
bool collision (const NanoPoint &p) const
 
bool contains (const NanoPoint &p) const
 
bool contains (const _NanoRect &r) const
 
bool containsPartOf (const _NanoRect &r) const
 
bool above (const NanoPoint &p) const
 
bool below (const NanoPoint &p) const
 
_NanoRect operator- (const _NanoPoint &p)
 
_NanoRect operator+ (const _NanoPoint &p)
 
_NanoRectoperator+= (const _NanoPoint &p)
 
_NanoRect operator>> (const uint8_t bits) const
 
_NanoRect operator<< (const uint8_t bits) const
 

Public Attributes

NanoPoint p1
 
NanoPoint p2
 

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.

◆ center()

const NanoPoint _NanoRect::center ( ) const
inline

returns center point of NanoRect

Definition at line 63 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.

◆ height()

lcdint_t _NanoRect::height ( ) const
inline

returns height of NanoRect

Definition at line 69 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.

◆ size()

const NanoPoint _NanoRect::size ( ) const
inline

returns size of NanoRect

Definition at line 57 of file rect.h.

◆ width()

lcdint_t _NanoRect::width ( ) const
inline

returns width of NanoRect

Definition at line 51 of file rect.h.

Member Data Documentation

◆ p1

NanoPoint _NanoRect::p1

top-left point of the rectangle area

Definition at line 45 of file rect.h.

◆ p2

NanoPoint _NanoRect::p2

right-bottom point of the rectangle area

Definition at line 48 of file rect.h.


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