emacs vars for .inc files
[cinelerra_cv/mob.git] / guicast / clip.h
blobcb822832b31b9c2e62a41b8e0d866f58e874bdd2
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
18 // Local Variables:
19 // mode: C++
20 // c-file-style: "linux"
21 // End: