Rolling 20220206

This commit is contained in:
jomjol
2022-02-06 19:50:47 +01:00
parent 641cc860d8
commit 11c33f81dd
25 changed files with 455 additions and 388 deletions

View File

@@ -274,6 +274,28 @@ void CImageBasis::drawLine(int x1, int y1, int x2, int y2, int r, int g, int b,
}
}
void CImageBasis::drawEllipse(int x1, int y1, int radx, int rady, int r, int g, int b, int thickness)
{
float deltarad, aktrad;
int _thick, _x, _y;
int rad = radx;
if (rady > radx)
rad = rady;
deltarad = 1 / (4 * M_PI * (rad + thickness - 1));
for (aktrad = 0; aktrad <= (2 * M_PI); aktrad += deltarad)
for (_thick = 0; _thick < thickness; ++_thick)
{
_x = sin(aktrad) * (radx + _thick) + x1;
_y = cos(aktrad) * (rady + _thick) + y1;
if (isInImage(_x, _y))
setPixelColor(_x, _y, r, g, b);
}
}
void CImageBasis::drawCircle(int x1, int y1, int rad, int r, int g, int b, int thickness)
{
float deltarad, aktrad;