5#define FASTLED_INTERNAL
23#if !defined(FL_IS_AVR)
39 FL_ERROR(
"XY function not provided - using default [0][0]. Use blur2d with XYMap instead");
71 const fl::u16 numLeds =
static_cast<fl::u16
>(
leds.size());
72 fl::u8 keep = 255 - blur_amount;
73 fl::u8 seep = blur_amount >> 1;
75 for (fl::u16 i = 0; i < numLeds; ++i) {
100 fl::u8 keep = 255 - blur_amount;
101 fl::u8 seep = blur_amount >> 1;
112 leds[
xyMap.mapToIndex(i - 1, row)] += part;
127 leds[
xyMap.mapToIndex(col, i - 1)] += part;
137 fl::u8 keep = 255 - blur_amount;
138 fl::u8 seep = blur_amount >> 1;
139 if (
xyMap.isRectangularGrid()) {
150 rowBase[col - 1] += part;
166 leds[
xyMap.mapToIndex(i - 1, row)] += part;
176 fl::u8 keep = 255 - blur_amount;
177 fl::u8 seep = blur_amount >> 1;
178 if (
xyMap.isRectangularGrid()) {
188 pixels[(row - 1) *
width + col] += part;
204 leds[
xyMap.mapToIndex(col, i - 1)] += part;
212 const int w = canvas.width;
213 const int h = canvas.height;
214 CRGB *pixels = canvas.pixels;
215 fl::u8 keep = 255 - blur_amount;
216 fl::u8 seep = blur_amount >> 1;
217 for (
int row = 0; row < h; ++row) {
219 CRGB *rowBase = pixels + row * w;
220 for (
int col = 0; col < w; ++col) {
227 rowBase[col - 1] += part;
235 const int w = canvas.width;
236 const int h = canvas.height;
237 CRGB *pixels = canvas.pixels;
238 fl::u8 keep = 255 - blur_amount;
239 fl::u8 seep = blur_amount >> 1;
240 for (
int col = 0; col < w; ++col) {
242 for (
int row = 0; row < h; ++row) {
243 CRGB cur = pixels[row * w + col];
249 pixels[(row - 1) * w + col] += part;
250 pixels[row * w + col] =
cur;
294template <
typename RGB_T>
303 return CRGB(
static_cast<u8>(r),
static_cast<u8>(
g),
308 if (a.value == 255)
return make(r,
g, b);
309 u16 a1 =
static_cast<u16
>(a.value) + 1;
310 return CRGB(
static_cast<u8>((r * a1) >> 8),
311 static_cast<u8>((
g * a1) >> 8),
312 static_cast<u8>((b * a1) >> 8));
316 if (a.value >= 65535)
return make(r,
g, b);
317 u32 a1 =
static_cast<u32
>(a.value) + 1;
318 return CRGB(
static_cast<u8>((r * a1) >> 16),
319 static_cast<u8>((
g * a1) >> 16),
320 static_cast<u8>((b * a1) >> 16));
336 if (a.value == 255)
return make(r,
g, b);
337 u32 a1 =
static_cast<u32
>(a.value) + 1;
338 return make((r * a1) >> 8, (
g * a1) >> 8, (b * a1) >> 8);
342 if (a.value >= 65535)
return make(r,
g, b);
343 u32 a1 =
static_cast<u32
>(a.value) + 1;
344 return make((r * a1) >> 16, (
g * a1) >> 16, (b * a1) >> 16);
349template <
typename RGB_T>
352 if (
static_cast<int>(buf.
size()) < minSize) {
361template <
int R,
typename RGB_T,
typename acc_t>
364template <
typename RGB_T,
typename acc_t>
369 r = P::ch(row[
x].r);
g = P::ch(row[
x].
g); b = P::ch(row[
x].b);
373template <
typename RGB_T,
typename acc_t>
380 {
const RGB_T &px = row[
x-1]; r += p.ch(px.r);
g += p.ch(px.g); b += p.ch(px.b); }
381 {
const RGB_T &px = row[
x]; r += p.ch(px.r) * 2;
g += p.ch(px.g) * 2; b += p.ch(px.b) * 2; }
382 {
const RGB_T &px = row[
x+1]; r += p.ch(px.r);
g += p.ch(px.g); b += p.ch(px.b); }
386template <
typename RGB_T,
typename acc_t>
393 const RGB_T &pm2 = row[
x-2], &pm1 = row[
x-1], &pc = row[
x], &pp1 = row[
x+1], &pp2 = row[
x+2];
394 const acc_t s04r = p.ch(pm2.r) + p.ch(pp2.r), s13r = p.ch(pm1.r) + p.ch(pp1.r);
395 const acc_t s04g = p.ch(pm2.g) + p.ch(pp2.g), s13g = p.ch(pm1.g) + p.ch(pp1.g);
396 const acc_t s04b = p.ch(pm2.b) + p.ch(pp2.b), s13b = p.ch(pm1.b) + p.ch(pp1.b);
397 r = s04r + s13r * 4 + p.ch(pc.r) * 6;
398 g = s04g + s13g * 4 + p.ch(pc.g) * 6;
399 b = s04b + s13b * 4 + p.ch(pc.b) * 6;
403template <
typename RGB_T,
typename acc_t>
410 const RGB_T &pm3 = row[
x-3], &pm2 = row[
x-2], &pm1 = row[
x-1], &pc = row[
x];
411 const RGB_T &pp1 = row[
x+1], &pp2 = row[
x+2], &pp3 = row[
x+3];
412 const acc_t s06r = p.ch(pm3.r) + p.ch(pp3.r), s15r = p.ch(pm2.r) + p.ch(pp2.r), s24r = p.ch(pm1.r) + p.ch(pp1.r);
413 const acc_t s06g = p.ch(pm3.g) + p.ch(pp3.g), s15g = p.ch(pm2.g) + p.ch(pp2.g), s24g = p.ch(pm1.g) + p.ch(pp1.g);
414 const acc_t s06b = p.ch(pm3.b) + p.ch(pp3.b), s15b = p.ch(pm2.b) + p.ch(pp2.b), s24b = p.ch(pm1.b) + p.ch(pp1.b);
415 r = s06r + s15r * 6 + s24r * 15 + p.ch(pc.r) * 20;
416 g = s06g + s15g * 6 + s24g * 15 + p.ch(pc.g) * 20;
417 b = s06b + s15b * 6 + s24b * 15 + p.ch(pc.b) * 20;
421template <
typename RGB_T,
typename acc_t>
428 const RGB_T &pm4 = row[
x-4], &pm3 = row[
x-3], &pm2 = row[
x-2], &pm1 = row[
x-1], &pc = row[
x];
429 const RGB_T &pp1 = row[
x+1], &pp2 = row[
x+2], &pp3 = row[
x+3], &pp4 = row[
x+4];
430 const acc_t s08r = p.ch(pm4.r) + p.ch(pp4.r), s17r = p.ch(pm3.r) + p.ch(pp3.r);
431 const acc_t s26r = p.ch(pm2.r) + p.ch(pp2.r), s35r = p.ch(pm1.r) + p.ch(pp1.r);
432 const acc_t s08g = p.ch(pm4.g) + p.ch(pp4.g), s17g = p.ch(pm3.g) + p.ch(pp3.g);
433 const acc_t s26g = p.ch(pm2.g) + p.ch(pp2.g), s35g = p.ch(pm1.g) + p.ch(pp1.g);
434 const acc_t s08b = p.ch(pm4.b) + p.ch(pp4.b), s17b = p.ch(pm3.b) + p.ch(pp3.b);
435 const acc_t s26b = p.ch(pm2.b) + p.ch(pp2.b), s35b = p.ch(pm1.b) + p.ch(pp1.b);
436 r = s08r + s17r * 8 + s26r * 28 + s35r * 56 + p.ch(pc.r) * 70;
437 g = s08g + s17g * 8 + s26g * 28 + s35g * 56 + p.ch(pc.g) * 70;
438 b = s08b + s17b * 8 + s26b * 28 + s35b * 56 + p.ch(pc.b) * 70;
451#if defined(FL_IS_AVR)
453template <
int R>
struct conv1ch;
458template <>
struct conv1ch<0> {
459 static inline u16 __attribute__((always_inline)) apply(
const u8 *c) {
464template <>
struct conv1ch<1> {
465 static inline u16 __attribute__((always_inline)) apply(
const u8 *c) {
466 constexpr int S =
sizeof(
CRGB);
469 return (u16)p[0] * 64 + (u16)p[S] * 128 + (u16)p[2*S] * 64;
473template <>
struct conv1ch<2> {
474 static inline u16 __attribute__((always_inline)) apply(
const u8 *c) {
475 constexpr int S =
sizeof(
CRGB);
476 const u8 *p = c - 2*S;
478 return (u16)p[0] * 16 + (u16)p[S] * 64 + (u16)p[2*S] * 96
479 + (u16)p[3*S] * 64 + (u16)p[4*S] * 16;
483template <>
struct conv1ch<3> {
484 static inline u16 __attribute__((always_inline)) apply(
const u8 *c) {
485 constexpr int S =
sizeof(
CRGB);
486 const u8 *p = c - 3*S;
488 return (u16)p[0] * 4 + (u16)p[S] * 24 + (u16)p[2*S] * 60
489 + (u16)p[3*S] * 80 + (u16)p[4*S] * 60 + (u16)p[5*S] * 24
494template <>
struct conv1ch<4> {
495 static inline u16 __attribute__((always_inline)) apply(
const u8 *c) {
496 constexpr int S =
sizeof(
CRGB);
497 const u8 *p = c - 4*S;
499 return (u16)p[0] + (u16)p[S] * 8 + (u16)p[2*S] * 28
500 + (u16)p[3*S] * 56 + (u16)p[4*S] * 70 + (u16)p[5*S] * 56
501 + (u16)p[6*S] * 28 + (u16)p[7*S] * 8 + (u16)p[8*S];
508static void apply_pass_1ch(
const CRGB *pad,
CRGB *out,
int count,
int stride) {
509 constexpr int shift = (R == 0) ? 0 : 8;
510 for (
int i = 0; i < count; ++i) {
511 const u8 *base = pad[R + i].raw;
512 out->r =
static_cast<u8>(conv1ch<R>::apply(base + 0) >> shift);
513 out->g =
static_cast<u8>(conv1ch<R>::apply(base + 1) >> shift);
514 out->b =
static_cast<u8>(conv1ch<R>::apply(base + 2) >> shift);
522static void apply_pass_alpha_1ch(
const CRGB *pad,
CRGB *out,
int count,
523 int stride, alpha8 alpha) {
524 constexpr int shift = (R == 0) ? 0 : 8;
525 u16 a1 =
static_cast<u16
>(alpha.value) + 1;
526 for (
int i = 0; i < count; ++i) {
527 const u8 *base = pad[R + i].raw;
528 u16 r = conv1ch<R>::apply(base + 0) >> shift;
529 u16
g = conv1ch<R>::apply(base + 1) >> shift;
530 u16 b = conv1ch<R>::apply(base + 2) >> shift;
531 out->r =
static_cast<u8>((r * a1) >> 8);
532 out->g =
static_cast<u8>((
g * a1) >> 8);
533 out->b =
static_cast<u8>((b * a1) >> 8);
541static void apply_pass_alpha_1ch(
const CRGB *pad,
CRGB *out,
int count,
542 int stride, alpha16 alpha) {
543 constexpr int shift = (R == 0) ? 0 : 8;
544 u32 a1 =
static_cast<u32
>(alpha.value) + 1;
545 for (
int i = 0; i < count; ++i) {
546 const u8 *base = pad[R + i].raw;
547 u16 r = conv1ch<R>::apply(base + 0) >> shift;
548 u16
g = conv1ch<R>::apply(base + 1) >> shift;
549 u16 b = conv1ch<R>::apply(base + 2) >> shift;
550 out->r =
static_cast<u8>((r * a1) >> 16);
551 out->g =
static_cast<u8>((
g * a1) >> 16);
552 out->b =
static_cast<u8>((b * a1) >> 16);
562template <
int R,
typename RGB_T,
typename acc_t>
565 constexpr int shift = 2 * R;
567 for (
int i = 0; i < count; ++i) {
570 *out = P::make(
static_cast<acc_t
>(r >> shift),
571 static_cast<acc_t
>(
g >> shift),
572 static_cast<acc_t
>(b >> shift));
577template <
int R,
typename RGB_T,
typename acc_t,
typename AlphaT>
581 constexpr int shift = 2 * R;
583 for (
int i = 0; i < count; ++i) {
586 *out = P::make(
static_cast<acc_t
>(r >> shift),
587 static_cast<acc_t
>(
g >> shift),
588 static_cast<acc_t
>(b >> shift), alpha);
600#if !defined(FL_IS_AVR)
612 for (; i + 63 < nbytes; i += 64) {
613 auto va0 = fsimd::load_u8_32(a+i), vb0 = fsimd::load_u8_32(b+i), vc0 = fsimd::load_u8_32(c+i);
614 auto va1 = fsimd::load_u8_32(a+i+32), vb1 = fsimd::load_u8_32(b+i+32), vc1 = fsimd::load_u8_32(c+i+32);
615 fsimd::store_u8_32(out+i, fsimd::avg_round_u8_32(fsimd::avg_round_u8_32(va0, vc0), vb0));
616 fsimd::store_u8_32(out+i+32, fsimd::avg_round_u8_32(fsimd::avg_round_u8_32(va1, vc1), vb1));
618 for (; i + 31 < nbytes; i += 32) {
619 auto va = fsimd::load_u8_32(a+i), vb = fsimd::load_u8_32(b+i), vc = fsimd::load_u8_32(c+i);
620 fsimd::store_u8_32(out+i, fsimd::avg_round_u8_32(fsimd::avg_round_u8_32(va, vc), vb));
622 for (; i + 15 < nbytes; i += 16) {
623 auto va = fsimd::load_u8_16(a+i), vb = fsimd::load_u8_16(b+i), vc = fsimd::load_u8_16(c+i);
624 fsimd::store_u8_16(out+i, fsimd::avg_round_u8_16(fsimd::avg_round_u8_16(va, vc), vb));
626 for (; i < nbytes; ++i)
627 out[i] = (
u8)(((u16)a[i] + ((u16)b[i] << 1) + (u16)c[i]) >> 2);
635 const u8 *p3,
const u8 *p4,
638 const auto w4w = fsimd::set1_u16_16(4), w6w = fsimd::set1_u16_16(6);
639 const auto w4 = fsimd::set1_u16_8(4), w6 = fsimd::set1_u16_8(6);
641 for (; i + 31 < nbytes; i += 32) {
642 auto v0 = fsimd::load_u8_32(p0+i), v1 = fsimd::load_u8_32(p1+i);
643 auto v2 = fsimd::load_u8_32(p2+i), v3 = fsimd::load_u8_32(p3+i), v4 = fsimd::load_u8_32(p4+i);
644 auto s04 = fsimd::add_u16_16(fsimd::widen_lo_u8x32_to_u16(v0), fsimd::widen_lo_u8x32_to_u16(v4));
645 auto s13 = fsimd::add_u16_16(fsimd::widen_lo_u8x32_to_u16(v1), fsimd::widen_lo_u8x32_to_u16(v3));
646 auto lo = fsimd::add_u16_16(s04, fsimd::add_u16_16(fsimd::mullo_u16_16(s13, w4w), fsimd::mullo_u16_16(fsimd::widen_lo_u8x32_to_u16(v2), w6w)));
647 lo = fsimd::srli_u16_16(lo, 4);
648 auto s04h = fsimd::add_u16_16(fsimd::widen_hi_u8x32_to_u16(v0), fsimd::widen_hi_u8x32_to_u16(v4));
649 auto s13h = fsimd::add_u16_16(fsimd::widen_hi_u8x32_to_u16(v1), fsimd::widen_hi_u8x32_to_u16(v3));
650 auto hi = fsimd::add_u16_16(s04h, fsimd::add_u16_16(fsimd::mullo_u16_16(s13h, w4w), fsimd::mullo_u16_16(fsimd::widen_hi_u8x32_to_u16(v2), w6w)));
651 hi = fsimd::srli_u16_16(hi, 4);
652 fsimd::store_u8_32(out+i, fsimd::narrow_u16x16_to_u8(lo, hi));
654 for (; i + 15 < nbytes; i += 16) {
655 auto v0 = fsimd::load_u8_16(p0+i), v1 = fsimd::load_u8_16(p1+i);
656 auto v2 = fsimd::load_u8_16(p2+i), v3 = fsimd::load_u8_16(p3+i), v4 = fsimd::load_u8_16(p4+i);
657 auto s04 = fsimd::add_u16_8(fsimd::widen_lo_u8_to_u16(v0), fsimd::widen_lo_u8_to_u16(v4));
658 auto s13 = fsimd::add_u16_8(fsimd::widen_lo_u8_to_u16(v1), fsimd::widen_lo_u8_to_u16(v3));
659 auto lo = fsimd::add_u16_8(s04, fsimd::add_u16_8(fsimd::mullo_u16_8(s13, w4), fsimd::mullo_u16_8(fsimd::widen_lo_u8_to_u16(v2), w6)));
660 lo = fsimd::srli_u16_8(lo, 4);
661 auto s04h = fsimd::add_u16_8(fsimd::widen_hi_u8_to_u16(v0), fsimd::widen_hi_u8_to_u16(v4));
662 auto s13h = fsimd::add_u16_8(fsimd::widen_hi_u8_to_u16(v1), fsimd::widen_hi_u8_to_u16(v3));
663 auto hi = fsimd::add_u16_8(s04h, fsimd::add_u16_8(fsimd::mullo_u16_8(s13h, w4), fsimd::mullo_u16_8(fsimd::widen_hi_u8_to_u16(v2), w6)));
664 hi = fsimd::srli_u16_8(hi, 4);
665 fsimd::store_u8_16(out+i, fsimd::narrow_u16_to_u8(lo, hi));
667 for (; i < nbytes; ++i) {
668 u16 s04 = (u16)p0[i] + (u16)p4[i];
669 u16 s13 = (u16)p1[i] + (u16)p3[i];
670 out[i] = (
u8)((s04 + s13 * 4 + (u16)p2[i] * 6) >> 4);
676 const u8 *p3,
const u8 *p4,
const u8 *p5,
679 const auto w6w = fsimd::set1_u16_16(6), w15w = fsimd::set1_u16_16(15), w20w = fsimd::set1_u16_16(20);
680 const auto w6 = fsimd::set1_u16_8(6), w15 = fsimd::set1_u16_8(15), w20 = fsimd::set1_u16_8(20);
682 for (; i + 31 < nbytes; i += 32) {
683 auto v0 = fsimd::load_u8_32(p0+i), v1 = fsimd::load_u8_32(p1+i), v2 = fsimd::load_u8_32(p2+i);
684 auto v3 = fsimd::load_u8_32(p3+i), v4 = fsimd::load_u8_32(p4+i), v5 = fsimd::load_u8_32(p5+i);
685 auto v6v = fsimd::load_u8_32(p6+i);
686 auto s06 = fsimd::add_u16_16(fsimd::widen_lo_u8x32_to_u16(v0), fsimd::widen_lo_u8x32_to_u16(v6v));
687 auto s15 = fsimd::add_u16_16(fsimd::widen_lo_u8x32_to_u16(v1), fsimd::widen_lo_u8x32_to_u16(v5));
688 auto s24 = fsimd::add_u16_16(fsimd::widen_lo_u8x32_to_u16(v2), fsimd::widen_lo_u8x32_to_u16(v4));
689 auto lo = fsimd::add_u16_16(s06, fsimd::add_u16_16(fsimd::mullo_u16_16(s15, w6w),
690 fsimd::add_u16_16(fsimd::mullo_u16_16(s24, w15w), fsimd::mullo_u16_16(fsimd::widen_lo_u8x32_to_u16(v3), w20w))));
691 lo = fsimd::srli_u16_16(lo, 6);
692 auto s06h = fsimd::add_u16_16(fsimd::widen_hi_u8x32_to_u16(v0), fsimd::widen_hi_u8x32_to_u16(v6v));
693 auto s15h = fsimd::add_u16_16(fsimd::widen_hi_u8x32_to_u16(v1), fsimd::widen_hi_u8x32_to_u16(v5));
694 auto s24h = fsimd::add_u16_16(fsimd::widen_hi_u8x32_to_u16(v2), fsimd::widen_hi_u8x32_to_u16(v4));
695 auto hi = fsimd::add_u16_16(s06h, fsimd::add_u16_16(fsimd::mullo_u16_16(s15h, w6w),
696 fsimd::add_u16_16(fsimd::mullo_u16_16(s24h, w15w), fsimd::mullo_u16_16(fsimd::widen_hi_u8x32_to_u16(v3), w20w))));
697 hi = fsimd::srli_u16_16(hi, 6);
698 fsimd::store_u8_32(out+i, fsimd::narrow_u16x16_to_u8(lo, hi));
700 for (; i + 15 < nbytes; i += 16) {
701 auto v0 = fsimd::load_u8_16(p0+i), v1 = fsimd::load_u8_16(p1+i), v2 = fsimd::load_u8_16(p2+i);
702 auto v3 = fsimd::load_u8_16(p3+i), v4 = fsimd::load_u8_16(p4+i), v5 = fsimd::load_u8_16(p5+i);
703 auto v6v = fsimd::load_u8_16(p6+i);
704 auto s06 = fsimd::add_u16_8(fsimd::widen_lo_u8_to_u16(v0), fsimd::widen_lo_u8_to_u16(v6v));
705 auto s15 = fsimd::add_u16_8(fsimd::widen_lo_u8_to_u16(v1), fsimd::widen_lo_u8_to_u16(v5));
706 auto s24 = fsimd::add_u16_8(fsimd::widen_lo_u8_to_u16(v2), fsimd::widen_lo_u8_to_u16(v4));
707 auto lo = fsimd::add_u16_8(s06, fsimd::add_u16_8(fsimd::mullo_u16_8(s15, w6),
708 fsimd::add_u16_8(fsimd::mullo_u16_8(s24, w15), fsimd::mullo_u16_8(fsimd::widen_lo_u8_to_u16(v3), w20))));
709 lo = fsimd::srli_u16_8(lo, 6);
710 auto s06h = fsimd::add_u16_8(fsimd::widen_hi_u8_to_u16(v0), fsimd::widen_hi_u8_to_u16(v6v));
711 auto s15h = fsimd::add_u16_8(fsimd::widen_hi_u8_to_u16(v1), fsimd::widen_hi_u8_to_u16(v5));
712 auto s24h = fsimd::add_u16_8(fsimd::widen_hi_u8_to_u16(v2), fsimd::widen_hi_u8_to_u16(v4));
713 auto hi = fsimd::add_u16_8(s06h, fsimd::add_u16_8(fsimd::mullo_u16_8(s15h, w6),
714 fsimd::add_u16_8(fsimd::mullo_u16_8(s24h, w15), fsimd::mullo_u16_8(fsimd::widen_hi_u8_to_u16(v3), w20))));
715 hi = fsimd::srli_u16_8(hi, 6);
716 fsimd::store_u8_16(out+i, fsimd::narrow_u16_to_u8(lo, hi));
718 for (; i < nbytes; ++i) {
719 u16 s06=(u16)p0[i]+(u16)p6[i], s15=(u16)p1[i]+(u16)p5[i], s24=(u16)p2[i]+(u16)p4[i];
720 out[i]=(
u8)((s06+s15*6+s24*15+(u16)p3[i]*20)>>6);
726 const u8 *p4,
const u8 *p5,
const u8 *p6,
const u8 *p7,
729 const auto w8w = fsimd::set1_u16_16(8), w28w = fsimd::set1_u16_16(28);
730 const auto w56w = fsimd::set1_u16_16(56), w70w = fsimd::set1_u16_16(70);
731 const auto w8 = fsimd::set1_u16_8(8), w28 = fsimd::set1_u16_8(28);
732 const auto w56 = fsimd::set1_u16_8(56), w70 = fsimd::set1_u16_8(70);
734 for (; i + 31 < nbytes; i += 32) {
735 auto v0 = fsimd::load_u8_32(p0+i), v1 = fsimd::load_u8_32(p1+i), v2 = fsimd::load_u8_32(p2+i);
736 auto v3 = fsimd::load_u8_32(p3+i), v4 = fsimd::load_u8_32(p4+i), v5 = fsimd::load_u8_32(p5+i);
737 auto v6v = fsimd::load_u8_32(p6+i), v7 = fsimd::load_u8_32(p7+i), v8v = fsimd::load_u8_32(p8+i);
738 auto s08 = fsimd::add_u16_16(fsimd::widen_lo_u8x32_to_u16(v0), fsimd::widen_lo_u8x32_to_u16(v8v));
739 auto s17 = fsimd::add_u16_16(fsimd::widen_lo_u8x32_to_u16(v1), fsimd::widen_lo_u8x32_to_u16(v7));
740 auto s26 = fsimd::add_u16_16(fsimd::widen_lo_u8x32_to_u16(v2), fsimd::widen_lo_u8x32_to_u16(v6v));
741 auto s35 = fsimd::add_u16_16(fsimd::widen_lo_u8x32_to_u16(v3), fsimd::widen_lo_u8x32_to_u16(v5));
742 auto lo = fsimd::add_u16_16(s08, fsimd::add_u16_16(fsimd::mullo_u16_16(s17, w8w),
743 fsimd::add_u16_16(fsimd::mullo_u16_16(s26, w28w),
744 fsimd::add_u16_16(fsimd::mullo_u16_16(s35, w56w), fsimd::mullo_u16_16(fsimd::widen_lo_u8x32_to_u16(v4), w70w)))));
745 lo = fsimd::srli_u16_16(lo, 8);
746 auto s08h = fsimd::add_u16_16(fsimd::widen_hi_u8x32_to_u16(v0), fsimd::widen_hi_u8x32_to_u16(v8v));
747 auto s17h = fsimd::add_u16_16(fsimd::widen_hi_u8x32_to_u16(v1), fsimd::widen_hi_u8x32_to_u16(v7));
748 auto s26h = fsimd::add_u16_16(fsimd::widen_hi_u8x32_to_u16(v2), fsimd::widen_hi_u8x32_to_u16(v6v));
749 auto s35h = fsimd::add_u16_16(fsimd::widen_hi_u8x32_to_u16(v3), fsimd::widen_hi_u8x32_to_u16(v5));
750 auto hi = fsimd::add_u16_16(s08h, fsimd::add_u16_16(fsimd::mullo_u16_16(s17h, w8w),
751 fsimd::add_u16_16(fsimd::mullo_u16_16(s26h, w28w),
752 fsimd::add_u16_16(fsimd::mullo_u16_16(s35h, w56w), fsimd::mullo_u16_16(fsimd::widen_hi_u8x32_to_u16(v4), w70w)))));
753 hi = fsimd::srli_u16_16(hi, 8);
754 fsimd::store_u8_32(out+i, fsimd::narrow_u16x16_to_u8(lo, hi));
756 for (; i + 15 < nbytes; i += 16) {
757 auto v0 = fsimd::load_u8_16(p0+i), v1 = fsimd::load_u8_16(p1+i), v2 = fsimd::load_u8_16(p2+i);
758 auto v3 = fsimd::load_u8_16(p3+i), v4 = fsimd::load_u8_16(p4+i), v5 = fsimd::load_u8_16(p5+i);
759 auto v6v = fsimd::load_u8_16(p6+i), v7 = fsimd::load_u8_16(p7+i), v8v = fsimd::load_u8_16(p8+i);
760 auto s08 = fsimd::add_u16_8(fsimd::widen_lo_u8_to_u16(v0), fsimd::widen_lo_u8_to_u16(v8v));
761 auto s17 = fsimd::add_u16_8(fsimd::widen_lo_u8_to_u16(v1), fsimd::widen_lo_u8_to_u16(v7));
762 auto s26 = fsimd::add_u16_8(fsimd::widen_lo_u8_to_u16(v2), fsimd::widen_lo_u8_to_u16(v6v));
763 auto s35 = fsimd::add_u16_8(fsimd::widen_lo_u8_to_u16(v3), fsimd::widen_lo_u8_to_u16(v5));
764 auto lo = fsimd::add_u16_8(s08, fsimd::add_u16_8(fsimd::mullo_u16_8(s17, w8),
765 fsimd::add_u16_8(fsimd::mullo_u16_8(s26, w28),
766 fsimd::add_u16_8(fsimd::mullo_u16_8(s35, w56), fsimd::mullo_u16_8(fsimd::widen_lo_u8_to_u16(v4), w70)))));
767 lo = fsimd::srli_u16_8(lo, 8);
768 auto s08h = fsimd::add_u16_8(fsimd::widen_hi_u8_to_u16(v0), fsimd::widen_hi_u8_to_u16(v8v));
769 auto s17h = fsimd::add_u16_8(fsimd::widen_hi_u8_to_u16(v1), fsimd::widen_hi_u8_to_u16(v7));
770 auto s26h = fsimd::add_u16_8(fsimd::widen_hi_u8_to_u16(v2), fsimd::widen_hi_u8_to_u16(v6v));
771 auto s35h = fsimd::add_u16_8(fsimd::widen_hi_u8_to_u16(v3), fsimd::widen_hi_u8_to_u16(v5));
772 auto hi = fsimd::add_u16_8(s08h, fsimd::add_u16_8(fsimd::mullo_u16_8(s17h, w8),
773 fsimd::add_u16_8(fsimd::mullo_u16_8(s26h, w28),
774 fsimd::add_u16_8(fsimd::mullo_u16_8(s35h, w56), fsimd::mullo_u16_8(fsimd::widen_hi_u8_to_u16(v4), w70)))));
775 hi = fsimd::srli_u16_8(hi, 8);
776 fsimd::store_u8_16(out+i, fsimd::narrow_u16_to_u8(lo, hi));
778 for (; i < nbytes; ++i) {
779 u16 s08=(u16)p0[i]+(u16)p8[i], s17=(u16)p1[i]+(u16)p7[i];
780 u16 s26=(u16)p2[i]+(u16)p6[i], s35=(u16)p3[i]+(u16)p5[i];
781 out[i]=(
u8)((s08+s17*8+s26*28+s35*56+(u16)p4[i]*70)>>8);
790 template <
typename RGB_T>
797 template <
typename RGB_T>
800 (
const u8*)fwd[0], out, nbytes);
805 template <
typename RGB_T>
808 (
const u8*)bufs[2], (
const u8*)fwd[0],
809 (
const u8*)fwd[1], out, nbytes);
814 template <
typename RGB_T>
817 (
const u8*)bufs[2], (
const u8*)bufs[3],
818 (
const u8*)fwd[0], (
const u8*)fwd[1],
819 (
const u8*)fwd[2], out, nbytes);
824 template <
typename RGB_T>
827 (
const u8*)bufs[2], (
const u8*)bufs[3],
828 (
const u8*)bufs[4], (
const u8*)fwd[0],
829 (
const u8*)fwd[1], (
const u8*)fwd[2],
830 (
const u8*)fwd[3], out, nbytes);
860 simd_conv_r3(pb, pb+S, pb+2*S, pb+3*S, pb+4*S, pb+5*S, pb+6*S, ob, nbytes);
866 simd_conv_r4(pb, pb+S, pb+2*S, pb+3*S, pb+4*S, pb+5*S, pb+6*S, pb+7*S, pb+8*S, ob, nbytes);
874template <
typename RGB_T,
typename acc_t>
879 r = p.ch(bufs[0][
x].r);
880 g = p.ch(bufs[0][
x].
g);
881 b = p.ch(bufs[0][
x].b);
885template <
typename RGB_T,
typename acc_t>
890 r = (p.ch(bufs[0][
x].r) + p.ch(fwd[0][
x].r)) + (p.ch(bufs[1][
x].r) << 1);
891 g = (p.ch(bufs[0][
x].
g) + p.ch(fwd[0][
x].g)) + (p.ch(bufs[1][
x].
g) << 1);
892 b = (p.ch(bufs[0][
x].b) + p.ch(fwd[0][
x].b)) + (p.ch(bufs[1][
x].b) << 1);
896template <
typename RGB_T,
typename acc_t>
901 const acc_t sr04 = p.ch(bufs[0][
x].r) + p.ch(fwd[1][
x].r);
902 const acc_t sg04 = p.ch(bufs[0][
x].
g) + p.ch(fwd[1][
x].
g);
903 const acc_t sb04 = p.ch(bufs[0][
x].b) + p.ch(fwd[1][
x].b);
904 const acc_t sr13 = p.ch(bufs[1][
x].r) + p.ch(fwd[0][
x].r);
905 const acc_t sg13 = p.ch(bufs[1][
x].
g) + p.ch(fwd[0][
x].
g);
906 const acc_t sb13 = p.ch(bufs[1][
x].b) + p.ch(fwd[0][
x].b);
907 r = sr04 + sr13 * 4 + p.ch(bufs[2][
x].r) * 6;
908 g = sg04 + sg13 * 4 + p.ch(bufs[2][
x].
g) * 6;
909 b = sb04 + sb13 * 4 + p.ch(bufs[2][
x].b) * 6;
913template <
typename RGB_T,
typename acc_t>
918 const acc_t sr06 = p.ch(bufs[0][
x].r) + p.ch(fwd[2][
x].r);
919 const acc_t sg06 = p.ch(bufs[0][
x].
g) + p.ch(fwd[2][
x].
g);
920 const acc_t sb06 = p.ch(bufs[0][
x].b) + p.ch(fwd[2][
x].b);
921 const acc_t sr15 = p.ch(bufs[1][
x].r) + p.ch(fwd[1][
x].r);
922 const acc_t sg15 = p.ch(bufs[1][
x].
g) + p.ch(fwd[1][
x].
g);
923 const acc_t sb15 = p.ch(bufs[1][
x].b) + p.ch(fwd[1][
x].b);
924 const acc_t sr24 = p.ch(bufs[2][
x].r) + p.ch(fwd[0][
x].r);
925 const acc_t sg24 = p.ch(bufs[2][
x].
g) + p.ch(fwd[0][
x].
g);
926 const acc_t sb24 = p.ch(bufs[2][
x].b) + p.ch(fwd[0][
x].b);
927 r = sr06 + sr15 * 6 + sr24 * 15 + p.ch(bufs[3][
x].r) * 20;
928 g = sg06 + sg15 * 6 + sg24 * 15 + p.ch(bufs[3][
x].
g) * 20;
929 b = sb06 + sb15 * 6 + sb24 * 15 + p.ch(bufs[3][
x].b) * 20;
933template <
typename RGB_T,
typename acc_t>
938 const acc_t sr08 = p.ch(bufs[0][
x].r) + p.ch(fwd[3][
x].r);
939 const acc_t sg08 = p.ch(bufs[0][
x].
g) + p.ch(fwd[3][
x].
g);
940 const acc_t sb08 = p.ch(bufs[0][
x].b) + p.ch(fwd[3][
x].b);
941 const acc_t sr17 = p.ch(bufs[1][
x].r) + p.ch(fwd[2][
x].r);
942 const acc_t sg17 = p.ch(bufs[1][
x].
g) + p.ch(fwd[2][
x].
g);
943 const acc_t sb17 = p.ch(bufs[1][
x].b) + p.ch(fwd[2][
x].b);
944 const acc_t sr26 = p.ch(bufs[2][
x].r) + p.ch(fwd[1][
x].r);
945 const acc_t sg26 = p.ch(bufs[2][
x].
g) + p.ch(fwd[1][
x].
g);
946 const acc_t sb26 = p.ch(bufs[2][
x].b) + p.ch(fwd[1][
x].b);
947 const acc_t sr35 = p.ch(bufs[3][
x].r) + p.ch(fwd[0][
x].r);
948 const acc_t sg35 = p.ch(bufs[3][
x].
g) + p.ch(fwd[0][
x].
g);
949 const acc_t sb35 = p.ch(bufs[3][
x].b) + p.ch(fwd[0][
x].b);
950 r = sr08 + sr17 * 8 + sr26 * 28 + sr35 * 56 + p.ch(bufs[4][
x].r) * 70;
951 g = sg08 + sg17 * 8 + sg26 * 28 + sg35 * 56 + p.ch(bufs[4][
x].
g) * 70;
952 b = sb08 + sb17 * 8 + sb26 * 28 + sb35 * 56 + p.ch(bufs[4][
x].b) * 70;
964#if !defined(FL_IS_AVR)
966template <
int R,
typename RGB_T,
typename acc_t,
bool ApplyAlpha,
typename AlphaT>
969 RGB_T *pixels,
int w,
int h,
970 RGB_T *scratch, AlphaT alpha)
972 constexpr int shift = 2 * R;
977 RGB_T *bufs[5] = {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr};
978 for (
int i = 0; i <= R; ++i)
979 bufs[i] = scratch + i * w;
980 RGB_T *zero_row = scratch + (R + 1) * w;
985 for (
int y = 0;
y < h; ++
y) {
986 RGB_T *out_row = pixels +
y * w;
992 const RGB_T *fwd[4] = {zero_row, zero_row, zero_row, zero_row};
993 for (
int k = 0; k < R; ++k)
994 fwd[k] = (
y + 1 + k < h) ? (pixels + (
y + 1 + k) * w) : zero_row;
1000 const int prefetch_y =
y + R + 2;
1001 if (prefetch_y < h) {
1002 const char *pf = (
const char *)(pixels + prefetch_y * w);
1003 const int row_bytes = w * (int)
sizeof(RGB_T);
1004 for (
int off = 0; off < row_bytes; off += 64)
1005 __builtin_prefetch(pf + off, 0, 3);
1014 if (
sizeof(
typename RGB_T::fp) == 1 && !ApplyAlpha) {
1016 const int nbytes = w * (int)
sizeof(RGB_T);
1017 u8 *ob = (
u8 *)out_row;
1022 for (
int x = 0;
x < w; ++
x) {
1028 out_row[
x] = P::make(
static_cast<acc_t
>(r >> shift),
1029 static_cast<acc_t
>(
g >> shift),
1030 static_cast<acc_t
>(b >> shift), alpha);
1032 out_row[
x] = P::make(
static_cast<acc_t
>(r >> shift),
1033 static_cast<acc_t
>(
g >> shift),
1034 static_cast<acc_t
>(b >> shift));
1040 RGB_T *recycled = bufs[0];
1041 for (
int i = 0; i < R; ++i) bufs[i] = bufs[i + 1];
1049template <
int hR,
int vR,
typename RGB_T>
1051 int hPad = 2 * hR + w;
1052#if defined(FL_IS_AVR)
1053 int vPad = 2 * vR + h;
1055 int vPad = vR > 0 ? (vR + 2) * w : 0;
1057 return hPad > vPad ? hPad : vPad;
1062template <
int R,
typename RGB_T,
typename acc_t,
bool ApplyAlpha,
typename AlphaT>
1065#if defined(FL_IS_AVR)
1067 apply_pass_alpha_1ch<R>(pad, out, w, 1, alpha);
1069 apply_pass_1ch<R>(pad, out, w, 1);
1072 if (
sizeof(
typename RGB_T::fp) == 1 && !ApplyAlpha) {
1073 constexpr int S = (int)
sizeof(RGB_T);
1074 const int nbytes = w * S;
1075 const u8 *pb = (
const u8 *)pad;
1078 pb, S, ob, nbytes, (
u8 *)(pad + 2 * R + w), w);
1079 }
else if (ApplyAlpha) {
1088template <
int R,
typename RGB_T,
typename acc_t,
bool ApplyAlpha,
typename AlphaT>
1090#if defined(FL_IS_AVR)
1095 for (
int x = 0;
x < w; ++
x) {
1098 const RGB_T *src = pixels +
x;
1099 RGB_T *dst = scratch + R;
1100 for (
int i = 0; i < h; ++i) {
1106 apply_pass_alpha_1ch<R>(scratch, pixels +
x, h, w, alpha);
1108 apply_pass_1ch<R>(scratch, pixels +
x, h, w);
1115 pixels, w, h, scratch, alpha);
1118 pixels, w, h, scratch, alpha);
1130template <
int hRadius,
int vRadius,
typename RGB_T,
typename AlphaT>
1133 const int w = canvas.width;
1134 const int h = canvas.height;
1135 if (w <= 0 || h <= 0)
1147 if (hRadius == 0 && vRadius == 0) {
1149 RGB_T *pixels = canvas.pixels;
1150 for (
int i = 0; i < w * h; ++i) {
1151 RGB_T &p = pixels[i];
1152 p = P::make(P::ch(p.r), P::ch(p.g), P::ch(p.b), alpha);
1160 RGB_T *pad = padbuf.
data();
1161 RGB_T *pixels = canvas.pixels;
1169 for (
int y = 0;
y < h; ++
y) {
1170 RGB_T *row = pixels +
y * w;
1173 if (vRadius == 0 && applyAlpha)
1175 pad, row, w, alpha);
1178 pad, row, w, alpha);
1186 pixels, w, h, pad, alpha);
1189 pixels, w, h, pad, alpha);
1195template <
int hRadius,
int vRadius,
typename RGB_T>
1202template <
int hRadius,
int vRadius,
typename RGB_T>
1210template <
int hRadius,
int vRadius,
typename RGB_T,
typename AlphaT>
1213 const int w = canvas.width;
1214 const int h = canvas.height;
1215 if (w <= 0 || h <= 0)
1219 if (canvas.xymap->isRectangularGrid()) {
1232 if (hRadius == 0 && vRadius == 0) {
1234 for (
int y = 0;
y < h; ++
y) {
1235 for (
int x = 0;
x < w; ++
x) {
1236 RGB_T &p = canvas.at(
x,
y);
1238 p = ops.make(ops.ch(p.r), ops.ch(p.g), ops.ch(p.b), alpha);
1247 RGB_T *pad = padbuf.
data();
1254 for (
int y = 0;
y < h; ++
y) {
1255 for (
int x = 0;
x < w; ++
x)
1256 pad[hRadius +
x] = canvas.at(
x,
y);
1258 constexpr int shift = 2 * hRadius;
1259 for (
int x = 0;
x < w; ++
x) {
1263 if (vRadius == 0 && applyAlpha)
1264 result =
P().make(
static_cast<acc_t
>(r >> shift),
1265 static_cast<acc_t
>(
g >> shift),
1266 static_cast<acc_t
>(b >> shift), alpha);
1268 result =
P().make(
static_cast<acc_t
>(r >> shift),
1269 static_cast<acc_t
>(
g >> shift),
1270 static_cast<acc_t
>(b >> shift));
1281 for (
int x = 0;
x < w; ++
x) {
1282 for (
int y = 0;
y < h; ++
y)
1283 pad[vRadius +
y] = canvas.at(
x,
y);
1285 constexpr int shift = 2 * vRadius;
1286 for (
int y = 0;
y < h; ++
y) {
1291 result =
P().make(
static_cast<acc_t
>(r >> shift),
1292 static_cast<acc_t
>(
g >> shift),
1293 static_cast<acc_t
>(b >> shift), alpha);
1295 result =
P().make(
static_cast<acc_t
>(r >> shift),
1296 static_cast<acc_t
>(
g >> shift),
1297 static_cast<acc_t
>(b >> shift));
1306template <
int hRadius,
int vRadius,
typename RGB_T>
1313template <
int hRadius,
int vRadius,
typename RGB_T>
1320#define BLUR_INST_F8(H, V, T) \
1321 template void blurGaussian<H, V, T>(Canvas<T> &, alpha8);
1333#if !defined(FL_IS_AVR)
1347#define BLUR_INST_F16(H, V, T) \
1348 template void blurGaussian<H, V, T>(Canvas<T> &, alpha16);
1360#if !defined(FL_IS_AVR)
1374#define BLUR_MAPPED_INST_F8(H, V, T) \
1375 template void blurGaussian<H, V, T>(CanvasMapped<T> &, alpha8);
1385#if !defined(FL_IS_AVR)
1395#undef BLUR_MAPPED_INST_F8
1399#define BLUR_MAPPED_INST_F16(H, V, T) \
1400 template void blurGaussian<H, V, T>(CanvasMapped<T> &, alpha16);
1410#if !defined(FL_IS_AVR)
1420#undef BLUR_MAPPED_INST_F16
FL_OPTIMIZATION_LEVEL_O3_BEGIN fl::u16 XY(fl::u8 x, fl::u8 y) FL_NO_EXCEPT FL_LINK_WEAK
static XYMap constructWithUserFunction(u16 width, u16 height, XYFunction xyFunction, u16 offset=0) FL_NO_EXCEPT
const T * data() const FL_NO_EXCEPT
static constexpr FASTLED_FORCE_INLINE u8x8 from_raw(u16 raw) FL_NO_EXCEPT
fl::size size() const FL_NO_EXCEPT
void resize(fl::size n) FL_NO_EXCEPT
#define FL_OPTIMIZATION_LEVEL_O3_BEGIN
#define FL_BUILTIN_MEMCPY(dest, src, n)
#define FL_NO_INLINE_IF_AVR
#define FL_OPTIMIZATION_LEVEL_O3_END
#define FASTLED_UNUSED(x)
#define FL_OPTIMIZE_FUNCTION
#define FL_BUILTIN_MEMSET(dest, val, n)
#define FL_RESTRICT_PARAM
#define constexpr
Declares that it is possible to evaluate a value at compile time, introduced in C++11.
Defines the 8-bit red, green, and blue (RGB) pixel type in the fl namespace.
Legacy compatibility header for 8-bit scaling functions.
Internal FastLED header for implementation files.
void blur1d(fl::span< CRGB > leds, fract8 blur_amount) FL_NO_EXCEPT
One-dimensional blur filter (span version).
void blur2d(fl::span< CRGB > leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xymap) FL_NO_EXCEPT
Two-dimensional blur filter (span version).
void blurColumns(fl::span< CRGB > leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xyMap) FL_NO_EXCEPT
Perform a blur1d() on every column of a rectangular matrix (span version).
void blurRows(fl::span< CRGB > leds, fl::u8 width, fl::u8 height, fract8 blur_amount, const XYMap &xyMap) FL_NO_EXCEPT
Perform a blur1d() on every row of a rectangular matrix (span version).
Centralized logging categories for FastLED hardware interfaces and subsystems.
fl::u16 xy_legacy_wrapper(fl::u16 x, fl::u16 y, fl::u16 width, fl::u16 height) FL_NO_EXCEPT
static void simd_conv_14641(const u8 *p0, const u8 *p1, const u8 *p2, const u8 *p3, const u8 *p4, u8 *out, int nbytes) FL_NO_EXCEPT
static void vpass_full(RGB_T *pixels, int w, int h, RGB_T *scratch, AlphaT alpha) FL_NO_EXCEPT
constexpr alpha16 alpha_identity< alpha16 >() FL_NO_EXCEPT
static void simd_conv_r4(const u8 *p0, const u8 *p1, const u8 *p2, const u8 *p3, const u8 *p4, const u8 *p5, const u8 *p6, const u8 *p7, const u8 *p8, u8 *out, int nbytes) FL_NO_EXCEPT
static fl::span< RGB_T > get_padbuf(int minSize) FL_NO_EXCEPT
static void simd_conv_r3(const u8 *p0, const u8 *p1, const u8 *p2, const u8 *p3, const u8 *p4, const u8 *p5, const u8 *p6, u8 *out, int nbytes) FL_NO_EXCEPT
FL_ALWAYS_INLINE void hpass_row(RGB_T *pad, RGB_T *out, int w, AlphaT alpha) FL_NO_EXCEPT
FL_NO_INLINE_IF_AVR static FL_OPTIMIZE_FUNCTION void apply_pass_alpha(const RGB_T *pad, RGB_T *out, int count, int stride, AlphaT alpha) FL_NO_EXCEPT
static int compute_pad_size(int w, int h) FL_NO_EXCEPT
FL_NO_INLINE_IF_AVR static FL_OPTIMIZE_FUNCTION void apply_pass(const RGB_T *pad, RGB_T *out, int count, int stride) FL_NO_EXCEPT
static FL_OPTIMIZE_FUNCTION void vpass_rowmajor_impl(RGB_T *pixels, int w, int h, RGB_T *scratch, AlphaT alpha) FL_NO_EXCEPT
constexpr AlphaT alpha_identity() FL_NO_EXCEPT
static void simd_conv_121(const u8 *FL_RESTRICT_PARAM a, const u8 *FL_RESTRICT_PARAM b, const u8 *FL_RESTRICT_PARAM c, u8 *FL_RESTRICT_PARAM out, int nbytes) FL_NO_EXCEPT
FL_OPTIMIZE_FUNCTION void blurGaussianImpl(Canvas< RGB_T > &canvas, AlphaT alpha) FL_NO_EXCEPT
CRGB BLUR_INST_F8(2, 2, CRGB) BLUR_INST_F8(3
void blurGaussian(Canvas< RGB_T > &canvas, alpha8 dimFactor) FL_NO_EXCEPT
Compile-time Gaussian blur with independent H/V radii.
FL_OPTIMIZE_FUNCTION void blurGaussianMappedImpl(CanvasMapped< RGB_T > &canvas, AlphaT alpha) FL_NO_EXCEPT
CRGB BLUR_INST_F16(2, 2, CRGB) BLUR_INST_F16(3
CRGB BLUR_MAPPED_INST_F16(2, 2, CRGB) BLUR_MAPPED_INST_F16(3
CRGB BLUR_MAPPED_INST_F8(2, 2, CRGB) BLUR_MAPPED_INST_F8(3
u8 u8 fract8 blur_amount FL_NO_EXCEPT
typename conditional< B, T, F >::type conditional_t
FASTLED_FORCE_INLINE fl::u8 P(fl::u8 x) FL_NO_EXCEPT
u8 fract8
Fixed-Point Fractional Types.
expected< T, E > result
Alias for expected (Rust-style naming)
Base definition for an LED controller.
Umbrella header for SIMD subsystem.
CRGB & nscale8(u8 scaledown) FL_NO_EXCEPT
Scale down a RGB to N/256ths of its current brightness, using "plain math" dimming rules.
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Representation of an 8-bit RGB pixel (Red, Green, Blue)
Unsigned 16-bit alpha / brightness — UNORM16.
Unsigned 8-bit alpha / brightness — UNORM8.
Simple rectangular canvas for graphics operations Combines a pixel buffer with dimensions for cache-o...
XYMap-backed canvas for non-rectangular or remapped layouts.
FL_ALWAYS_INLINE void apply(const RGB_T *row, int x, acc_t &r, acc_t &g, acc_t &b) FL_NO_EXCEPT
FL_ALWAYS_INLINE void apply(const RGB_T *row, int x, acc_t &r, acc_t &g, acc_t &b) FL_NO_EXCEPT
FL_ALWAYS_INLINE void apply(const RGB_T *row, int x, acc_t &r, acc_t &g, acc_t &b) FL_NO_EXCEPT
FL_ALWAYS_INLINE void apply(const RGB_T *row, int x, acc_t &r, acc_t &g, acc_t &b) FL_NO_EXCEPT
FL_ALWAYS_INLINE void apply(const RGB_T *row, int x, acc_t &r, acc_t &g, acc_t &b) FL_NO_EXCEPT
FL_ALWAYS_INLINE CRGB16 make(u32 r, u32 g, u32 b) FL_NO_EXCEPT
FL_ALWAYS_INLINE CRGB16 make(u32 r, u32 g, u32 b, alpha16 a) FL_NO_EXCEPT
FL_ALWAYS_INLINE CRGB16 make(u32 r, u32 g, u32 b, alpha8 a) FL_NO_EXCEPT
FL_ALWAYS_INLINE CRGB16 zero() FL_NO_EXCEPT
FL_ALWAYS_INLINE u32 ch(u8x8 v) FL_NO_EXCEPT
FL_ALWAYS_INLINE CRGB zero() FL_NO_EXCEPT
FL_ALWAYS_INLINE CRGB make(u16 r, u16 g, u16 b) FL_NO_EXCEPT
FL_ALWAYS_INLINE CRGB make(u16 r, u16 g, u16 b, alpha8 a) FL_NO_EXCEPT
FL_ALWAYS_INLINE u16 ch(u8 v) FL_NO_EXCEPT
FL_ALWAYS_INLINE CRGB make(u16 r, u16 g, u16 b, alpha16 a) FL_NO_EXCEPT
static void apply(const u8 *pb, int, u8 *ob, int nbytes, u8 *, int) FL_NO_EXCEPT
static void apply(const u8 *pb, int S, u8 *ob, int nbytes, u8 *, int) FL_NO_EXCEPT
static void apply(const u8 *pb, int S, u8 *ob, int nbytes, u8 *, int) FL_NO_EXCEPT
static void apply(const u8 *pb, int S, u8 *ob, int nbytes, u8 *, int) FL_NO_EXCEPT
static void apply(const u8 *pb, int S, u8 *ob, int nbytes, u8 *, int) FL_NO_EXCEPT
static void apply(RGB_T **bufs, const RGB_T **, u8 *out, int nbytes) FL_NO_EXCEPT
static void apply(RGB_T **bufs, const RGB_T **fwd, u8 *out, int nbytes) FL_NO_EXCEPT
static void apply(RGB_T **bufs, const RGB_T **fwd, u8 *out, int nbytes) FL_NO_EXCEPT
static void apply(RGB_T **bufs, const RGB_T **fwd, u8 *out, int nbytes) FL_NO_EXCEPT
static void apply(RGB_T **bufs, const RGB_T **fwd, u8 *out, int nbytes) FL_NO_EXCEPT
FL_ALWAYS_INLINE void apply(RGB_T **bufs, const RGB_T **, int x, acc_t &r, acc_t &g, acc_t &b) FL_NO_EXCEPT
FL_ALWAYS_INLINE void apply(RGB_T **bufs, const RGB_T **fwd, int x, acc_t &r, acc_t &g, acc_t &b) FL_NO_EXCEPT
FL_ALWAYS_INLINE void apply(RGB_T **bufs, const RGB_T **fwd, int x, acc_t &r, acc_t &g, acc_t &b) FL_NO_EXCEPT
FL_ALWAYS_INLINE void apply(RGB_T **bufs, const RGB_T **fwd, int x, acc_t &r, acc_t &g, acc_t &b) FL_NO_EXCEPT
FL_ALWAYS_INLINE void apply(RGB_T **bufs, const RGB_T **fwd, int x, acc_t &r, acc_t &g, acc_t &b) FL_NO_EXCEPT