r956: README.BUILD - add more library recommendations
[cinelerra_cv/ct.git] / guicast / clip.h
blobbaf317f95e2e620a7c0ebbc519670271a5299574
1 #ifndef CLIP_H
2 #define CLIP_H
4 // Math macros
6 #define CLIP(x, y, z) ((x) < (y) ? (y) : ((x) > (z) ? (z) : (x)))
7 #define RECLIP(x, y, z) ((x) = ((x) < (y) ? (y) : ((x) > (z) ? (z) : (x))))
8 #define CLAMP(x, y, z) ((x) = ((x) < (y) ? (y) : ((x) > (z) ? (z) : (x))))
9 #define MAX(x, y) ((x) > (y) ? (x) : (y))
10 #define MIN(x, y) ((x) < (y) ? (x) : (y))
11 #define EQUIV(x, y) (fabs((x) - (y)) < 0.001)
12 #define DISTANCE(x1, y1, x2, y2) \
13 (sqrt(((x2) - (x1)) * ((x2) - (x1)) + ((y2) - (y1)) * ((y2) - (y1))))
16 #endif