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

◆ writeHD108()

template<typename CONTAINER_UIN8_T>
void fl::PixelIterator::writeHD108 ( CONTAINER_UIN8_T * out)
inline

Encode pixels in HD108 format (zero allocation)

Parameters
outOutput buffer to write encoded bytes
Note
Protocol: 16-bit RGB with gamma correction and brightness control

Definition at line 351 of file pixel_iterator.h.

351 {
352 auto back_ins = fl::back_inserter(*out);
353
354 #if FASTLED_HD_COLOR_MIXING
355 // HD mode: per-LED brightness
356 auto pixel_range = makeScaledPixelRangeRGB(this);
357 auto brightness_range = makeScaledBrightnessRange(this);
358 encodeHD108_HD(pixel_range.first, pixel_range.second,
359 brightness_range.first, back_ins);
360 #else
361 // Standard mode: global brightness (255 = full)
362 auto pixel_range = makeScaledPixelRangeRGB(this);
363 encodeHD108(pixel_range.first, pixel_range.second,
364 back_ins, 255);
365 #endif
366 }
pair< detail::ScaledPixelIteratorRGB, detail::ScaledPixelIteratorRGB > makeScaledPixelRangeRGB(PixelIterator *pixels) FL_NOEXCEPT
Create RGB input iterator range from PixelIterator.
back_insert_iterator< Container > back_inserter(Container &c) FL_NOEXCEPT
Helper function to create a back_insert_iterator.
Definition iterator.h:139
pair< detail::ScaledPixelIteratorBrightness, detail::ScaledPixelIteratorBrightness > makeScaledBrightnessRange(PixelIterator *pixels) FL_NOEXCEPT
Create brightness input iterator range from PixelIterator.
void encodeHD108_HD(InputIterator first, InputIterator last, BrightnessIterator brightness_first, OutputIterator out) FL_NOEXCEPT
Encode pixel data in HD108 format with per-LED brightness.
Definition hd108.h:90
void encodeHD108(InputIterator first, InputIterator last, OutputIterator out, u8 global_brightness=255) FL_NOEXCEPT
Encode pixel data in HD108 format with global brightness.
Definition hd108.h:38

References fl::back_inserter(), fl::encodeHD108(), fl::encodeHD108_HD(), FL_NOEXCEPT, fl::makeScaledBrightnessRange(), and fl::makeScaledPixelRangeRGB().

Referenced by fl::Channel::showPixels().

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