Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | 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 2003-2005 Serious Hack Inc.
00004 // 
00005 // This software is provided 'as-is', without any express or implied
00006 // warranty. In no event will the authors be held liable for any damages
00007 // arising from the use of this software.
00008 // 
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it
00011 // freely, subject to the following restrictions:
00012 // 
00013 // 1. The origin of this software must not be misrepresented; you must
00014 // not claim that you wrote the original software. If you use this
00015 // software in a product, an acknowledgment in the product documentation
00016 // would be appreciated but is not required.
00017 // 
00018 // 2. Altered source versions must be plainly marked as such, and must
00019 // not be misrepresented as being the original software.
00020 // 
00021 // 3. This notice may not be removed or altered from any source
00022 // distribution.
00024 #ifndef SHNIBBLES_HPP
00025 #define SHNIBBLES_HPP
00026 
00032 #include "ShBaseTexture.hpp"
00033 #include "ShProgram.hpp"
00034 #include "ShMatrix.hpp"
00035 
00036 namespace SH {
00037 
00042 template<typename T>
00043 ShProgram keep(const std::string & name = ""); 
00044 
00049 template<typename T>
00050 ShProgram dup(const std::string & name = "var"); 
00051 
00056 template<typename T>
00057 ShProgram lose(const std::string & name = "");
00058 
00062 template<typename T> 
00063 ShProgram access(const ShBaseTexture1D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00064 
00068 template<typename T> 
00069 ShProgram access(const ShBaseTexture2D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00070 
00074 template<typename T> 
00075 ShProgram access(const ShBaseTextureRect<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00076 
00080 template<typename T> 
00081 ShProgram access(const ShBaseTexture3D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00082 
00086 template<typename T> 
00087 ShProgram access(const ShBaseTextureCube<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00088 
00095 template<typename T, int Rows, int Cols, ShBindingType Binding, typename T2>
00096 ShProgram transform(const ShMatrix<Rows, Cols, Binding, T2> &m, const std::string & name = "result");
00097 
00106 template<typename T, typename T2>
00107 ShProgram cast(const std::string & name = "result");
00108 
00117 template<typename T, typename T2>
00118 ShProgram fillcast(const std::string & name = "result");
00119 
00124 template<typename T> ShProgram abs(const std::string & name = "result");
00125 template<typename T> ShProgram acos(const std::string & name = "result");
00126 template<typename T> ShProgram asin(const std::string & name = "result");
00127 template<typename T> ShProgram cos(const std::string & name = "result");
00128 template<typename T> ShProgram frac(const std::string & name = "result");
00129 template<typename T> ShProgram sin(const std::string & name = "result");
00130 template<typename T> ShProgram sqrt(const std::string & name = "result");
00131 template<typename T> ShProgram normalize(const std::string & name = "result");
00132 template<typename T> ShProgram pos(const std::string & name = "result");
00134 
00140 #define SHNIBBLE_BINARY_OP_DECL(opname) \
00141   template<typename T1, typename T2> ShProgram opname(const std::string & output_name = "result",\
00142       const std::string & input_name0 = "x", const std::string & input_name1 = "y"); \
00143   template<typename T1> ShProgram opname(const std::string & output_name = "result",\
00144       const std::string & input_name0 = "x", const std::string & input_name1 = "y"); 
00145 SHNIBBLE_BINARY_OP_DECL(add);
00146 SHNIBBLE_BINARY_OP_DECL(sub);
00147 SHNIBBLE_BINARY_OP_DECL(mul);
00148 SHNIBBLE_BINARY_OP_DECL(div);
00149 SHNIBBLE_BINARY_OP_DECL(pow);
00150 SHNIBBLE_BINARY_OP_DECL(slt);
00151 SHNIBBLE_BINARY_OP_DECL(sle);
00152 SHNIBBLE_BINARY_OP_DECL(sgt);
00153 SHNIBBLE_BINARY_OP_DECL(sge);
00154 SHNIBBLE_BINARY_OP_DECL(seq);
00155 SHNIBBLE_BINARY_OP_DECL(sne);
00156 SHNIBBLE_BINARY_OP_DECL(max);
00157 SHNIBBLE_BINARY_OP_DECL(min);
00158 SHNIBBLE_BINARY_OP_DECL(mod);
00159 
00165 template<typename T> ShProgram dot(const std::string & name = "result");
00167 
00174 template<typename T1, typename T2>
00175 ShProgram lerp(const std::string & name = "result");
00176 
00177 template<typename T1>
00178 ShProgram lerp(const std::string & name = "result");
00180 
00181 }
00182 
00183 
00184 #include "ShNibblesImpl.hpp"
00185 
00186 #endif

Generated on Wed Jun 15 18:12:40 2005 for Sh by  doxygen 1.4.3-20050530