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

◆ transpose_8strips()

FASTLED_FORCE_INLINE void fl::transpose_8strips ( const u8 *const input[8],
u8 * output,
u16 num_leds,
u8 bytes_per_led )

Transpose 8 LED strips into parallel bit format.

This function transposes 8 LED strips from standard byte-sequential format to bit-parallel format suitable for 8-way PIO output. It uses the highly optimized transpose8x1_MSB() function (Hacker's Delight algorithm).

Input: 8 strips, each with num_leds * bytes_per_led bytes Output: num_leds * bytes_per_led * 8 bytes

Parameters
inputArray of 8 pointers to LED strip data
outputPointer to output buffer
num_ledsNumber of LEDs per strip (all strips padded to this length)
bytes_per_ledNumber of bytes per LED (3 for RGB, 4 for RGBW, etc.)
Note
All strips must be pre-padded to the same length
Output buffer must be pre-allocated by caller
Examples
/home/runner/work/FastLED/FastLED/src/fl/math/transposition.h.

Definition at line 680 of file transposition.h.

685 {
686 // Process each LED
687 for (u16 led = 0; led < num_leds; led++) {
688 u8 temp_input[8];
689
690 // Process each byte in the LED
691 for (u8 byte_idx = 0; byte_idx < bytes_per_led; byte_idx++) {
692 // Collect one byte from each strip for this byte position
693 for (int strip = 0; strip < 8; strip++) {
694 temp_input[strip] = input[strip][led * bytes_per_led + byte_idx];
695 }
696
697 // Transpose 8 bytes → 8 bytes (1 bit from each strip per output byte)
698 transpose8x1_MSB(temp_input, output);
699
700 // Advance output pointer by 8 bytes
701 output += 8;
702 }
703 }
704}
unsigned char u8
Definition stdint.h:131
FASTLED_FORCE_INLINE void transpose8x1_MSB(unsigned char *A, unsigned char *B) FL_NOEXCEPT
Simplified 8x1 bit transpose with MSB-first output.

References FASTLED_FORCE_INLINE, FL_NOEXCEPT, transpose8x1_MSB(), and transpose_8strips().

Referenced by transpose_8strips(), and transpose_strips().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: