/* * \brief Draws a rectangle on LCD, at the given coordinates. * * \param x X-coordinate of upper-left rectangle corner. * \param y Y-coordinate of upper-left rectangle corner. * \param width Rectangle width in pixels. * \param height Rectangle height in pixels. * \param color Rectangle color. */ extern void LCDD_DrawRectangle( uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t color ) { LCDD_DrawRectangleWithFill(x, y, width, y, color); LCDD_DrawRectangleWithFill(x, height, width, height, color); LCDD_DrawRectangleWithFill(x, y, x, height, color); LCDD_DrawRectangleWithFill(width, y, width, height, color); }
/** * \brief Clears a calibration point from the given buffer. * * \param pPoint Calibration point to clear. */ static void ClearCalibrationPoint(const CalibrationPoint *pPoint) { LCDD_DrawRectangleWithFill(pPoint->x - POINTS_SIZE / 2, pPoint->y - POINTS_SIZE / 2, POINTS_SIZE, POINTS_SIZE, COLOR_WHITE); }
extern uint32_t LCD_DrawFilledCircle( uint32_t dwX, uint32_t dwY, uint32_t dwRadius, uint32_t color) { signed int d ; /* Decision Variable */ uint32_t dwCurX ; /* Current X Value */ uint32_t dwCurY ; /* Current Y Value */ uint32_t dwXmin, dwYmin; if (dwRadius == 0) { return 0; } d = 3 - (dwRadius << 1) ; dwCurX = 0 ; dwCurY = dwRadius ; while ( dwCurX <= dwCurY ) { dwXmin = (dwCurX > dwX) ? 0 : dwX-dwCurX; dwYmin = (dwCurY > dwY) ? 0 : dwY-dwCurY; LCDD_DrawRectangleWithFill( dwXmin, dwYmin, dwX+dwCurX, dwYmin ,color) ; LCDD_DrawRectangleWithFill( dwXmin, dwY+dwCurY, dwX+dwCurX, dwY+dwCurY, color ) ; dwXmin = (dwCurY > dwX) ? 0 : dwX-dwCurY; dwYmin = (dwCurX > dwY) ? 0 : dwY-dwCurX; LCDD_DrawRectangleWithFill( dwXmin, dwYmin, dwX+dwCurY, dwYmin, color ) ; LCDD_DrawRectangleWithFill( dwXmin, dwY+dwCurX, dwX+dwCurY, dwY+dwCurX, color ) ; if ( d < 0 ) { d += (dwCurX << 2) + 6 ; } else { d += ((dwCurX - dwCurY) << 2) + 10; dwCurY-- ; } dwCurX++ ; } return 0 ; }
/* * \brief Draw a line on LCD, horizontal and vertical line are supported. * * \param x X-coordinate of line start. * \param y Y-coordinate of line start. * \param length line length. * \param direction line direction: 0 - horizontal, 1 - vertical. * \param color Pixel color. */ extern void LCDD_DrawLine( uint32_t dwX1, uint32_t dwY1, uint32_t dwX2, uint32_t dwY2 , uint32_t color ) { if (( dwY1 == dwY2 ) || (dwX1 == dwX2)) { LCDD_DrawRectangleWithFill( dwX1, dwY1, dwX2, dwY2, color ); } else { LCDD_DrawLineBresenham( dwX1, dwY1, dwX2, dwY2 , color) ; } }