This is the David Smart RA8875 Library with mods for working with FRDM-K64F
Diff: DisplayDefs.h
- Revision:
- 179:c7fb7a4fb42f
- Parent:
- 167:8aa3fb2a5a31
- Child:
- 180:d8abf2e70b88
--- a/DisplayDefs.h Sun Jul 28 01:33:02 2019 +0000 +++ b/DisplayDefs.h Sun Jul 28 02:14:09 2019 +0000 @@ -71,22 +71,38 @@ /// type that manages x,y pairs /// -typedef struct +struct point_t { loc_t x; ///< x value in the point loc_t y; ///< y value in the point -} point_t; + + // constructors: + point_t(loc_t arg_x, loc_t arg_y) : + x(arg_x), y(arg_y) {} + point_t() : + x(0), y(0){}; +}; /// Data type that manages rectangles, which are pairs of points. /// /// @note It is recommended that p1 contains the top-left point and p2 contains /// the bottom-right point, even though it should not matter. /// -typedef struct +struct rect_t { point_t p1; ///< p1 defines one point on the rectangle point_t p2; ///< p2 defines the opposite point on the rectangle -} rect_t; + + // constructors: + rect_t(point_t arg_p1, point_t arg_p2) : + p1(arg_p1), p2(arg_p2) {}; + + rect_t(loc_t arg_p1_x, loc_t arg_p1_y, loc_t arg_p2_x, loc_t arg_p2_y) : + p1(point_t(arg_p1_x, arg_p1_y)), p2(point_t(arg_p2_x, arg_p2_y)){}; + + rect_t() : + p1(point_t()), p2(point_t()) {}; +}; /// Data type that manages the calibration matrix for the resistive touch panel. ///