aboutsummaryrefslogtreecommitdiffstats
path: root/src/gmisc/gmisc.h
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@embedded.pro>2016-11-14 17:54:41 +0100
committerJoel Bodenmann <joel@embedded.pro>2016-11-14 17:59:16 +0100
commit152e7e7e26beb4fb3db123a5f49dae7025737666 (patch)
tree86e42637064b680b587b844657ebba4198a30c43 /src/gmisc/gmisc.h
parent7f79b89eda65e2529128710168a5b1de431ff7f0 (diff)
downloaduGFX-152e7e7e26beb4fb3db123a5f49dae7025737666.tar.gz
uGFX-152e7e7e26beb4fb3db123a5f49dae7025737666.tar.bz2
uGFX-152e7e7e26beb4fb3db123a5f49dae7025737666.zip
Adding gmiscHittestPoly()
Diffstat (limited to 'src/gmisc/gmisc.h')
-rw-r--r--src/gmisc/gmisc.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gmisc/gmisc.h b/src/gmisc/gmisc.h
index c8b4c21f..f805345c 100644
--- a/src/gmisc/gmisc.h
+++ b/src/gmisc/gmisc.h
@@ -464,6 +464,25 @@ extern "C" {
#endif
#endif
+
+#if GMISC_NEED_HITTEST_POLY || defined(__DOXYGEN__)
+ /**
+ * @brief Check whether a point is inside or on the edge of a polygon
+ * @pre Requires GFX_USE_GMISC and GMISC_NEED_HITTEST_POLY
+ *
+ * @note This function works both with convex and concave polygons
+ *
+ * @param[in] pntarray The array of points that form the polygon
+ * @param[in] cnt The number of points in the point array @pntarray
+ * @param[in] p The point to test
+ *
+ * @return @p TRUE if the point @p p is inside or on the edge of the polygon @p pntarray, @p FALSE otherwise.
+ *
+ * @api
+ */
+ bool_t gmiscHittestPoly(const point *pntarray, unsigned cnt, const point *p);
+#endif // GMISC_NEED_HITTEST_POLY
+
#ifdef __cplusplus
}
#endif