Add a test of the circle rendering logic

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3911 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-08-24 17:00:51 +00:00
parent 4310fd4cb3
commit 2906947c9b
20 changed files with 106 additions and 43 deletions
+1 -1
View File
@@ -116,7 +116,7 @@
*
****************************************************************************/
void nxgl_circlepts(FAR struct nxgl_point_s *center, nxgl_coord_t radius,
void nxgl_circlepts(FAR const struct nxgl_point_s *center, nxgl_coord_t radius,
FAR struct nxgl_point_s *circle)
{
nxgl_coord_t xoffs;
+9 -9
View File
@@ -95,7 +95,7 @@
*
****************************************************************************/
void nxgl_circletraps(FAR struct nxgl_point_s *center, nxgl_coord_t radius,
void nxgl_circletraps(FAR const struct nxgl_point_s *center, nxgl_coord_t radius,
FAR struct nxgl_trapezoid_s *circle)
{
nxgl_coord_t xoffs;
@@ -103,11 +103,11 @@ void nxgl_circletraps(FAR struct nxgl_point_s *center, nxgl_coord_t radius,
circle[0].top.x1 = itob16(center->x);
circle[0].top.x2 = circle[0].top.x1;
circle[0].top.y = center->y + radius;
circle[0].top.y = center->y - radius;
circle[7].bot.x1 = circle[0].top.x1;
circle[7].bot.x2 = circle[0].top.x1;
circle[7].bot.y = center->y - radius;
circle[7].bot.y = center->y + radius;
circle[3].bot.x1 = itob16(center->x - radius);
circle[3].bot.x2 = itob16(center->x + radius);
@@ -124,7 +124,7 @@ void nxgl_circletraps(FAR struct nxgl_point_s *center, nxgl_coord_t radius,
circle[2].bot.x1 = itob16(center->x - xoffs);
circle[2].bot.x2 = itob16(center->x + xoffs);
circle[2].bot.y = center->y + yoffs;
circle[2].bot.y = center->y - yoffs;
circle[3].top.x1 = circle[2].bot.x1;
circle[3].top.x2 = circle[2].bot.x2;
@@ -132,7 +132,7 @@ void nxgl_circletraps(FAR struct nxgl_point_s *center, nxgl_coord_t radius,
circle[4].bot.x1 = circle[2].bot.x1;
circle[4].bot.x2 = circle[2].bot.x2;
circle[4].bot.y = center->y - yoffs;
circle[4].bot.y = center->y + yoffs;
circle[5].top.x1 = circle[4].bot.x1;
circle[5].top.x2 = circle[4].bot.x2;
@@ -140,7 +140,7 @@ void nxgl_circletraps(FAR struct nxgl_point_s *center, nxgl_coord_t radius,
circle[0].bot.x1 = itob16(center->x - yoffs);
circle[0].bot.x2 = itob16(center->x + yoffs);
circle[0].bot.y = center->y + xoffs;
circle[0].bot.y = center->y - xoffs;
circle[1].top.x1 = circle[0].bot.x1;
circle[1].top.x2 = circle[0].bot.x2;
@@ -148,7 +148,7 @@ void nxgl_circletraps(FAR struct nxgl_point_s *center, nxgl_coord_t radius,
circle[6].bot.x1 = circle[1].top.x1;
circle[6].bot.x2 = circle[1].top.x2;
circle[6].bot.y = center->y - xoffs;
circle[6].bot.y = center->y + xoffs;
circle[7].top.x1 = circle[6].bot.x1;
circle[7].top.x2 = circle[6].bot.x2;
@@ -160,7 +160,7 @@ void nxgl_circletraps(FAR struct nxgl_point_s *center, nxgl_coord_t radius,
circle[1].bot.x1 = itob16(center->x - xoffs);
circle[1].bot.x2 = itob16(center->x + xoffs);
circle[1].bot.y = center->y + xoffs;
circle[1].bot.y = center->y - xoffs;
circle[2].top.x1 = circle[1].bot.x1;
circle[2].top.x2 = circle[1].bot.x2;
@@ -168,7 +168,7 @@ void nxgl_circletraps(FAR struct nxgl_point_s *center, nxgl_coord_t radius,
circle[5].bot.x1 = circle[1].bot.x1;
circle[5].bot.x2 = circle[1].bot.x2;
circle[5].bot.y = center->y - xoffs;
circle[5].bot.y = center->y + xoffs;
circle[6].top.x1 = circle[5].bot.x1;
circle[6].top.x2 = circle[5].bot.x2;
+1 -1
View File
@@ -107,7 +107,7 @@
*
****************************************************************************/
int nx_drawcircle(NXWINDOW hwnd, FAR struct nxgl_point_s *center,
int nx_drawcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
nxgl_coord_t radius, nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
+1 -1
View File
@@ -89,7 +89,7 @@
*
****************************************************************************/
int nx_fillcircle(NXWINDOW hwnd, FAR struct nxgl_point_s *center,
int nx_fillcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
nxgl_coord_t radius, nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
FAR struct nxgl_trapezoid_s traps[NCIRCLE_TRAPS];
+1 -1
View File
@@ -107,7 +107,7 @@
*
****************************************************************************/
int nx_drawcircle(NXWINDOW hwnd, FAR struct nxgl_point_s *center,
int nx_drawcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
nxgl_coord_t radius, nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
+1 -1
View File
@@ -89,7 +89,7 @@
*
****************************************************************************/
int nx_fillcircle(NXWINDOW hwnd, FAR struct nxgl_point_s *center,
int nx_fillcircle(NXWINDOW hwnd, FAR const struct nxgl_point_s *center,
nxgl_coord_t radius, nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
FAR struct nxgl_trapezoid_s traps[NCIRCLE_TRAPS];
+1 -1
View File
@@ -107,7 +107,7 @@
*
****************************************************************************/
int nxtk_drawcircletoolbar(NXTKWINDOW hfwnd, FAR struct nxgl_point_s *center,
int nxtk_drawcircletoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *center,
nxgl_coord_t radius, nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
+1 -1
View File
@@ -107,7 +107,7 @@
*
****************************************************************************/
int nxtk_drawcirclewindow(NXTKWINDOW hfwnd, FAR struct nxgl_point_s *center,
int nxtk_drawcirclewindow(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *center,
nxgl_coord_t radius, nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
+1 -1
View File
@@ -89,7 +89,7 @@
*
****************************************************************************/
int nxtk_fillcircletoolbar(NXWINDOW hfwnd, FAR struct nxgl_point_s *center,
int nxtk_fillcircletoolbar(NXWINDOW hfwnd, FAR const struct nxgl_point_s *center,
nxgl_coord_t radius,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
+1 -1
View File
@@ -89,7 +89,7 @@
*
****************************************************************************/
int nxtk_fillcirclewindow(NXWINDOW hfwnd, FAR struct nxgl_point_s *center,
int nxtk_fillcirclewindow(NXWINDOW hfwnd, FAR const struct nxgl_point_s *center,
nxgl_coord_t radius,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{