Class Point¶
Defined in File point.h
Class Documentation¶
-
class
Point
¶ Public Functions
-
Point
(uint16_t x = 0, uint16_t y = 0)¶ Constructor.
- Parameters
x
: X-axis coordinate.y
: Y-axis coordinate.
-
uint32_t
get_inline_index
(uint16_t x, uint16_t y) const¶ When used as a dimension, translates a coordinate into a 1-dimensional array index.
- Return
Index of the coordinate when translated to a 1D array.
- Parameters
x
: X-coordinate.y
: Y-coordinate.
-
bool
in_bounds
(uint16_t x, uint16_t y) const¶ When used as a dimension, checks whether a point falls within the dimensions.
- Return
True if in bounds.
- Parameters
x
: X coordinate to check.y
: Y coordinate to check.
-
void
set
(uint16_t x, uint16_t y)¶ Shortcut for setting the x and y coordinates.
- Parameters
x
: X-axis coordinate.y
: Y-axis coordinate.
-
uint32_t
size
() const¶ When used as a dimension, returns x * y.
- Return
X value multiplied by the Y value.
-