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

ShArray.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 SHARRAY_HPP
00028 #define SHARRAY_HPP
00029 
00030 #include "ShBaseTexture.hpp"
00031 
00032 namespace SH {
00033 
00037 struct
00038 ShArrayTraits : public ShTextureTraits {
00039   ShArrayTraits()
00040     : ShTextureTraits(0, SH_FILTER_NONE, SH_WRAP_CLAMP_TO_EDGE, SH_CLAMPED)
00041   {
00042   }
00043 };
00044 
00045 template<typename T> class ShArrayRect;
00046 
00049 template<typename T>
00050 class ShArray1D
00051   : public ShBaseTexture1D<T> {
00052 public:
00053   ShArray1D()
00054     : ShBaseTexture1D<T>(ShArrayTraits())
00055   {}
00056   ShArray1D(int width)
00057     : ShBaseTexture1D<T>(width, ShArrayTraits())
00058   {}
00059         typedef ShArrayRect<T> rectangular_type;
00060         typedef ShBaseTexture1D<T> base_type;
00061   typedef T return_type;
00062 };
00063 
00066 template<typename T>
00067 class ShArray2D
00068   : public ShBaseTexture2D<T> {
00069 public:
00070   ShArray2D()
00071     : ShBaseTexture2D<T>(ShArrayTraits())
00072   {}
00073   ShArray2D(int width, int height)
00074     : ShBaseTexture2D<T>(width, height, ShArrayTraits())
00075   {}
00076         typedef ShArrayRect<T> rectangular_type;
00077         typedef ShBaseTexture2D<T> base_type;
00078   typedef T return_type;
00079 };
00080 
00083 template<typename T>
00084 class ShArrayRect
00085   : public ShBaseTextureRect<T> {
00086 public:
00087   ShArrayRect()
00088     : ShBaseTextureRect<T>(ShArrayTraits())
00089   {}
00090   ShArrayRect(int width, int height)
00091     : ShBaseTextureRect<T>(width, height, ShArrayTraits())
00092   {}
00093         typedef ShArrayRect<T> rectangular_type;
00094         typedef ShBaseTextureRect<T> base_type;
00095   typedef T return_type;
00096 };
00097 
00100 template<typename T>
00101 class ShArray3D
00102   : public ShBaseTexture3D<T> {
00103 public:
00104   ShArray3D()
00105     : ShBaseTexture3D<T>(ShArrayTraits())
00106   {}
00107   ShArray3D(int width, int height, int depth)
00108     : ShBaseTexture3D<T>(width, height, depth, ShArrayTraits())
00109   {}
00110         typedef ShArrayRect<T> rectangular_type;
00111         typedef ShBaseTexture3D<T> base_type;
00112   typedef T return_type;
00113 };
00114 
00119 template<typename T>
00120 class ShArrayCube
00121   : public ShBaseTextureCube<T> {
00122 public:
00123   ShArrayCube()
00124     : ShBaseTextureCube<T>(ShArrayTraits())
00125   {}
00126   ShArrayCube(int width, int height)
00127     : ShBaseTextureCube<T>(width, height, ShArrayTraits())
00128   {}
00129         typedef ShArrayRect<T> rectangular_type;
00130         typedef ShBaseTextureCube<T> base_type;
00131   typedef T return_type;
00132 };
00133 
00134 }
00135 
00136 #endif

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