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 library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00018 // MA  02110-1301, USA
00020 #ifndef SHNIBBLES_HPP
00021 #define SHNIBBLES_HPP
00022 
00028 #include "ShBaseTexture.hpp"
00029 #include "ShProgram.hpp"
00030 #include "ShMatrix.hpp"
00031 
00032 namespace SH {
00033 
00038 template<typename T>
00039 ShProgram keep(const std::string & name = ""); 
00040 
00045 template<typename T>
00046 ShProgram dup(const std::string & name = "var"); 
00047 
00052 template<typename T>
00053 ShProgram lose(const std::string & name = "");
00054 
00058 template<typename T> 
00059 ShProgram access(const ShBaseTexture1D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00060 
00064 template<typename T> 
00065 ShProgram access(const ShBaseTexture2D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00066 
00070 template<typename T> 
00071 ShProgram access(const ShBaseTextureRect<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00072 
00076 template<typename T> 
00077 ShProgram access(const ShBaseTexture3D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00078 
00082 template<typename T> 
00083 ShProgram access(const ShBaseTextureCube<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00084 
00091 template<typename T, int Rows, int Cols, ShBindingType Binding, typename T2>
00092 ShProgram transform(const ShMatrix<Rows, Cols, Binding, T2> &m, const std::string & name = "result");
00093 
00102 template<typename T, typename T2>
00103 ShProgram cast(const std::string & name = "result");
00104 
00113 template<typename T, typename T2>
00114 ShProgram fillcast(const std::string & name = "result");
00115 
00120 template<typename T> ShProgram abs(const std::string & name = "result");
00121 template<typename T> ShProgram acos(const std::string & name = "result");
00122 template<typename T> ShProgram asin(const std::string & name = "result");
00123 template<typename T> ShProgram cos(const std::string & name = "result");
00124 template<typename T> ShProgram frac(const std::string & name = "result");
00125 template<typename T> ShProgram sin(const std::string & name = "result");
00126 template<typename T> ShProgram sqrt(const std::string & name = "result");
00127 template<typename T> ShProgram normalize(const std::string & name = "result");
00128 template<typename T> ShProgram pos(const std::string & name = "result");
00130 
00136 #define SHNIBBLE_BINARY_OP_DECL(opname) \
00137   template<typename T1, typename T2> ShProgram opname(const std::string & output_name = "result",\
00138       const std::string & input_name0 = "x", const std::string & input_name1 = "y"); \
00139   template<typename T1> ShProgram opname(const std::string & output_name = "result",\
00140       const std::string & input_name0 = "x", const std::string & input_name1 = "y"); 
00141 SHNIBBLE_BINARY_OP_DECL(add);
00142 SHNIBBLE_BINARY_OP_DECL(sub);
00143 SHNIBBLE_BINARY_OP_DECL(mul);
00144 SHNIBBLE_BINARY_OP_DECL(div);
00145 SHNIBBLE_BINARY_OP_DECL(pow);
00146 SHNIBBLE_BINARY_OP_DECL(slt);
00147 SHNIBBLE_BINARY_OP_DECL(sle);
00148 SHNIBBLE_BINARY_OP_DECL(sgt);
00149 SHNIBBLE_BINARY_OP_DECL(sge);
00150 SHNIBBLE_BINARY_OP_DECL(seq);
00151 SHNIBBLE_BINARY_OP_DECL(sne);
00152 SHNIBBLE_BINARY_OP_DECL(max);
00153 SHNIBBLE_BINARY_OP_DECL(min);
00154 SHNIBBLE_BINARY_OP_DECL(mod);
00155 
00161 template<typename T> ShProgram dot(const std::string & name = "result");
00163 
00170 template<typename T1, typename T2>
00171 ShProgram lerp(const std::string & name = "result");
00172 
00173 template<typename T1>
00174 ShProgram lerp(const std::string & name = "result");
00176 
00177 }
00178 
00179 
00180 #include "ShNibblesImpl.hpp"
00181 
00182 #endif

Generated on Thu Jul 28 17:33:04 2005 for Sh by  doxygen 1.4.3-20050530