From 60af61e86dfef73118ca1b21052085819df772a8 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 20 Apr 2011 01:55:05 +0000 Subject: Correct 1-bit errors in intersection calculations git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3526 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/ChangeLog | 3 ++ nuttx/TODO | 12 +------ nuttx/graphics/nxglib/nxglib_nonintersecting.c | 45 +++++++++++++++++++++++--- 3 files changed, 45 insertions(+), 15 deletions(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 25f86c225..70496acbe 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -1705,4 +1705,7 @@ OLED with Solomon Systech SD1305 LCD controller. * configs/lpcxpresso-lpc1668/nx: Add a NX graphics configuration for the LPCXPRESO board. + * graphics/nxglib/nxglib_nonintersecting.c: Fix some single bit errors in + calculation of non-intersecting regions. This was causing an anomoaly + in examples/nx in column 0. diff --git a/nuttx/TODO b/nuttx/TODO index ac485d505..24666fc92 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated April 12 2011) +NuttX TODO List (Last updated April 19 2011) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nuttx/ @@ -477,16 +477,6 @@ o Graphics subystem (graphics/) Status: Open Priority: Medium - Description: The apps/examples/nx test using lcd/p14201.c and the configs/lm3s6965-ek - configuration shows two single pixel-wide anomalies. One along - column zero is clearly caused by the NX windowing logic. It is - not certain if these are consequences of the 4bpp logic or if these - are anomalies that have always been in NX, but are only visible - now at the low resolution of the p14201 LCD (128x96). - Update: Same defects in the LPCXpresso a 1bpp (96x64). - Status: Open - Priority: Low (unless you need the p13201 then it is certainly higher). - o Pascal Add-On (pcode/) ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/graphics/nxglib/nxglib_nonintersecting.c b/nuttx/graphics/nxglib/nxglib_nonintersecting.c index dcfc2590f..0a77059a0 100644 --- a/nuttx/graphics/nxglib/nxglib_nonintersecting.c +++ b/nuttx/graphics/nxglib/nxglib_nonintersecting.c @@ -88,6 +88,43 @@ void nxgl_nonintersecting(FAR struct nxgl_rect_s result[4], /* Then return the four rectangles representing the regions NON included * in the intersection. Some of these rectangles may be invalid (zero * area), but those can be picked off using nxgl_nullrect() + * + * rect1.pt1 + * +-------------------------+ + * | rect2.pt1 | + * | int.pt1 | + * | +-------------------------+ + * | | | | + * | | | | + * +-------------------------+ | + * | rect1.pt2 | + * | int.pt2 | + * +-------------------------+ + * rect2.pt2 + * rect1.pt1 + * +-------------------------+ + * rect2.pt1 |int.pt1 | + * +---------+---------------+ | + * | | | | + * | | | | + * | | |int.pt2 | + * | +---------------+---------+ + * | | rect1.pt2 + * +-------------------------+ + * rect2.pt2 + * rect2.pt1 + * +-------------------------+ + * | rect1.pt1 | + * | int.pt1 | + * | +-------------------------+ + * | | | | + * | | | | + * | | | | + * +---------+---------------+ | + * | rect2.pt2 | + * | int.pt2 | + * +-------------------------+ + * rect1.pt2 */ result[NX_TOP_NDX].pt1.x = rect1->pt1.x; @@ -100,14 +137,14 @@ void nxgl_nonintersecting(FAR struct nxgl_rect_s result[4], result[NX_BOTTOM_NDX].pt2.x = rect1->pt2.x; result[NX_BOTTOM_NDX].pt2.y = rect1->pt2.y; - result[NX_LEFT_NDX].pt1.x = rect1->pt1.x + 1; + result[NX_LEFT_NDX].pt1.x = rect1->pt1.x; result[NX_LEFT_NDX].pt1.y = intersection.pt1.y; - result[NX_LEFT_NDX].pt2.x = intersection.pt1.x; + result[NX_LEFT_NDX].pt2.x = intersection.pt1.x - 1; result[NX_LEFT_NDX].pt2.y = intersection.pt2.y; - result[NX_RIGHT_NDX].pt1.x = intersection.pt2.x; + result[NX_RIGHT_NDX].pt1.x = intersection.pt2.x + 1; result[NX_RIGHT_NDX].pt1.y = intersection.pt1.y; - result[NX_RIGHT_NDX].pt2.x = rect1->pt2.x - 1; + result[NX_RIGHT_NDX].pt2.x = rect1->pt2.x; result[NX_RIGHT_NDX].pt2.y = intersection.pt2.y; } -- cgit v1.2.3