MCPcopy Create free account
hub / github.com/alicevision/AliceVision / getColorFromJetColorMap

Function getColorFromJetColorMap

src/aliceVision/image/jetColorMap.cpp:29–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
28
29image::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
47rgb getRGBFromJetColorMap(float value)
48{

Callers 2

getRGBFromJetColorMapFunction · 0.85
aliceVision_mainFunction · 0.85

Calls 2

gMethod · 0.80
bMethod · 0.80

Tested by

no test coverage detected