438 {
439 if (blendType == LINEARBLEND_NOWRAP) {
440 index =
map8(index, 0, 239);
441
442 }
443
444
445 uint8_t hi4 =
lsrX4(index);
446 uint8_t lo4 = index & 0x0F;
447
449
450 uint8_t red1 = entry.red;
451 uint8_t green1 = entry.green;
452 uint8_t blue1 = entry.blue;
453
454 uint8_t
blend = lo4 && (blendType != NOBLEND);
455
457
458 if (hi4 == 15) {
460 } else {
462 }
463
464 uint8_t f2 = lo4 << 4;
465 uint8_t f1 = 255 - f2;
466
467 uint8_t red2 = entry.red;
470 red1 += red2;
471
472 uint8_t green2 = entry.green;
475 green1 += green2;
476
477 uint8_t blue2 = entry.blue;
480 blue1 += blue2;
481
483 }
484
488
489
490
491 if (red1) {
493#if !(FASTLED_SCALE8_FIXED == 1)
494 ++red1;
495#endif
496 }
497 if (green1) {
499#if !(FASTLED_SCALE8_FIXED == 1)
500 ++green1;
501#endif
502 }
503 if (blue1) {
505#if !(FASTLED_SCALE8_FIXED == 1)
506 ++blue1;
507#endif
508 }
510 } else {
511 red1 = 0;
512 green1 = 0;
513 blue1 = 0;
514 }
515 }
516
517 return CRGB(red1, green1, blue1);
518}
UISlider brightness("Brightness", 255, 0, 255, 1)
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
#define FL_PGM_READ_DWORD_NEAR(x)
Read a double word (32-bit) from PROGMEM memory.
LIB8STATIC uint8_t map8(uint8_t in, uint8_t rangeStart, uint8_t rangeEnd)
Map from one full-range 8-bit value into a narrower range of 8-bit values, possibly a range of hues.
LIB8STATIC_ALWAYS_INLINE void cleanup_R1()
Clean up the r1 register after a series of *LEAVING_R1_DIRTY calls.
LIB8STATIC_ALWAYS_INLINE uint8_t scale8_LEAVING_R1_DIRTY(uint8_t i, fract8 scale)
This version of scale8() does not clean up the R1 register on AVR.
uint8_t lsrX4(uint8_t dividend)
Helper function to divide a number by 16, aka four logical shift right (LSR)'s.
Representation of an RGB pixel (Red, Green, Blue)