plastimatch
Loading...
Searching...
No Matches
Macros
clamp.h File Reference

Go to the source code of this file.

Macros

#define CLAMP(value, min_value, max_value)
 
#define CLAMP2(v1, v2, min_value, max_value)
 

Macro Definition Documentation

◆ CLAMP

#define CLAMP (   value,
  min_value,
  max_value 
)
Value:
do { \
} else if (value > max_value) { \
} \
} while (0)
Definition pointset.h:15

◆ CLAMP2

#define CLAMP2 (   v1,
  v2,
  min_value,
  max_value 
)
Value:
do { \
if (v1 < min_value) { \
} \
if (v2 > max_value) { \
} \
if (v2 < v1) { \
v2 = v1; \
} \
} while (0)