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 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 SHARRAY_HPP
00021 #define SHARRAY_HPP
00022 
00023 #include "ShBaseTexture.hpp"
00024 
00025 namespace SH {
00026 
00030 struct
00031 ShArrayTraits : public ShTextureTraits {
00032   ShArrayTraits()
00033     : ShTextureTraits(0, SH_FILTER_NONE, SH_WRAP_CLAMP_TO_EDGE)
00034   {}
00035 };
00036 
00037 template<typename T> class ShArrayRect;
00038 
00041 template<typename T>
00042 class ShArray1D
00043   : public ShBaseTexture1D<T> {
00044 public:
00045   ShArray1D()
00046     : ShBaseTexture1D<T>(ShArrayTraits())
00047   {}
00048   ShArray1D(int width)
00049     : ShBaseTexture1D<T>(width, ShArrayTraits())
00050   {}
00051   typedef ShArrayRect<T> rectangular_type;
00052   typedef ShBaseTexture1D<T> base_type;
00053   typedef T return_type;
00054 };
00055 
00058 template<typename T>
00059 class ShArray2D
00060   : public ShBaseTexture2D<T> {
00061 public:
00062   ShArray2D()
00063     : ShBaseTexture2D<T>(ShArrayTraits())
00064   {}
00065   ShArray2D(int width, int height)
00066     : ShBaseTexture2D<T>(width, height, ShArrayTraits())
00067   {}
00068   typedef ShArrayRect<T> rectangular_type;
00069   typedef ShBaseTexture2D<T> base_type;
00070   typedef T return_type;
00071 };
00072 
00075 template<typename T>
00076 class ShArrayRect
00077   : public ShBaseTextureRect<T> {
00078 public:
00079   ShArrayRect()
00080     : ShBaseTextureRect<T>(ShArrayTraits())
00081   {}
00082   ShArrayRect(int width, int height)
00083     : ShBaseTextureRect<T>(width, height, ShArrayTraits())
00084   {}
00085   typedef ShArrayRect<T> rectangular_type;
00086   typedef ShBaseTextureRect<T> base_type;
00087   typedef T return_type;
00088 };
00089 
00092 template<typename T>
00093 class ShArray3D
00094   : public ShBaseTexture3D<T> {
00095 public:
00096   ShArray3D()
00097     : ShBaseTexture3D<T>(ShArrayTraits())
00098   {}
00099   ShArray3D(int width, int height, int depth)
00100     : ShBaseTexture3D<T>(width, height, depth, ShArrayTraits())
00101   {}
00102   typedef ShArrayRect<T> rectangular_type;
00103   typedef ShBaseTexture3D<T> base_type;
00104   typedef T return_type;
00105 };
00106 
00111 template<typename T>
00112 class ShArrayCube
00113   : public ShBaseTextureCube<T> {
00114 public:
00115   ShArrayCube()
00116     : ShBaseTextureCube<T>(ShArrayTraits())
00117   {}
00118   ShArrayCube(int width, int height)
00119     : ShBaseTextureCube<T>(width, height, ShArrayTraits())
00120   {}
00121   typedef ShArrayRect<T> rectangular_type;
00122   typedef ShBaseTextureCube<T> base_type;
00123   typedef T return_type;
00124 };
00125 
00126 }
00127 
00128 #endif

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