11 #include <io/status_loggers.h>
12 #include <lib/stdio.h>
14 #include <lib/pixel.h>
25 void drawRect(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t color){
26 for (__typeof__(x) _y = y, endy = y+h; _y < endy; _y++){
27 for (__typeof__(x) _x = x, endx = x+w; _x < endx; _x++){
28 set_pixel(_x, _y, color);
44 void drawRectLine(
int x,
int y,
int w,
int h,
int color,
int color2,
int c){
67 for (
int _x = x; _x < x+w ; _x++){
68 set_pixel(_x, y, color);
69 set_pixel(_x, y+h, color);
71 for (
int _y = y; _y < y+h; _y++){
73 set_pixel(x, _y, color);
74 set_pixel(x+w, _y, color);
87 for (
int x = x1; x <= x2; x++) {
88 set_pixel(x, y, color);
101 for (
int y = y1; y <= y2; y++) {
102 set_pixel(x, y, color);
118 set_pixel(cx + x, cy + y, color);
119 set_pixel(cx - x, cy + y, color);
120 set_pixel(cx + x, cy - y, color);
121 set_pixel(cx - x, cy - y, color);
122 set_pixel(cx + y, cy + x, color);
123 set_pixel(cx - y, cy + x, color);
124 set_pixel(cx + y, cy - x, color);
125 set_pixel(cx - y, cy - x, color);
136 void drawCircle(
int cx,
int cy,
int radius, uint32_t color) {
139 int p = 3 - 2 * radius;
146 p = p + 4 * (x - y) + 10;
227 void drawRoundedSquare(
int x,
int y,
int size,
int radius, uint32_t fill_color, uint32_t border_color) {
229 for (
int i = x+1; i < x + size-1; i++) {
236 drawFilledRectBorder(x + radius, y + radius, radius, size, 1, (border_color != -1 ? border_color : fill_color));
237 drawFilledRectBorder(x + size - radius - 1, y + radius, radius,size, 3, (border_color != -1 ? border_color : fill_color));
238 drawFilledRectBorder(x + radius, y + size - radius - 1, radius,size, 2, (border_color != -1 ? border_color : fill_color));
239 drawFilledRectBorder(x + size - radius - 1, y + size - radius - 1, radius,size, 4, (border_color != -1 ? border_color : fill_color));
243 if (border_color != -1) {
247 drawVerticalLine(y + radius, y + size - 1 - radius, x + size - 1, border_color);
263 void drawRoundedRectangle(
int x,
int y,
int width,
int height,
int radius, uint32_t fill_color, uint32_t border_color) {
265 for (
int i = x + 1; i < x + width - 1; i++) {
266 for (
int j = y + radius; j < y + height - radius; j++) {
267 set_pixel(i, j, fill_color);
273 drawFilledRectBorder(x + radius, y + radius, radius, width, 1, (border_color != -1 ? border_color : fill_color));
274 drawFilledRectBorder(x + width - radius - 1, y + radius, radius,width, 3, (border_color != -1 ? border_color : fill_color));
276 drawFilledRectBorder(x + radius, y + height - radius - 1, radius,width, 2, (border_color != -1 ? border_color : fill_color));
277 drawFilledRectBorder(x + width - radius - 1, y + height - radius - 1, radius,width, 4, (border_color != -1 ? border_color : fill_color));
uint32_t mode
Режим работы (0 - Обычный | 1 - Режим логирования)
void drawCircle(int cx, int cy, int radius, uint32_t color)
Рисует круг
void drawRoundedRectangle(int x, int y, int width, int height, int radius, uint32_t fill_color, uint32_t border_color)
Рисуем округленный прямоугольник, закрашиваем его и обводим
void drawFilledCircle(int x0, int y0, int radius, uint32_t color)
Закрашивает круг
void drawRect(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t color)
Рисуем залитый прямоугольник
void drawFilledRectBorder(int x0, int y0, int radius, int w, int mode, uint32_t color)
Закрашивает округленный куб
void drawRectLine(int x, int y, int w, int h, int color, int color2, int c)
Рисует узор вокруг прямоугольника
void drawHorizontalLine(int x1, int x2, int y, uint32_t color)
Рисует горизонтальную линию
void drawVerticalLine(int y1, int y2, int x, uint32_t color)
Рисует вертикальную линию
void drawCirclePoints(int cx, int cy, int x, int y, uint32_t color)
Рисует окружные пиксели круга линию
void drawRectBorder(int x, int y, int w, int h, int color)
Рисует линию вокруг прямоугольника
void drawRoundedSquare(int x, int y, int size, int radius, uint32_t fill_color, uint32_t border_color)
Рисуем округленный куб закрашиваем его и обводим