FastLED 3.10.6
Loading...
Searching...
No Matches
tm1812.h
Go to the documentation of this file.
1
3
4#pragma once
5
7#include "fl/stl/array.h"
8#include "fl/stl/noexcept.h"
9#include "fl/stl/stdint.h"
10
11namespace fl {
12
23template <typename InputIterator, typename OutputIterator>
24void encodeTM1812_RGBWW(InputIterator first, InputIterator last,
25 OutputIterator out) FL_NO_EXCEPT {
26 while (first != last) {
27 const fl::array<u8, BYTES_PER_PIXEL_RGBWW>& firstPixel = *first;
28 for (u8 byte : firstPixel) {
29 *out++ = byte;
30 }
31 ++first;
32
33 if (first != last) {
34 const fl::array<u8, BYTES_PER_PIXEL_RGBWW>& secondPixel = *first;
35 for (u8 byte : secondPixel) {
36 *out++ = byte;
37 }
38 ++first;
39 } else {
40 for (u8 i = 0; i < BYTES_PER_PIXEL_RGBWW; ++i) {
41 *out++ = 0;
42 }
43 }
44
45 *out++ = 0;
46 *out++ = 0;
47 }
48}
49
50} // namespace fl
A fixed-size array implementation similar to std::array.
Definition array.h:27
Constants for SPI chipset encoders.
uint8_t byte
Definition midi_Defs.h:36
unsigned char u8
Definition stdint.h:131
void encodeTM1812_RGBWW(InputIterator first, InputIterator last, OutputIterator out) FL_NO_EXCEPT
Pack 5-channel RGBCCT pixels into TM1812 12-channel frames.
Definition tm1812.h:24
InputGamut g FL_NO_EXCEPT
Definition rgbw.h:121
constexpr size_t BYTES_PER_PIXEL_RGBWW
Number of bytes per RGBWW pixel (order-agnostic, issue #2558).
Base definition for an LED controller.
Definition crgb.hpp:179