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

ShTable.hpp

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 SHTABLE_HPP
00021 #define SHTABLE_HPP
00022 
00023 #include "ShBaseTexture.hpp"
00024 
00025 namespace SH {
00026 
00027 struct
00028 ShTableTraits : public ShTextureTraits {
00029   ShTableTraits()
00030     : ShTextureTraits(1, SH_FILTER_NONE, SH_WRAP_CLAMP_TO_EDGE)
00031   {
00032   }
00033 };
00034 
00035 template<typename T> class ShTableRect;
00036 
00037 template<typename T>
00038 class ShTable1D
00039   : public ShBaseTexture1D<T> {
00040 public:
00041   ShTable1D()
00042     : ShBaseTexture1D<T>(ShTableTraits())
00043   {}
00044   ShTable1D(int width)
00045     : ShBaseTexture1D<T>(width, ShTableTraits())
00046   {}
00047   typedef ShTableRect<T> rectangular_type;
00048   typedef ShBaseTexture1D<T> base_type;
00049   typedef T return_type;
00050 };
00051 
00052 template<typename T>
00053 class ShTable2D
00054   : public ShBaseTexture2D<T> {
00055 public:
00056   ShTable2D()
00057     : ShBaseTexture2D<T>(ShTableTraits())
00058   {}
00059   ShTable2D(int width, int height)
00060     : ShBaseTexture2D<T>(width, height, ShTableTraits())
00061   {}
00062   typedef ShTableRect<T> rectangular_type;
00063   typedef ShBaseTexture2D<T> base_type;
00064   typedef T return_type;
00065 };
00066 
00067 template<typename T>
00068 class ShTableRect
00069   : public ShBaseTextureRect<T> {
00070 public:
00071   ShTableRect()
00072     : ShBaseTextureRect<T>(ShTableTraits())
00073   {}
00074   ShTableRect(int width, int height)
00075     : ShBaseTextureRect<T>(width, height, ShTableTraits())
00076   {}
00077   typedef ShTableRect<T> rectangular_type;
00078   typedef ShBaseTextureRect<T> base_type;
00079   typedef T return_type;
00080 };
00081 
00082 template<typename T>
00083 class ShTable3D
00084   : public ShBaseTexture3D<T> {
00085 public:
00086   ShTable3D()
00087     : ShBaseTexture3D<T>(ShTableTraits())
00088   {}
00089   ShTable3D(int width, int height, int depth)
00090     : ShBaseTexture3D<T>(width, height, depth, ShTableTraits())
00091   {}
00092   typedef ShTableRect<T> rectangular_type;
00093   typedef ShBaseTexture3D<T> base_type;
00094   typedef T return_type;
00095 };
00096 
00097 template<typename T>
00098 class ShTableCube
00099   : public ShBaseTextureCube<T> {
00100 public:
00101   ShTableCube()
00102     : ShBaseTextureCube<T>(ShTableTraits())
00103   {}
00104   ShTableCube(int width, int height)
00105     : ShBaseTextureCube<T>(width, height, ShTableTraits())
00106   {}
00107   typedef ShTableRect<T> rectangular_type;
00108   typedef ShBaseTextureCube<T> base_type;
00109   typedef T return_type;
00110 };
00111 
00112 }
00113 
00114 #endif

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