stlab.adobe.com Adobe Systems Incorporated
pin.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 /*************************************************************************************************/
7 
8 #ifndef ADOBE_ALGORITHM_PIN_HPP
9 #define ADOBE_ALGORITHM_PIN_HPP
10 
11 #include <adobe/config.hpp>
12 
13 #if ADOBE_IS_DEPRECATED_ERROR(100039)
14 #error "deprecated adobe/algorithm/pin.hpp use adobe/algorithm/clamp.hpp instead."
15 #endif
16 
18 
19 /*************************************************************************************************/
20 
21 namespace adobe {
22 
23 /*************************************************************************************************/
46 /*************************************************************************************************/
52 template <typename T, typename R>
53 inline const T& pin(const T& min, const T& x, const T& max, R r)
54 { return clamp(x, min, max, r); }
55 
56 /*************************************************************************************************/
62 template <typename T>
63 inline const T& pin(const T& min, const T& x, const T& max)
64 { return clamp(x, min, max); }
65 
66 
67 /****************************************************************************************************/
73 template <typename T, typename R>
74 const T& pin_safe(const T& min, const T& x, const T& max, R r)
75 { return clamp_unordered(x, min, max, r); }
76 
77 /****************************************************************************************************/
83 template <typename T, typename R>
84 const T& pin_safe(const T& min, const T& x, const T& max)
85 { return clamp_unordered(x, min, max); }
86 
87 /*************************************************************************************************/
88 
89 } // namespace adobe
90 
91 /*************************************************************************************************/
92 
93 #endif
94 
95 /*************************************************************************************************/
const T & clamp_unordered(const T &x, const T &min, const T &max, R r)
clamp_unordered implementation
Definition: clamp.hpp:69
const T &() max(const T &a, const T &b)
minmax implementation
Definition: minmax.hpp:86
const T & pin(const T &min, const T &x, const T &max, R r)
pin implementation
Definition: pin.hpp:53
const T &() min(const T &a, const T &b)
minmax implementation
Definition: minmax.hpp:66
const T & clamp(const T &x, const T &min, const T &max, R r)
clamp implementation
Definition: clamp.hpp:46
const T & pin_safe(const T &min, const T &x, const T &max, R r)
pin_safe implementation
Definition: pin.hpp:74

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google