diff options
| author | Yannick Verschueren <unknown@unknown> | 2004-02-13 09:38:52 +0000 |
|---|---|---|
| committer | Yannick Verschueren <unknown@unknown> | 2004-02-13 09:38:52 +0000 |
| commit | 4be829988a6423a4ca9582e0ec6948837b529a1b (patch) | |
| tree | 05f5173c5c91dd3cdad38308083c7e0464c8cc1c /libopenjpeg/int.h | |
| parent | 28283c60ea2188fdf560aeab34835c5fef06599c (diff) | |
Update for version 0.8
Diffstat (limited to 'libopenjpeg/int.h')
| -rw-r--r-- | libopenjpeg/int.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/libopenjpeg/int.h b/libopenjpeg/int.h index 7b6fb875..a1b590dd 100644 --- a/libopenjpeg/int.h +++ b/libopenjpeg/int.h @@ -27,13 +27,60 @@ #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 |
