GLI  0.5.0
addressing.hpp
Go to the documentation of this file.
1 
29 #ifndef GLI_CORE_ADDRESSING_INCLUDED
30 #define GLI_CORE_ADDRESSING_INCLUDED
31 
32 #include "storage.hpp"
33 
34 namespace gli{
35 namespace detail
36 {
38  storage const & Storage,
39  storage::size_type const & LayerOffset,
40  storage::size_type const & FaceOffset,
41  storage::size_type const & LevelOffset);
42 
44  storage::dimensions1_type const & TexCoord);
45 
47  storage::dimensions2_type const & TexCoord);
48 
50  storage::dimensions3_type const & TexCoord);
51 
53  storage::dimensions1_type const & TexCoord);
54 
56  storage::dimensions2_type const & TexCoord);
57 
59  storage::dimensions3_type const & TexCoord);
60 
61 }//namespace detail
62 /*
63  template <typename texture>
64  class sampler
65  {
66  enum wrap
67  {
68  MIRROR,
69  CLAMP_TO_EDGE
70  };
71 
72  enum filter
73  {
74  NEAREST,
75  LINEAR,
76  CUBIC
77  };
78 
79  public:
80  sampler(texture const & Texture)
81  {
82  switch(Texture.format())
83  {
84  default:
85  break;
86  case RGB_DXT1:
87  Impl.reset(new impl_fetch_dxt1());
88  break;
89  }
90  }
91 
92  template <typename genType>
93  genType operator() (texture::dimension_type const & Dimensions) const
94 
95  private:
96  struct impl
97  {
98  virtual ~impl(){}
99 
100  template <typename genType>
101  virtual genType operator() (texture::dimension_type const & Dimensions) const = 0;
102  };
103 
104  class impl_fetch_color : public impl
105  {
106  public:
107  impl_fetch_color(){}
108 
109  template <typename genType>
110  virtual genType operator() (
111  texture const & Texture,
112  texture::texcoord_type const & Texcoord) const;
113 
114  private:
115 
116  };
117 
118  class impl_fetch_dxt1 : public impl
119  {
120  public:
121  impl_fetch_dxt1(){}
122 
123  template <typename genType>
124  virtual genType operator() (texture::dimension_type const & Dimensions) const;
125 
126  private:
127 
128  };
129 
130  shared_ptr<impl> Impl;
131  };
132 */
133 }//namespace gli
134 
135 #include "addressing.inl"
136 
137 #endif//GLI_CORE_ADDRESSING_INCLUDED
storage::size_type texelMortonAdressing1D(storage::dimensions1_type const &TexCoord)
glm::uint dimensions1_type
Definition: storage.hpp:59
glm::uvec2 dimensions2_type
Definition: storage.hpp:60
storage::size_type texelMortonAdressing3D(storage::dimensions3_type const &TexCoord)
storage::size_type texelMortonAdressing2D(storage::dimensions2_type const &TexCoord)
storage::size_type texelLinearAdressing3D(storage::dimensions3_type const &TexCoord)
std::size_t size_type
Definition: storage.hpp:68
storage::size_type imageAddressing(storage const &Storage, storage::size_type const &LayerOffset, storage::size_type const &FaceOffset, storage::size_type const &LevelOffset)
OpenGL Image (gli.g-truc.net)
glm::uvec3 dimensions3_type
Definition: storage.hpp:61
storage::size_type texelLinearAdressing2D(storage::dimensions2_type const &TexCoord)
storage::size_type texelLinearAdressing1D(storage::dimensions1_type const &TexCoord)