0.8.0 API documentation
sampler.hpp
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include <gli/filter.hpp>
7 
8 namespace gli
9 {
11  enum wrap
12  {
13  WRAP_CLAMP_TO_EDGE, WRAP_FIRST = WRAP_CLAMP_TO_EDGE,
14  WRAP_CLAMP_TO_BORDER,
15  WRAP_REPEAT,
16  WRAP_MIRROR_REPEAT,
17  WRAP_MIRROR_CLAMP_TO_EDGE,
18  WRAP_MIRROR_CLAMP_TO_BORDER, WRAP_LAST = WRAP_MIRROR_CLAMP_TO_BORDER
19  };
20 
21  enum
22  {
23  WRAP_COUNT = WRAP_LAST - WRAP_FIRST + 1
24  };
25 
27  inline bool is_border(wrap Wrap)
28  {
29  return Wrap == WRAP_CLAMP_TO_BORDER || Wrap == WRAP_MIRROR_CLAMP_TO_BORDER;
30  }
31 
33  class sampler
34  {
35  public:
36  sampler(wrap Wrap, filter Mip, filter Min);
37 
38  protected:
39  typedef float(*wrap_type)(float const & SamplerCoord);
40 
41  wrap_type getFunc(wrap WrapMode) const;
42 
43  wrap_type Wrap;
44  filter Mip;
45  filter Min;
46  };
47 }//namespace gli
48 
49 #include "./core/sampler.inl"
Namespace where all the classes and functions provided by GLI are exposed.
Definition: comparison.hpp:15
Include to use filter enum, to select filtering methods.
filter
Texture filtring modes.
Definition: filter.hpp:18
Genetic sampler class.
Definition: sampler.hpp:33
bool is_border(wrap Wrap)
Evaluate whether the texture coordinate wrapping mode relies on border color.
Definition: sampler.hpp:27
wrap
Texture coordinate wrapping mode.
Definition: sampler.hpp:11