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

◆ encodeWS2801()

template<typename InputIterator, typename OutputIterator>
void encodeWS2801 ( InputIterator first,
InputIterator last,
OutputIterator out )

Encode pixel data in WS2801/WS2803 format using PixelIterator.

Deprecated
Use the input iterator version in ws2801.h instead: auto pixel_range = makeScaledPixelRangeRGB(&pixelIterator); auto out = fl::back_inserter(buffer); encodeWS2801(pixel_range.first, pixel_range.second, out);
Template Parameters
InputIteratorIterator yielding fl::array<u8, 3> (RGB bytes)
OutputIteratorOutput iterator accepting uint8_t
Parameters
firstIterator to first pixel
lastIterator past last pixel
outOutput iterator for encoded bytes
Note
This is now just a thin wrapper around the modern iterator version
Examples
/home/runner/work/FastLED/FastLED/src/fl/chipsets/encoders/output_sink.h.

Definition at line 36 of file ws2801_encoder_impl.h.

36 {
37 // Forward to the modern implementation in ws2801.h
38 // This function signature is identical, so just call through
39 while (first != last) {
40 const array<u8, 3>& pixel = *first;
41 *out++ = pixel[0]; // Red
42 *out++ = pixel[1]; // Green
43 *out++ = pixel[2]; // Blue
44 ++first;
45 }
46 // No end frame needed - WS2801 latches via timing (clock pause)
47}