Cleanup: BLI_math_base.h: Document power_of_2_max|min()

This commit is contained in:
2022-05-18 21:31:10 +02:00
parent fe4ae77ded
commit 790598fa60

View File

@@ -204,14 +204,18 @@ MINLINE int integer_digits_i(int i);
/* These don't really fit anywhere but were being copied about a lot. */
MINLINE int is_power_of_2_i(int n);
MINLINE int power_of_2_max_i(int n);
MINLINE int power_of_2_min_i(int n);
MINLINE unsigned int power_of_2_max_u(unsigned int x);
MINLINE unsigned int power_of_2_min_u(unsigned int x);
MINLINE unsigned int log2_floor_u(unsigned int x);
MINLINE unsigned int log2_ceil_u(unsigned int x);
/**
* Returns next (or previous) power of 2 or the input number if it is already a power of 2.
*/
MINLINE int power_of_2_max_i(int n);
MINLINE int power_of_2_min_i(int n);
MINLINE unsigned int power_of_2_max_u(unsigned int x);
MINLINE unsigned int power_of_2_min_u(unsigned int x);
/**
* Integer division that rounds 0.5 up, particularly useful for color blending
* with integers, to avoid gradual darkening when rounding down.