| 18 | } |
| 19 | |
| 20 | float MixSelector::get(int x, int y) const { |
| 21 | auto f = clamp(m_mixSource->get(x, y), -1.0f, 1.0f); |
| 22 | if (f == -1) |
| 23 | return m_aSource->get(x, y); |
| 24 | if (f == 1) |
| 25 | return m_bSource->get(x, y); |
| 26 | return lerp(f * 0.5f + 0.5f, m_aSource->get(x, y), m_bSource->get(x, y)); |
| 27 | } |
| 28 | |
| 29 | } |
no test coverage detected