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