Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | 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 #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

Generated on Mon Jan 24 18:36:32 2005 for Sh by  doxygen 1.4.1