| 27 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
| 28 | |
| 29 | image::RGBfColor getColorFromJetColorMap(float value) |
| 30 | { |
| 31 | if (value <= 0.0f) |
| 32 | return image::RGBfColor(0, 0, 0); |
| 33 | if (value >= 1.0f) |
| 34 | return image::RGBfColor(1.0f, 1.0f, 1.0f); |
| 35 | const float idx_f = value * 63.0f; |
| 36 | float integral; |
| 37 | const float fractB = std::modf(idx_f, &integral); |
| 38 | const float fractA = 1.0f - fractB; |
| 39 | const int idx = static_cast<int>(integral); |
| 40 | image::RGBfColor c; |
| 41 | c.r() = jetr[idx] * fractA + jetr[idx + 1] * fractB; |
| 42 | c.g() = jetg[idx] * fractA + jetg[idx + 1] * fractB; |
| 43 | c.b() = jetb[idx] * fractA + jetb[idx + 1] * fractB; |
| 44 | return c; |
| 45 | } |
| 46 | |
| 47 | rgb getRGBFromJetColorMap(float value) |
| 48 | { |
no test coverage detected