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

◆ dotRowQ16()

i32 fl::anonymous_namespace{source_xyz.cpp.hpp}::dotRowQ16 ( const i32(&) row[3],
u16 r,
u16 g,
u16 b )

One matrix row against the pixel.

The accumulator is i64 because the three Q16xQ16 products are Q32: at full scale each term is ~4.3e9, which overflows i32 on its own.

Definition at line 46 of file source_xyz.cpp.hpp.

46 {
47 const i64 acc = static_cast<i64>(row[0]) * static_cast<i64>(r)
48 + static_cast<i64>(row[1]) * static_cast<i64>(g)
49 + static_cast<i64>(row[2]) * static_cast<i64>(b);
50 // Round to nearest rather than truncating: truncation biases every
51 // pixel downward, and the bias accumulates across the later stages.
52 return static_cast<i32>((acc + 32768) >> 16);
53}
InputGamut g
Definition rgbw.h:124
fl::i64 i64
Definition stdint.h:221

References dotRowQ16(), fl::FL_NO_EXCEPT, and fl::g.

Referenced by dotRowQ16().

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