Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ShLibClamp.hpp

00001 // Sh: A GPU metaprogramming language. 00002 // 00003 // Copyright (c) 2003 University of Waterloo Computer Graphics Laboratory 00004 // Project administrator: Michael D. McCool 00005 // Authors: Zheng Qin, Stefanus Du Toit, Kevin Moule, Tiberiu S. Popa, 00006 // Michael D. McCool 00007 // 00008 // This software is provided 'as-is', without any express or implied 00009 // warranty. In no event will the authors be held liable for any damages 00010 // arising from the use of this software. 00011 // 00012 // Permission is granted to anyone to use this software for any purpose, 00013 // including commercial applications, and to alter it and redistribute it 00014 // freely, subject to the following restrictions: 00015 // 00016 // 1. The origin of this software must not be misrepresented; you must 00017 // not claim that you wrote the original software. If you use this 00018 // software in a product, an acknowledgment in the product documentation 00019 // would be appreciated but is not required. 00020 // 00021 // 2. Altered source versions must be plainly marked as such, and must 00022 // not be misrepresented as being the original software. 00023 // 00024 // 3. This notice may not be removed or altered from any source 00025 // distribution. 00027 #ifndef SHLIBCLAMP_HPP 00028 #define SHLIBCLAMP_HPP 00029 00030 #include "ShGeneric.hpp" 00031 #include "ShLib.hpp" 00032 00033 namespace SH { 00034 00035 00048 template<int N, typename T> 00049 ShGeneric<N, T> abs(const ShGeneric<N, T>& var); 00050 00055 template<int N, typename T> 00056 ShGeneric<N, T> ceil(const ShGeneric<N, T>& var); 00057 00062 template<int N, typename T> 00063 ShGeneric<N, T> floor(const ShGeneric<N, T>& var); 00064 00069 template<int N, typename T> 00070 ShGeneric<N, T> round(const ShGeneric<N, T>& var); 00071 00075 template<int N, typename T> 00076 ShGeneric<N, T> mod(const ShGeneric<N, T>& left, const ShGeneric<N, T>& right); 00077 template<int N, typename T> 00078 ShGeneric<N, T> mod(const ShGeneric<N, T>& left, const ShGeneric<1, T>& right); 00079 template<typename T> 00080 ShGeneric<1, T> mod(const ShGeneric<1, T>& left, const ShGeneric<1, T>& right); 00081 template<int N, typename T> 00082 ShGeneric<N, T> operator%(const ShGeneric<N, T>& left, const ShGeneric<N, T>& right); 00083 template<int N, typename T> 00084 ShGeneric<N, T> operator%(const ShGeneric<N, T>& left, const ShGeneric<1, T>& right); 00085 template<typename T> 00086 ShGeneric<1, T> operator%(const ShGeneric<1, T>& left, const ShGeneric<1, T>& right); 00087 00088 SH_SHLIB_CONST_SCALAR_OP(mod); 00089 SH_SHLIB_CONST_N_OP_LEFT(mod); 00090 SH_SHLIB_CONST_SCALAR_OP(operator%); 00091 SH_SHLIB_CONST_N_OP_LEFT(operator%); 00092 00096 template<int N, typename T> 00097 ShGeneric<N, T> frac(const ShGeneric<N, T>& var); 00098 00103 template<int N, typename T> 00104 ShGeneric<N, T> pos(const ShGeneric<N, T>& x); 00105 00109 template<int N, typename T> 00110 ShGeneric<N, T> max(const ShGeneric<N, T>& left, const ShGeneric<N, T>& right); 00111 00112 SH_SHLIB_CONST_SCALAR_OP(max); 00113 00117 template<int N, typename T> 00118 ShGeneric<N, T> min(const ShGeneric<N, T>& left, const ShGeneric<N, T>& right); 00119 00120 SH_SHLIB_CONST_SCALAR_OP(min); 00121 00124 template<int N, typename T> 00125 ShGeneric<1, T> max(const ShGeneric<N, T>& a); 00126 00129 template<int N, typename T> 00130 ShGeneric<1, T> min(const ShGeneric<N, T>& a); 00131 00135 template<int N, typename T> 00136 ShGeneric<N, T> clamp(const ShGeneric<N, T>& a, 00137 const ShGeneric<N, T>& b, const ShGeneric<N, T>& c); 00138 template<int N, typename T> 00139 ShGeneric<N, T> clamp(const ShGeneric<N, T>& a, 00140 const ShGeneric<1, T>& b, const ShGeneric<1, T>& c); 00141 template<typename T> 00142 ShGeneric<1, T> clamp(const ShGeneric<1, T>& a, 00143 const ShGeneric<1, T>& b, const ShGeneric<1, T>& c); 00144 00145 SH_SHLIB_CONST_TRINARY_OP_011(clamp); 00146 00150 template<int N, typename T> 00151 ShGeneric<N, T> sat(const ShGeneric<N, T>& a); 00152 00158 template<int N, typename T> 00159 ShGeneric<N, T> sign(const ShGeneric<N, T>& var); 00160 00163 } 00164 00165 #include "ShLibClampImpl.hpp" 00166 00167 #endif

Generated on Mon Oct 18 14:17:39 2004 for Sh by doxygen 1.3.7