Example #1
0
  sf::Color getThermalPixelColor(double temp)
  {
    // TTT = fmod(TTT+0.1, 80.0);
    // temp = TTT;

    double scalar = (
        (clamp(temp, thermalSpectrumTempMin, thermalSpectrumTempMax)-thermalSpectrumTempMin)
      * (1.0/(double)(thermalSpectrumTempMax-thermalSpectrumTempMin))
    );
    scalar = weibull(scalar, 0.3, 2.6);
    //std::cout << temp << " = " << scalar << std::endl;
    double hue = thermalSpectrumHueStart+scalar*(thermalSpectrumHueEnd-thermalSpectrumHueStart);
    double sat = 1.0;
    double val = 1.0;
    if(temp < thermalSpectrumTempMin) {
      val = (
          clamp(temp, thermalSpectrumTempAbsMin, thermalSpectrumTempMin)
        * (1.0/(double)(thermalSpectrumTempMin-thermalSpectrumTempAbsMin))
      );
    }
    return hsv(hue, sat, val);
  }
Example #2
0
T& Random< T, G, I, F >::weibull(T &t, F a, F b) {
  return const_cast< T& >(weibull(const_cast< const T& >(t), a, b));
}