FastLED 3.10.6
Loading...
Searching...
No Matches

◆ writeLPD6803Wide()

template<typename OutputIterator>
void fl::PixelIterator::writeLPD6803Wide ( OutputIterator back_ins)
inline

LPD6803 over a colour-managed channel's 16-bit drives, quantized once to the chip's 5 bits per channel (B3).

Same framing as encodeLPD6803: four zero bytes, 1rrrrrgggggbbbbb per LED in wire order, then n / 32 dwords of FF 00 00 00.

Definition at line 489 of file pixel_iterator.h.

489 {
490 for (int i = 0; i < 4; ++i) {
491 *back_ins++ = 0x00;
492 }
493 fl::size num_leds = 0;
494 while (has(1)) {
495 u16 w[3];
496 loadAndScaleRGB16(&w[0], &w[1], &w[2]); // wire order
497 u16 command = 0x8000;
498 for (int c = 0; c < 3; ++c) {
499 const u32 code = (static_cast<u32>(w[c]) * 31u + 32767u) / 65535u;
500 command = static_cast<u16>(command | (code << (10 - 5 * c)));
501 }
502 *back_ins++ = static_cast<u8>(command >> 8);
503 *back_ins++ = static_cast<u8>(command & 0xFF);
505 advanceData();
506 ++num_leds;
507 }
508 const fl::size end_dwords = num_leds / 32;
509 for (fl::size i = 0; i < end_dwords; ++i) {
510 *back_ins++ = 0xFF;
511 *back_ins++ = 0x00;
512 *back_ins++ = 0x00;
513 *back_ins++ = 0x00;
514 }
515 }
void advanceData() FL_NO_EXCEPT
int size() FL_NO_EXCEPT
void loadAndScaleRGB16(u16 *r_out, u16 *g_out, u16 *b_out) FL_NO_EXCEPT
One pixel at the source's own precision, wire-ordered.
bool has(int n) FL_NO_EXCEPT
void stepDithering() FL_NO_EXCEPT
unsigned char u8
Definition stdint.h:131

References advanceData(), fl::FL_NO_EXCEPT, has(), loadAndScaleRGB16(), and stepDithering().

+ Here is the call graph for this function: