From cc5729dedd3dc84043703b22b498dcb0f2729f5b Mon Sep 17 00:00:00 2001 From: Andrew Hannam Date: Mon, 18 Mar 2013 18:27:52 +1000 Subject: Change GDISP poly fns to support translation Change GDISP poly fns to support translation - required for adding poly functions to GWIN --- include/gdisp/gdisp.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/gdisp/gdisp.h b/include/gdisp/gdisp.h index 962e5ed4..9e408578 100644 --- a/include/gdisp/gdisp.h +++ b/include/gdisp/gdisp.h @@ -658,30 +658,35 @@ void gdispDrawBox(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color); /** * @brief Draw an enclosed polygon (convex, non-convex or complex). * + * @param[in] tx, ty Transform all points in pntarray by tx, ty * @param[in] pntarray An array of points * @param[in] cnt The number of points in the array * @param[in] color The color to use * * @api */ - void gdispDrawPoly(const point *pntarray, unsigned cnt, color_t color); + void gdispDrawPoly(coord_t tx, coord_t ty, const point *pntarray, unsigned cnt, color_t color); /** * @brief Fill a convex polygon * @details Doesn't handle non-convex or complex polygons. * + * @param[in] tx, ty Transform all points in pntarray by tx, ty * @param[in] pntarray An array of points * @param[in] cnt The number of points in the array * @param[in] color The color to use * * @note Convex polygons are those that have no internal angles. That is; * you can draw a line from any point on the polygon to any other point - * on the polygon without it going outside the polygon. + * on the polygon without it going outside the polygon. In our case we generalise + * this a little by saying that an infinite horizontal line (at any y value) will cross + * no more than two edges on the polygon. Some non-convex polygons do fit this criteria + * and can therefore be drawn. * @note This routine is designed to be very efficient with even simple display hardware. * * @api */ - void gdispFillConvexPoly(const point *pntarray, unsigned cnt, color_t color); + void gdispFillConvexPoly(coord_t tx, coord_t ty, const point *pntarray, unsigned cnt, color_t color); #endif /* Extra Text Functions */ -- cgit v1.2.3