Ellipse removed, it's not right
This commit is contained in:
parent
bfeb9fd228
commit
cfb6fcbbee
2 changed files with 0 additions and 47 deletions
|
@ -968,31 +968,6 @@ void MatrixPanel_I2S_DMA::fillRectDMA(int16_t x, int16_t y, int16_t w, int16_t h
|
|||
}
|
||||
}
|
||||
|
||||
void MatrixPanel_I2S_DMA::fillEllipseDMA(int16_t x, int16_t y, int16_t rad, int16_t length, float angle, uint8_t r, uint8_t g, uint8_t b) {
|
||||
|
||||
// Calculate the rotation angle in radians
|
||||
float cosAngle = cos(angle);
|
||||
float sinAngle = sin(angle);
|
||||
|
||||
int16_t _rad, _length;
|
||||
_rad = min(rad, length);
|
||||
_length = max(rad, length);
|
||||
|
||||
// Calculate the step size and number of circles based on the rectangle's dimensions
|
||||
int numCircles = max(_rad, static_cast<int16_t>(_length / 2)); // Adjust the divisor to control circle density
|
||||
for (int i = -numCircles; i <= numCircles; i++) {
|
||||
float dx = i * cosAngle;
|
||||
float dy = i * sinAngle;
|
||||
|
||||
// Calculate circle center
|
||||
int16_t circleX = x + dx;
|
||||
int16_t circleY = y + dy;
|
||||
|
||||
// Draw circle
|
||||
fillCircleDMA(circleX, circleY, _rad, r, g, b);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _swap_int16_t
|
||||
#define _swap_int16_t(a, b) \
|
||||
{ \
|
||||
|
|
|
@ -561,15 +561,6 @@ public:
|
|||
|
||||
}
|
||||
|
||||
// rgb888 overload
|
||||
|
||||
virtual inline void fillEllipse(int16_t x, int16_t y, int16_t rad, int16_t length, float angle, uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
transform(x,y);
|
||||
fillEllipseDMA(x, y, rad, length, angle, r, g, b);
|
||||
}
|
||||
|
||||
|
||||
virtual void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
|
||||
{
|
||||
uint8_t r, g, b;
|
||||
|
@ -824,19 +815,6 @@ protected:
|
|||
*/
|
||||
void fillRectDMA(int16_t x_coord, int16_t y_coord, int16_t w, int16_t h, uint8_t r, uint8_t g, uint8_t b);
|
||||
|
||||
/**
|
||||
* @brief - update DMA buff drawing a filled ellipse at specified coordinates
|
||||
* @param int16_t x, int16_t y - coordinates of the center of the ellipse
|
||||
* @param int16_t rad - radius along the x-axis
|
||||
* @param int16_t length - radius along the y-axis
|
||||
* @param float angle - rotation angle in degrees
|
||||
* @param uint8_t r - RGB888 colour for red
|
||||
* @param uint8_t g - RGB888 colour for green
|
||||
* @param uint8_t b - RGB888 colour for blue
|
||||
* This function uses a series of filled circles to approximate the shape of a rotated ellipse.
|
||||
*/
|
||||
void fillEllipseDMA(int16_t x, int16_t y, int16_t rad, int16_t length, float angle, uint8_t r, uint8_t g, uint8_t b);
|
||||
|
||||
/**
|
||||
* @brief - update DMA buff drawing a triangle at specified coordinates
|
||||
* uses Fast H/V line draw internally, works faster than multiple consecutive pixel by pixel calls to updateMatrixDMABuffer()
|
||||
|
|
Loading…
Add table
Reference in a new issue