FastLED 3.10.8
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 216 of file ucs7604.h.

217 {
218 while (first != last) {
219 const auto& pixel = *first;
220
221 // Apply gamma correction for 16-bit output
222 u8 rgbw_in[4] = { pixel[0], pixel[1], pixel[2], pixel[3] };
223 u16 rgbw_out[4];
224 gamma.convert(fl::span<const u8>(rgbw_in, 4), fl::span<u16>(rgbw_out, 4));
225
226 // Write big-endian 16-bit values
227 *out++ = rgbw_out[0] >> 8;
228 *out++ = rgbw_out[0] & 0xFF;
229 *out++ = rgbw_out[1] >> 8;
230 *out++ = rgbw_out[1] & 0xFF;
231 *out++ = rgbw_out[2] >> 8;
232 *out++ = rgbw_out[2] & 0xFF;
233 *out++ = rgbw_out[3] >> 8;
234 *out++ = rgbw_out[3] & 0xFF;
235 ++first;
236 }
237}
unsigned char u8
Definition stdint.h:131
constexpr u32 gamma(float g) FL_NO_EXCEPT
Definition gamma_lut.h:36

References FL_NO_EXCEPT, and gamma().

Referenced by encodeUCS7604().

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