MCPcopy Create free account
hub / github.com/FastLED/FastLED / writeSK9822

Method writeSK9822

src/fl/chipsets/encoders/pixel_iterator.h:255–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253 /// @note Protocol: Same as APA102 but end frame uses 0x00 instead of 0xFF
254 template <typename CONTAINER_UIN8_T>
255 void writeSK9822(CONTAINER_UIN8_T* out, bool hd_gamma = false) FL_NOEXCEPT {
256 auto back_ins = fl::back_inserter(*out);
257
258 #if FASTLED_HD_COLOR_MIXING
259 if (hd_gamma) {
260 // HD gamma mode: per-LED brightness
261 auto pixel_range = makeScaledPixelRangeRGB(this);
262 auto brightness_range = makeScaledBrightnessRange(this);
263 encodeSK9822_HD(pixel_range.first, pixel_range.second,
264 brightness_range.first, back_ins);
265 return;
266 }
267 #endif
268
269 #if FASTLED_USE_GLOBAL_BRIGHTNESS == 1
270 // Global brightness mode: extract from first pixel
271 auto pixel_range = makeScaledPixelRangeRGB(this);
272 encodeSK9822_AutoBrightness(pixel_range.first, pixel_range.second,
273 back_ins);
274 #else
275 // Full brightness mode
276 auto pixel_range = makeScaledPixelRangeRGB(this);
277 encodeSK9822(pixel_range.first, pixel_range.second,
278 back_ins, 31);
279 #endif
280 }
281
282 // ========== SPI Chipset Encoders ==========
283 // Refactored to use standalone encoder functions in src/fl/chipsets/encoders/

Callers 1

showPixelsMethod · 0.80

Calls 5

back_inserterFunction · 0.85
makeScaledPixelRangeRGBFunction · 0.85
encodeSK9822_HDFunction · 0.85
encodeSK9822Function · 0.85

Tested by

no test coverage detected