FastLED 3.10.6
Loading...
Searching...
No Matches

◆ encodeUCS7604_16bit_RGB()

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

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

Template Parameters
InputIteratorIterator yielding fl::array<uint8_t, 3> (RGB 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 6 bytes per pixel (R16_hi, R16_lo, G16_hi, G16_lo, B16_hi, B16_lo)

Definition at line 146 of file ucs7604.h.

147 {
148 while (first != last) {
149 const auto& pixel = *first;
150
151 // Apply gamma correction for 16-bit output
152 u8 rgb_in[3] = { pixel[0], pixel[1], pixel[2] };
153 u16 rgb_out[3];
154 gamma.convert(fl::span<const u8>(rgb_in, 3), fl::span<u16>(rgb_out, 3));
155
156 // Write big-endian 16-bit values
157 *out++ = rgb_out[0] >> 8;
158 *out++ = rgb_out[0] & 0xFF;
159 *out++ = rgb_out[1] >> 8;
160 *out++ = rgb_out[1] & 0xFF;
161 *out++ = rgb_out[2] >> 8;
162 *out++ = rgb_out[2] & 0xFF;
163 ++first;
164 }
165}
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: