FastLED 3.9.15
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 144 of file ucs7604.h.

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