about summary refs log tree commit diff
path: root/lib/pgm.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pgm.h')
-rw-r--r--lib/pgm.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/pgm.h b/lib/pgm.h
index 81e86cfb..d4655239 100644
--- a/lib/pgm.h
+++ b/lib/pgm.h
@@ -42,6 +42,8 @@ typedef unsigned int gray;
 #define PGM_OVERALLMAXVAL 65535
 #define PGM_MAXMAXVAL 255
 
+#define pgm_unnormalize(value, maxval) \
+  ((gray)((value + 1e-6) * (maxval) + 0.5))
 
 /* Magic constants. */