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

◆ rgbww_partial_reorder()

void fl::rgbww_partial_reorder ( EOrderWW ww_placement,
fl::u8 b0,
fl::u8 b1,
fl::u8 b2,
fl::u8 ww,
fl::u8 wc,
fl::u8 * out_b0,
fl::u8 * out_b1,
fl::u8 * out_b2,
fl::u8 * out_b3,
fl::u8 * out_b4 )

Dispatch RGB->RGBWW for a given mode.

Reorder a 5-channel pixel given an EOrderWW placement. The three RGB bytes (b0, b1, b2) are assumed to already be in native LED RGB order — this function only handles the warm-W / cool-W insertion. Outputs the final 5-byte stream in wire order.

Encoding convention (matches EOrderWW enum values): high nibble = warm-W destination index (0..4) low nibble = cool-W destination index (0..4) The remaining three indices receive b0, b1, b2 in ascending order.

Definition at line 127 of file rgbww.cpp.hpp.

131 {
132 // Five output slots: out[0..4].
133 u8 out[5];
134 const u8 enc = static_cast<u8>(ww_placement);
135 const u8 ww_idx = (enc >> 4) & 0x07;
136 const u8 wc_idx = enc & 0x07;
137 out[ww_idx] = ww;
138 out[wc_idx] = wc;
139 // Fill the three remaining slots with b0, b1, b2 in ascending index order.
140 u8 b_idx = 0;
141 const u8 rgb_bytes[3] = { b0, b1, b2 };
142 for (u8 k = 0; k < 5; ++k) {
143 if (k != ww_idx && k != wc_idx) {
144 out[k] = rgb_bytes[b_idx++];
145 }
146 }
147 *out_b0 = out[0];
148 *out_b1 = out[1];
149 *out_b2 = out[2];
150 *out_b3 = out[3];
151 *out_b4 = out[4];
152}
unsigned char u8
Definition stdint.h:131

References FL_NOEXCEPT.

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

+ Here is the caller graph for this function: