Move MTFParam

This commit is contained in:
2025-02-25 17:35:55 +01:00
parent d069ce3302
commit e4b9fefa5a
4 changed files with 14 additions and 8 deletions
+1 -1
View File
@@ -359,7 +359,7 @@ void swPaint(std::shared_ptr<RawImage> &rawImage, float dx, float dy, float scal
auto mtf = [&mtfParams](int i, float x)
{
x = (x - mtfParams.blackPoint[i]) / (mtfParams.whitePoint[i] - mtfParams.blackPoint[i]);
x = std::min(std::max(x, 0.0f), 1.0f);
x = std::clamp(x, 0.0f, 1.0f);
return ((mtfParams.midPoint[i] - 1.0f) * x) / ((2.0f * mtfParams.midPoint[i] - 1.0f) * x - mtfParams.midPoint[i]);
};