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

Generated on Mon Jan 24 18:36:35 2005 for Sh by  doxygen 1.4.1