Skip to content

Commit

Permalink
[rgbCurve] Remove unused gamma function
Browse files Browse the repository at this point in the history
  • Loading branch information
demoulinv committed Aug 24, 2023
1 parent 68bf0a0 commit f940664
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 51 deletions.
47 changes: 0 additions & 47 deletions src/aliceVision/hdr/rgbCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,53 +268,6 @@ void rgbCurve::setAllAbsolute()
}
}

inline float gammaFunction(float value, float gamma)
{
// 1/0.45 = 2.22
if (value < 0.018)
{
return 4.5 * value;
}
else
{
return 1.099 * std::pow(value, 0.45) - 0.099;
}
}

inline float inverseGammaFunction(float value, float gamma)
{
if (value <= 0.0812f)
{
return value / 4.5f;
}
else
{
return pow((value + 0.099f) / 1.099f, gamma);
}
}

void rgbCurve::applyGamma(float gamma)
{
for (auto &curve : _data)
{
for (auto &value : curve)
{
value = gammaFunction(value, gamma);
}
}
}

void rgbCurve::applyGammaInv(float gamma)
{
for (auto &curve : _data)
{
for (auto &value : curve)
{
value = inverseGammaFunction(value, gamma);
}
}
}

void rgbCurve::normalize()
{
for(auto &curve : _data)
Expand Down
4 changes: 0 additions & 4 deletions src/aliceVision/hdr/rgbCurve.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@ class rgbCurve
*/
void setAllAbsolute();

void applyGamma(float gamma = 2.2);

void applyGammaInv(float gamma = 2.2);

/**
* @brief normalize the curve
*/
Expand Down

0 comments on commit f940664

Please sign in to comment.