106 int16_t dX = 0, dY = 0;
107 int16_t sX, sY, err, e2;
109 if (Xstop > Xstart) {
115 if (Ystop > Ystart) {
122 if (Xstart < Xstop) {
128 if (Ystart < Ystop) {
138 if (Xstart == Xstop && Ystart == Ystop) {
144 Xstart = Xstart + sX;
148 Ystart = Ystart + sY;
166 LCD_DrawLine(Xpos + width, Ypos, Xpos + width, Ypos + height, Color);
167 LCD_DrawLine(Xpos, Ypos + height, Xpos + width, Ypos + height, Color);
181 LCD_FillArea(Xpos, Ypos, Xpos + width, Ypos + height, Color);
196 for (x = -Radius; x <= Radius; x++) {
197 for (y = -Radius; y <= Radius; y++) {
198 if (abs(x * x + y * y - Radius * Radius) <= Radius) {
224 LCD_DrawLine(x + Xpos, y + Ypos, -x + Xpos, y + Ypos, Color);
225 LCD_DrawLine(y + Xpos, x + Ypos, -y + Xpos, x + Ypos, Color);
226 LCD_DrawLine(-x + Xpos, -y + Ypos, x + Xpos, -y + Ypos, Color);
227 LCD_DrawLine(-y + Xpos, -x + Ypos, y + Xpos, -x + Ypos, Color);
231 radError += 2 * y + 1;
235 radError += 2 * (y - x + 1);
static void LCD_WritePixel(uint16_t x, uint16_t y, uint16_t pixel)
Write one pixel to the display.
void LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t width, uint16_t height, LCDCOLOR Color)
Displays a rectangle.
void LCD_DrawCircleF(uint8_t Xpos, uint16_t Ypos, uint16_t Radius, LCDCOLOR Color)
Displays a filled circle.
void LCD_DrawRectF(uint16_t Xpos, uint16_t Ypos, uint16_t width, uint16_t height, LCDCOLOR Color)
Displays a filled rectangle.
Simple graphic library main functionality.
uint16_t LCDCOLOR
Data type for a color definition.
void LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius, LCDCOLOR Color)
Displays a circle.
static void LCD_FillArea(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
Fill a specified area on the display with the same color.
void LCD_DrawLine(uint16_t Xstart, uint16_t Ystart, uint16_t Xstop, uint16_t Ystop, LCDCOLOR Color)
Draw a line on the display starting at (Xstart/Ystart) and ending at (Xstop/Ystop). This function draws the line with the Bresenham's line algorithm.