about summary refs log tree commit diff
path: root/editor/pnmgamma.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-06-24 01:22:11 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2022-06-24 01:22:11 +0000
commit28eaa12a89ac9b151233805689aff671a366ce93 (patch)
treedcecabdd86fcbb391db8b25775c7d8107d855e11 /editor/pnmgamma.c
parenta17c4bdf8ec41645c05a65e09bf9121d4edc7ffd (diff)
downloadnetpbm-mirror-28eaa12a89ac9b151233805689aff671a366ce93.tar.gz
netpbm-mirror-28eaa12a89ac9b151233805689aff671a366ce93.tar.xz
netpbm-mirror-28eaa12a89ac9b151233805689aff671a366ce93.zip
Release 10.73.40
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@4354 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor/pnmgamma.c')
-rw-r--r--editor/pnmgamma.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/pnmgamma.c b/editor/pnmgamma.c
index b357b0d8..0ed217d1 100644
--- a/editor/pnmgamma.c
+++ b/editor/pnmgamma.c
@@ -516,7 +516,7 @@ buildBt709ToSrgbGamma(xelval       table[],
         if (radiance < linearCutoffSrgb * normalizer)
             srgb = radiance * linearExpansionSrgb;
         else
-            srgb = 1.055 * pow(normalized, oneOverGammaSrgb) - 0.055;
+            srgb = 1.055 * pow(radiance, oneOverGammaSrgb) - 0.055;
 
         assert(srgb <= 1.0);
 
@@ -567,14 +567,14 @@ buildSrgbToBt709Gamma(xelval       table[],
         if (i < linearCutoffSrgb / linearCompressionSrgb)
             radiance = normalized * linearCompressionSrgb;
         else
-            radiance = pow((normalized + 0.099) / 1.099, gammaSrgb);
+            radiance = pow((normalized + 0.055) / 1.055, gammaSrgb);
 
         assert(radiance <= 1.0);
 
         if (radiance < linearCutoff709 * normalizer)
             bt709 = radiance * linearExpansion709;
         else
-            bt709 = 1.055 * pow(normalized, oneOverGamma709) - 0.055;
+            bt709 = 1.099 * pow(radiance, oneOverGamma709) - 0.099;
 
         assert(bt709 <= 1.0);