StelToneReproducer.cpp   StelToneReproducer.cpp 
skipping to change at line 39 skipping to change at line 39
/********************************************************************* /*********************************************************************
Constructor: Set some default values to prevent bugs in case of bad use Constructor: Set some default values to prevent bugs in case of bad use
*********************************************************************/ *********************************************************************/
StelToneReproducer::StelToneReproducer() : Lda(50.f), Lwa(40000.f), oneOver MaxdL(1.f/100.f), lnOneOverMaxdL(std::log(1.f/100.f)), oneOverGamma(1.f/2.2 222f) StelToneReproducer::StelToneReproducer() : Lda(50.f), Lwa(40000.f), oneOver MaxdL(1.f/100.f), lnOneOverMaxdL(std::log(1.f/100.f)), oneOverGamma(1.f/2.2 222f)
{ {
// Initialize sensor // Initialize sensor
setInputScale(); setInputScale();
// Update alphaDa and betaDa values // Update alphaDa and betaDa values
float log10Lwa = std::log10(Lwa); float log10Lwa = std::log10(Lwa);
alphaWa = 0.4f * log10Lwa + 1.519f; alphaWa = 0.4f * log10Lwa + 1.619f;
betaWa = -0.4f * log10Lwa*log10Lwa + 0.218f * log10Lwa + 6.1642f; betaWa = -0.4f * log10Lwa*log10Lwa + 0.218f * log10Lwa + 6.1642f;
setDisplayAdaptationLuminance(Lda); setDisplayAdaptationLuminance(Lda);
setWorldAdaptationLuminance(Lwa); setWorldAdaptationLuminance(Lwa);
} }
/********************************************************************* /*********************************************************************
Destructor Destructor
*********************************************************************/ *********************************************************************/
StelToneReproducer::~StelToneReproducer() StelToneReproducer::~StelToneReproducer()
skipping to change at line 71 skipping to change at line 71
/********************************************************************* /*********************************************************************
Set the eye adaptation luminance for the display (and precompute what can be) Set the eye adaptation luminance for the display (and precompute what can be)
*********************************************************************/ *********************************************************************/
void StelToneReproducer::setDisplayAdaptationLuminance(float _Lda) void StelToneReproducer::setDisplayAdaptationLuminance(float _Lda)
{ {
Lda = _Lda; Lda = _Lda;
// Update alphaDa and betaDa values // Update alphaDa and betaDa values
float log10Lda = std::log10(Lda); float log10Lda = std::log10(Lda);
alphaDa = 0.4f * log10Lda + 1.519f; alphaDa = 0.4f * log10Lda + 1.619f;
betaDa = -0.4f * log10Lda*log10Lda + 0.218f * log10Lda + 6.1642f; betaDa = -0.4f * log10Lda*log10Lda + 0.218f * log10Lda + 6.1642f;
// Update terms // Update terms
alphaWaOverAlphaDa = alphaWa/alphaDa; alphaWaOverAlphaDa = alphaWa/alphaDa;
term2 = pow10((betaWa-betaDa)/alphaDa) / (M_PI*0.0001f); term2 = pow10((betaWa-betaDa)/alphaDa) / (M_PI*0.0001f);
lnTerm2 = std::log(term2); lnTerm2 = std::log(term2);
term2TimesOneOverMaxdLpOneOverGamma = std::pow(term2*oneOverMaxdL, o neOverGamma); term2TimesOneOverMaxdLpOneOverGamma = std::pow(term2*oneOverMaxdL, o neOverGamma);
} }
/********************************************************************* /*********************************************************************
Set the eye adaptation luminance for the world (and precompute what can be ) Set the eye adaptation luminance for the world (and precompute what can be )
*********************************************************************/ *********************************************************************/
void StelToneReproducer::setWorldAdaptationLuminance(float _Lwa) void StelToneReproducer::setWorldAdaptationLuminance(float _Lwa)
{ {
Lwa = _Lwa; Lwa = _Lwa;
// Update alphaDa and betaDa values // Update alphaDa and betaDa values
float log10Lwa = std::log10(Lwa); float log10Lwa = std::log10(Lwa);
alphaWa = 0.4f * log10Lwa + 1.519f; alphaWa = 0.4f * log10Lwa + 1.619f;
betaWa = -0.4f * log10Lwa*log10Lwa + 0.218f * log10Lwa + 6.1642f; betaWa = -0.4f * log10Lwa*log10Lwa + 0.218f * log10Lwa + 6.1642f;
// Update terms // Update terms
alphaWaOverAlphaDa = alphaWa/alphaDa; alphaWaOverAlphaDa = alphaWa/alphaDa;
term2 = pow10((betaWa-betaDa)/alphaDa) / (M_PI*0.0001f); term2 = pow10((betaWa-betaDa)/alphaDa) / (M_PI*0.0001f);
lnTerm2 = std::log(term2); lnTerm2 = std::log(term2);
term2TimesOneOverMaxdLpOneOverGamma = std::pow(term2*oneOverMaxdL, o neOverGamma); term2TimesOneOverMaxdLpOneOverGamma = std::pow(term2*oneOverMaxdL, o neOverGamma);
} }
/********************************************************************* /*********************************************************************
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/