Added new color toning method "L*a*b* regions"

Allows to specify various "regions" of the image with masks, and to correct
for hue, saturation and lightness.

Inspired by the existing L*a*b* grid (in turn taken from darktable)
This commit is contained in:
Alberto Griggio
2018-10-25 16:46:11 +02:00
parent eee6837385
commit 1a3fd9f157
18 changed files with 854 additions and 32 deletions

View File

@@ -220,5 +220,21 @@ std::array<T, 3> dotProduct(const std::array<std::array<T, 3>, 3> &a, const std:
return res;
}
template <typename T>
T lin2log(T x, T base)
{
constexpr T one(1);
return std::log(x * (base - one) + one) / std::log(base);
}
template <typename T>
T log2lin(T x, T base)
{
constexpr T one(1);
return (std::pow(base, x) - one) / (base - one);
}
}