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:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user