computes the contrast sensitivity function (Barten SPIE 1989) given the cycles per degree (cpd) and luminance (lum)
| 103 | // computes the contrast sensitivity function (Barten SPIE 1989) |
| 104 | // given the cycles per degree (cpd) and luminance (lum) |
| 105 | static float csf(const float cpd, const float lum) |
| 106 | { |
| 107 | const auto a = 440.f * powf((1.f + 0.7f / lum), -0.2f); |
| 108 | const auto b = 0.3f * powf((1.0f + 100.0f / lum), 0.15f); |
| 109 | |
| 110 | return a * cpd * expf(-b * cpd) * sqrtf(1.0f + 0.06f * expf(b * cpd)); |
| 111 | } |
| 112 | |
| 113 | |
| 114 | /* |