SSD1306 OLED display driver 1.7.8 This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays

Public Member Functions | Public Attributes | List of all members
_NanoRect Struct Reference
NANO_ENGINE: Nano Engine description

`#include <rect.h>`

## Public Member Functions
lcdint_t | width () const
const NanoPoint | size () 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)
_NanoRect & | operator+= (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 182 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 83 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 92 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 188 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 143 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 128 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 137 of file rect.h.

## ◆ contains() [1/2]

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

Returns true of point belongs to rectangle area

Parameters

  p | point to check for

Definition at line 153 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

  r | rectangle to check

Definition at line 163 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

  r | rectangle to check

Definition at line 173 of file rect.h.

## ◆ crop()

void _NanoRect::crop | ( | const _NanoRect & | rect | ) |
| inline

Crops rectangle to fit specified area

Parameters

  rect | rectangle to crop to

Definition at line 116 of file rect.h.

## ◆ height()

lcdint_t _NanoRect::height | ( |  | ) | const
| inline

returns height of NanoRect

Definition at line 63 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 73 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 204 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 214 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 194 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 236 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 227 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 105 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:

- src/nano_engine/rect.h