63 {
64
66 int R =
static_cast<int>(
fl::ceil(r));
67
68 int cx = static_cast<int>(fx + (fx >= 0.0f ? 0.5f : -0.5f));
69 int cy = static_cast<int>(fy + (fy >= 0.0f ? 0.5f : -0.5f));
70 float r2 = r * r;
71 for (int dy = -R; dy <= R; ++dy) {
72 for (int dx = -R; dx <= R; ++dx) {
73 float d2 = static_cast<float>(dx * dx + dy * dy);
74 if (d2 <= r2) {
75 float fall = 1.0f - (d2 / (r2 + 0.0001f));
76 float vf = 255.0f * fall;
77 if (vf < 0.0f) vf = 0.0f;
78 if (vf > 255.0f) vf = 255.0f;
79 uint8_t v = static_cast<uint8_t>(vf);
81 }
82 }
83 }
84}
void plotDot(CRGB *leds, int x, int y, uint8_t v) const
FASTLED_FORCE_INLINE T clamp(T value, T min, T max)