about summary refs log tree commit diff
path: root/editor/pnmhisteq.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-01-20 19:22:55 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-01-20 19:22:55 +0000
commit6d06b8e0c26536edaedf04ae56849667b85c1325 (patch)
tree2fc0bcebd14321d895b479c8a465a6ab69888e68 /editor/pnmhisteq.c
parent16b223f52bfbbc2eef71496ffd434dccadb35579 (diff)
downloadnetpbm-mirror-6d06b8e0c26536edaedf04ae56849667b85c1325.tar.gz
netpbm-mirror-6d06b8e0c26536edaedf04ae56849667b85c1325.tar.xz
netpbm-mirror-6d06b8e0c26536edaedf04ae56849667b85c1325.zip
Fix handling of floating point imprecision in unnormalizing samples
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3513 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor/pnmhisteq.c')
-rw-r--r--editor/pnmhisteq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/pnmhisteq.c b/editor/pnmhisteq.c
index 76fd6d2a..a339f73f 100644
--- a/editor/pnmhisteq.c
+++ b/editor/pnmhisteq.c
@@ -426,7 +426,7 @@ remapRgbValue(xel          const thisXel,
     struct hsv const hsv =
         ppm_hsv_from_color(thisXel, maxval);
     xelval const oldValue =
-        MIN(maxval, ROUNDU(hsv.v * maxval));
+        MIN(maxval, pnm_unnormalize(hsv.v, maxval));
     xelval const newValue =
         lumamap[oldValue];