FastLED 3.9.15
Loading...
Searching...
No Matches

◆ rgbw_partial_reorder()

void fl::rgbw_partial_reorder ( EOrderW w_placement,
u8 b0,
u8 b1,
u8 b2,
u8 w,
u8 * out_b0,
u8 * out_b1,
u8 * out_b2,
u8 * out_b3 )

Definition at line 540 of file rgbw.cpp.hpp.

542 {
543
544 u8 out[4] = {b0, b1, b2, 0};
545 switch (w_placement) {
546 // unrolled loop for speed.
547 case W3:
548 out[3] = w;
549 break;
550 case W2:
551 out[3] = out[2]; // memmove and copy.
552 out[2] = w;
553 break;
554 case W1:
555 out[3] = out[2];
556 out[2] = out[1];
557 out[1] = w;
558 break;
559 case W0:
560 out[3] = out[2];
561 out[2] = out[1];
562 out[1] = out[0];
563 out[0] = w;
564 break;
565 }
566 *out_b0 = out[0];
567 *out_b1 = out[1];
568 *out_b2 = out[2];
569 *out_b3 = out[3];
570}
constexpr EOrderW W3
Definition eorder.h:24
constexpr EOrderW W2
Definition eorder.h:25
constexpr EOrderW W0
Definition eorder.h:27
constexpr EOrderW W1
Definition eorder.h:26
unsigned char u8
Definition stdint.h:131

References W0, W1, W2, and W3.

Referenced by PixelController< RGB_ORDER, LANES, MASK >::loadAndScaleRGBW().

+ Here is the caller graph for this function: