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

◆ mixLayers()

void mood_ring::MoodPainter::mixLayers ( const RoomSense & s)
private

Definition at line 101 of file mood_painter.cpp.

101 {
102 const float wb = clampf(s.calm * tuning.breathGain, 0.0f, 1.0f);
103 const float wf = clampf(s.flow * tuning.flowGain, 0.0f, 1.0f);
104 const float wg = clampf(s.groove * tuning.grooveGain, 0.0f, 1.0f);
105 const fl::size n = mMix.size();
106 for (fl::size i = 0; i < n; ++i) {
107 const RGBf &b = mBufBreath[i];
108 const RGBf &f = mBufFlow[i];
109 const RGBf &g = mBufGroove[i];
110 RGBf &m = mMix[i];
111 m.r = b.r * wb + f.r * wf + g.r * wg;
112 m.g = b.g * wb + f.g * wf + g.g * wg;
113 m.b = b.b * wb + f.b * wf + g.b * wg;
114 }
115}
fl::vector< RGBf > mBufGroove
fl::vector< RGBf > mBufFlow
fl::vector< RGBf > mBufBreath
fl::vector< RGBf > mMix
this frame, summed
InputGamut g
Definition rgbw.h:124
float clampf(float v, float lo, float hi)
Definition ring_canvas.h:19

References mood_ring::RGBf::b, mood_ring::RoomSense::calm, mood_ring::clampf(), mood_ring::RoomSense::flow, mood_ring::RGBf::g, mood_ring::RoomSense::groove, mBufBreath, mBufFlow, mBufGroove, mMix, mood_ring::RGBf::r, and tuning.

Referenced by draw().

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