plastimatch
Toggle main menu visibility
Main Page
Namespaces
Namespace List
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
c
i
o
p
s
Enumerations
Enumerator
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
u
v
w
x
z
Variables
Typedefs
a
b
c
d
e
f
h
i
j
l
m
o
p
q
r
s
t
u
v
x
Enumerations
Enumerator
a
b
e
f
i
m
n
p
r
s
x
z
Macros
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
u
w
x
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Loading...
Searching...
No Matches
src
base
clamp.h
Go to the documentation of this file.
1
/* -----------------------------------------------------------------------
2
See COPYRIGHT.TXT and LICENSE.TXT for copyright and license information
3
----------------------------------------------------------------------- */
4
#ifndef _clamp_h_
5
#define _clamp_h_
6
7
#define CLAMP(value, min_value, max_value) \
8
do { \
9
if (value < min_value) { \
10
value = min_value; \
11
} else if (value > max_value) { \
12
value = max_value; \
13
} \
14
} while (0)
7
#define CLAMP(value, min_value, max_value) \
…
15
16
#define CLAMP2(v1, v2, min_value, max_value) \
17
do { \
18
if (v1 < min_value) { \
19
v1 = min_value; \
20
} \
21
if (v2 > max_value) { \
22
v2 = max_value; \
23
} \
24
if (v2 < v1) { \
25
v2 = v1; \
26
} \
27
} while (0)
16
#define CLAMP2(v1, v2, min_value, max_value) \
…
28
29
#endif
Generated on Tue Mar 25 2025 20:02:27 for plastimatch by
1.12.0