aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2014-10-28 00:20:11 +0100
committerJoel Bodenmann <joel@unormal.org>2014-10-28 00:20:11 +0100
commitedc254c080b514ea8ea85f432f666b9116f4037c (patch)
treea5544bbac6669ef4f3cd98a56804fa92d73a449f /src
parent08292eb7d0a0f71e222ae5e4f3fd0a7619bf29c6 (diff)
downloaduGFX-edc254c080b514ea8ea85f432f666b9116f4037c.tar.gz
uGFX-edc254c080b514ea8ea85f432f666b9116f4037c.tar.bz2
uGFX-edc254c080b514ea8ea85f432f666b9116f4037c.zip
Adding missing GWIN wrapper for ArcSectors functions
Diffstat (limited to 'src')
-rw-r--r--src/gwin/gwin_gwin.c14
-rw-r--r--src/gwin/sys_defs.h50
2 files changed, 63 insertions, 1 deletions
diff --git a/src/gwin/gwin_gwin.c b/src/gwin/gwin_gwin.c
index 26e23f32..03902c9b 100644
--- a/src/gwin/gwin_gwin.c
+++ b/src/gwin/gwin_gwin.c
@@ -299,6 +299,20 @@ void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coor
}
#endif
+#if GDISP_NEED_ARCSECTORS
+ void gwinDrawArcSectors(GHandle gh, coord_t x, coord_t y, coord_t radius, uint8_t sectors) {
+ if (!_gwinDrawStart(gh)) return;
+ gdispGDrawArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color);
+ _gwinDrawEnd(gh);
+ }
+
+ void gwinFillArcSectors(GHandle gh, coord_t x, coord_t y, coord_t radius, uint8_t sectors) {
+ if (!_gwinDrawStart(gh)) return;
+ gdispGFillArcSectors(gh->display, gh->x+x, gh->y+y, radius, sectors, gh->color);
+ _gwinDrawEnd(gh);
+ }
+#endif
+
#if GDISP_NEED_PIXELREAD
color_t gwinGetPixelColor(GHandle gh, coord_t x, coord_t y) {
if (!_gwinDrawStart(gh)) return (color_t)0;
diff --git a/src/gwin/sys_defs.h b/src/gwin/sys_defs.h
index 5e08f7a2..fefa909e 100644
--- a/src/gwin/sys_defs.h
+++ b/src/gwin/sys_defs.h
@@ -646,7 +646,7 @@ extern "C" {
void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer);
/*-------------------------------------------------
- * Circle, ellipse and arc functions
+ * Circle, ellipse, arc and arc-sectors functions
*-------------------------------------------------*/
#if GDISP_NEED_CIRCLE || defined(__DOXYGEN__)
@@ -737,6 +737,54 @@ extern "C" {
void gwinFillArc(GHandle gh, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle);
#endif
+ #if GDISP_NEED_ARCSECTORS || defined(__DOXYGEN__)
+ /*
+ * @brief Draw a selection of 45 degree arcs of a circle in the window.
+ * @note Uses the current foreground color to draw the arc sector
+ * @note May leave GDISP clipping to this window's dimensions
+ *
+ * @param[in] gh The window handle
+ * @param[in] x,y The center of the circle
+ * @param[in] radius The radius of the circle
+ * @param[in] sectors Bits determine which sectors are drawn.
+ * Bits go anti-clockwise from the 0 degree mark (y = 0, x is positive), as follows:
+ * bit 0 - upper right right -----
+ * bit 1 - upper upper right /2 1\
+ * bit 2 - upper upper left /3 0\
+ * bit 3 - upper left left \4 7/
+ * bit 4 - lower left left \5 6/
+ * bit 5 - lower lower left -----
+ * bit 6 - lower lower right
+ * bit 7 - lower left left
+ *
+ * @api
+ */
+ void gwinDrawArcSectors(GHandle gh, coord_t x, coord_t y, coord_t radius, uint8_t sectors);
+
+ /*
+ * @brief Draw a filled selection of 45 degree arcs of a circle in the window.
+ * @note Uses the current foreground color to draw the arc sector
+ * @note May leave GDISP clipping to this window's dimensions
+ *
+ * @param[in] gh The window handle
+ * @param[in] x,y The center of the circle
+ * @param[in] radius The radius of the circle
+ * @param[in] sectors Bits determine which sectors are drawn.
+ * Bits go anti-clockwise from the 0 degree mark (y = 0, x is positive), as follows:
+ * bit 0 - upper right right -----
+ * bit 1 - upper upper right /2 1\
+ * bit 2 - upper upper left /3 0\
+ * bit 3 - upper left left \4 7/
+ * bit 4 - lower left left \5 6/
+ * bit 5 - lower lower left -----
+ * bit 6 - lower lower right
+ * bit 7 - lower left left
+ *
+ * @api
+ */
+ void gwinFillArcSectors(GHandle gh, coord_t x, coord_t y, coord_t radius, uint8_t sectors);
+ #endif
+
/*-------------------------------------------------
* Pixel read-back functions
*-------------------------------------------------*/