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

ShNibbles.hpp

Go to the documentation of this file.
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 SHNIBBLES_HPP 00028 #define SHNIBBLES_HPP 00029 00035 #include "ShBaseTexture.hpp" 00036 #include "ShProgram.hpp" 00037 #include "ShMatrix.hpp" 00038 00039 namespace SH { 00040 00045 template<typename T> 00046 ShProgram keep(const std::string & name = ""); 00047 00052 template<typename T> 00053 ShProgram dup(const std::string & name = "var"); 00054 00059 template<typename T> 00060 ShProgram lose(const std::string & name = ""); 00061 00065 template<typename T> 00066 ShProgram access(const ShBaseTexture1D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result"); 00067 00071 template<typename T> 00072 ShProgram access(const ShBaseTexture2D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result"); 00073 00077 template<typename T> 00078 ShProgram access(const ShBaseTextureRect<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result"); 00079 00083 template<typename T> 00084 ShProgram access(const ShBaseTexture3D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result"); 00085 00089 template<typename T> 00090 ShProgram access(const ShBaseTextureCube<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result"); 00091 00098 template<typename T2, int Rows, int Cols, ShBindingType Binding, typename T> 00099 ShProgram transform(const ShMatrix<Rows, Cols, Binding, T> &m, const std::string & name = "result"); 00100 00109 template<typename T, typename T2> 00110 ShProgram cast(const std::string & name = "result"); 00111 00120 template<typename T, typename T2> 00121 ShProgram fillcast(const std::string & name = "result"); 00122 00127 template<typename T> ShProgram abs(const std::string & name = "result"); 00128 template<typename T> ShProgram acos(const std::string & name = "result"); 00129 template<typename T> ShProgram asin(const std::string & name = "result"); 00130 template<typename T> ShProgram cos(const std::string & name = "result"); 00131 template<typename T> ShProgram frac(const std::string & name = "result"); 00132 template<typename T> ShProgram sin(const std::string & name = "result"); 00133 template<typename T> ShProgram sqrt(const std::string & name = "result"); 00134 template<typename T> ShProgram normalize(const std::string & name = "result"); 00135 template<typename T> ShProgram pos(const std::string & name = "result"); 00137 00143 #define SHNIBBLE_BINARY_OP_DECL(opname) \ 00144 template<typename T1, typename T2> ShProgram opname(const std::string & output_name = "result",\ 00145 const std::string & input_name0 = "x", const std::string & input_name1 = "y"); \ 00146 template<typename T1> ShProgram opname(const std::string & output_name = "result",\ 00147 const std::string & input_name0 = "x", const std::string & input_name1 = "y"); 00148 SHNIBBLE_BINARY_OP_DECL(add); 00149 SHNIBBLE_BINARY_OP_DECL(sub); 00150 SHNIBBLE_BINARY_OP_DECL(mul); 00151 SHNIBBLE_BINARY_OP_DECL(div); 00152 SHNIBBLE_BINARY_OP_DECL(pow); 00153 SHNIBBLE_BINARY_OP_DECL(slt); 00154 SHNIBBLE_BINARY_OP_DECL(sle); 00155 SHNIBBLE_BINARY_OP_DECL(sgt); 00156 SHNIBBLE_BINARY_OP_DECL(sge); 00157 SHNIBBLE_BINARY_OP_DECL(seq); 00158 SHNIBBLE_BINARY_OP_DECL(sne); 00159 SHNIBBLE_BINARY_OP_DECL(max); 00160 SHNIBBLE_BINARY_OP_DECL(min); 00161 SHNIBBLE_BINARY_OP_DECL(mod); 00162 00168 template<typename T> ShProgram dot(const std::string & name = "result"); 00170 00177 template<typename T1, typename T2> 00178 ShProgram lerp(const std::string & name = "result"); 00179 00180 template<typename T1> 00181 ShProgram lerp(const std::string & name = "result"); 00183 00184 } 00185 00186 00187 #include "ShNibblesImpl.hpp" 00188 00189 #endif

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