00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00027 #ifndef SHLIBCLAMP_HPP
00028 #define SHLIBCLAMP_HPP
00029
00030 #include "ShGeneric.hpp"
00031 #include "ShLib.hpp"
00032
00033 #ifndef WIN32
00034 namespace SH {
00035
00036
00049 template<int N, typename T>
00050 ShGeneric<N, T> abs(const ShGeneric<N, T>& var);
00051
00056 template<int N, typename T>
00057 ShGeneric<N, T> ceil(const ShGeneric<N, T>& var);
00058
00063 template<int N, typename T>
00064 ShGeneric<N, T> floor(const ShGeneric<N, T>& var);
00065
00070 template<int N, typename T>
00071 ShGeneric<N, T> round(const ShGeneric<N, T>& var);
00072
00076 template<int N, typename T1, typename T2>
00077 ShGeneric<N, CT1T2>
00078 mod(const ShGeneric<N, T1>& left, const ShGeneric<N, T2>& right);
00079 template<int N, typename T1, typename T2>
00080 ShGeneric<N, CT1T2>
00081 mod(const ShGeneric<N, T1>& left, const ShGeneric<1, T2>& right);
00082 template<typename T1, typename T2>
00083 ShGeneric<1, CT1T2>
00084 mod(const ShGeneric<1, T1>& left, const ShGeneric<1, T2>& right);
00085 template<int N, typename T1, typename T2>
00086 ShGeneric<N, CT1T2>
00087 operator%(const ShGeneric<N, T1>& left, const ShGeneric<N, T2>& right);
00088 template<int N, typename T1, typename T2>
00089 ShGeneric<N, CT1T2>
00090 operator%(const ShGeneric<N, T1>& left, const ShGeneric<1, T2>& right);
00091 template<typename T1, typename T2>
00092 ShGeneric<1, CT1T2>
00093 operator%(const ShGeneric<1, T1>& left, const ShGeneric<1, T2>& right);
00094
00095 SH_SHLIB_CONST_SCALAR_OP_DECL(mod);
00096 SH_SHLIB_CONST_N_OP_LEFT_DECL(mod);
00097 SH_SHLIB_CONST_SCALAR_OP_DECL(operator%);
00098 SH_SHLIB_CONST_N_OP_LEFT_DECL(operator%);
00099
00103 template<int N, typename T>
00104 ShGeneric<N, T> frac(const ShGeneric<N, T>& var);
00105
00110 template<int N, typename T>
00111 ShGeneric<N, T> pos(const ShGeneric<N, T>& x);
00112
00116 template<int N, typename T1, typename T2>
00117 ShGeneric<N, CT1T2>
00118 max(const ShGeneric<N, T1>& left, const ShGeneric<N, T2>& right);
00119
00120 SH_SHLIB_CONST_SCALAR_OP_DECL(max);
00121
00125 template<int N, typename T1, typename T2>
00126 ShGeneric<N, CT1T2>
00127 min(const ShGeneric<N, T1>& left, const ShGeneric<N, T2>& right);
00128
00129 SH_SHLIB_CONST_SCALAR_OP_DECL(min);
00130
00133 template<int N, typename T>
00134 ShGeneric<1, T> max(const ShGeneric<N, T>& a);
00135
00138 template<int N, typename T>
00139 ShGeneric<1, T> min(const ShGeneric<N, T>& a);
00140
00144 template<int N, typename T1, typename T2, typename T3>
00145 ShGeneric<N, CT1T2T3>
00146 clamp(const ShGeneric<N, T1>& a, const ShGeneric<N, T2>& b, const ShGeneric<N, T3>& c);
00147 template<int N, typename T1, typename T2, typename T3>
00148 ShGeneric<N, CT1T2T3>
00149 clamp(const ShGeneric<N, T1>& a, const ShGeneric<1, T2>& b, const ShGeneric<1, T3>& c);
00150 template<typename T1, typename T2, typename T3>
00151 ShGeneric<1, CT1T2T3>
00152 clamp(const ShGeneric<1, T1>& a, const ShGeneric<1, T2>& b, const ShGeneric<1, T3>& c);
00153
00154 SH_SHLIB_CONST_TRINARY_OP_011_DECL(clamp);
00155
00159 template<int N, typename T>
00160 ShGeneric<N, T> sat(const ShGeneric<N, T>& a);
00161
00167 template<int N, typename T>
00168 ShGeneric<N, T> sign(const ShGeneric<N, T>& var);
00169
00172 }
00173 #endif
00174
00175 #include "ShLibClampImpl.hpp"
00176
00177 #endif