Modifications in handling of JP2 files to increase modularity of JP2.c
[openjpeg.git] / libopenjpeg / int.h
index 7b6fb875e65ce056d6570d02a108cd4ba4f8d505..a1b590dd98a65ac4819b8348acd621ba9df19703 100644 (file)
 #ifndef __INT_H
 #define __INT_H
 
+/*
+ * Get the minimum of two integers.
+ *
+ * returns a if a < b else b
+ */
 int int_min(int a, int b);
+
+/*
+ * Get the maximum of two integers.
+ *
+ * returns a if a > b else b
+ */
 int int_max(int a, int b);
+
+/*
+ * Clamp an integer inside an interval.
+ *
+ * return a if (min < a < max)
+ * return max if (a > max)
+ * return min if (a < min) 
+ */
 int int_clamp(int a, int min, int max);
+
+/*
+ * Get absolute value of integer.
+ */
 int int_abs(int a);
+
+/*
+ * Divide an integer and round upwards.
+ *
+ * a divided by b
+ */
 int int_ceildiv(int a, int b);
+
+/*
+ * Divide an integer by a power of 2 and round upwards.
+ *
+ * a divided by 2^b
+ */
 int int_ceildivpow2(int a, int b);
+
+/*
+ * Divide an integer by a power of 2 and round downwards.
+ *
+ * a divided by 2^b
+ */
 int int_floordivpow2(int a, int b);
+
+/*
+ * Get logarithm of an integer and round downwards.
+ *
+ * log2(a)
+ */
 int int_floorlog2(int a);
 
 #endif