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

◆ encodeUCS7604_16bit_RGBW()

template<typename InputIterator, typename OutputIterator>
void fl::encodeUCS7604_16bit_RGBW ( InputIterator first,
InputIterator last,
OutputIterator out,
const Gamma8 & gamma )

Encode RGBW pixels in UCS7604 16-bit format with gamma correction.

Template Parameters
InputIteratorIterator yielding fl::array<uint8_t, 4> (RGBW bytes)
OutputIteratorOutput iterator accepting uint8_t
Parameters
firstBeginning of pixel range
lastEnd of pixel range
outOutput iterator for encoded bytes
gammaGamma8 LUT for 8-to-16 bit expansion
Note
Writes 8 bytes per pixel (R16_hi, R16_lo, G16_hi, G16_lo, B16_hi, B16_lo, W16_hi, W16_lo)

Definition at line 174 of file ucs7604.h.

175 {
176 while (first != last) {
177 const auto& pixel = *first;
178
179 // Apply gamma correction for 16-bit output
180 u8 rgbw_in[4] = { pixel[0], pixel[1], pixel[2], pixel[3] };
181 u16 rgbw_out[4];
182 gamma.convert(fl::span<const u8>(rgbw_in, 4), fl::span<u16>(rgbw_out, 4));
183
184 // Write big-endian 16-bit values
185 *out++ = rgbw_out[0] >> 8;
186 *out++ = rgbw_out[0] & 0xFF;
187 *out++ = rgbw_out[1] >> 8;
188 *out++ = rgbw_out[1] & 0xFF;
189 *out++ = rgbw_out[2] >> 8;
190 *out++ = rgbw_out[2] & 0xFF;
191 *out++ = rgbw_out[3] >> 8;
192 *out++ = rgbw_out[3] & 0xFF;
193 ++first;
194 }
195}
unsigned char u8
Definition stdint.h:131
constexpr u32 gamma(float g) FL_NOEXCEPT
Definition gamma_lut.h:36

References gamma().

Referenced by encodeUCS7604().

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