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

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