| 0.8.2 API documentation

- Main Page
- Namespaces
- Classes
- Files

- File List

sampler1d_array.hpp
Go to the documentation of this file.
1
4 #pragma once
5
6 #include "sampler.hpp"
7 #include "texture1d_array.hpp"
8 #include "core/mipmaps_compute.hpp"
9 #include "core/convert_func.hpp"
10
11 namespace gli
12 {
16 template <typename T, precision P = defaultp>
17 class sampler1d_array : public sampler
18 {
19 private:
20 typedef typename detail::interpolate<T>::type interpolate_type;
21
22 public:
23 typedef texture1d_array texture_type;
24 typedef typename texture_type::size_type size_type;
25 typedef typename texture_type::extent_type extent_type;
26 typedef interpolate_type level_type;
27 typedef tvec1<interpolate_type, P> normalized_type;
28 typedef tvec4<T, P> texel_type;
29
30 sampler1d_array(texture_type const& Texture, wrap Wrap, filter Mip = FILTER_NEAREST, filter Min = FILTER_NEAREST, texel_type const& BorderColor = texel_type(0, 0, 0, 1));
31
33 texture_type const& operator()() const;
34
36 texel_type texel_fetch(extent_type const& TexelCoord, size_type layer, size_type Level) const;
37
39 void texel_write(extent_type const& TexelCoord, size_type layer, size_type Level, texel_type const & Texel);
40
42 void clear(texel_type const& Texel);
43
45 texel_type texture_lod(normalized_type const& SampleCoord, size_type layer, level_type Level) const;
46
48 void generate_mipmaps(filter Minification);
49
51 void generate_mipmaps(size_type BaseLayer, size_type MaxLayer, size_type BaseLevel, size_type MaxLevel, filter Minification);
52
53 private:
54 typedef typename detail::convert<texture_type, T, P>::func convert_type;
55 typedef typename detail::convert<texture_type, T, P>::fetchFunc fetch_type;
56 typedef typename detail::convert<texture_type, T, P>::writeFunc write_type;
57 typedef typename detail::filterBase<detail::DIMENSION_1D, texture_type, interpolate_type, normalized_type, fetch_type, texel_type>::filterFunc filter_type;
58
59 texture_type Texture;
60 convert_type Convert;
61 texel_type BorderColor;
62 filter_type Filter;
63 };
64
65 typedef sampler1d_array<float> fsampler1DArray;
66 typedef sampler1d_array<double> dsampler1DArray;
67 typedef sampler1d_array<unsigned int> usampler1DArray;
68 typedef sampler1d_array<int> isampler1DArray;
69
70 }//namespace gli
71
72 #include "./core/sampler1d_array.inl"
gli::sampler1d_array::clear
void clear(texel_type const &Texel)
Clear the sampler texture with a uniform texel.
sampler.hpp
Include to use wrap modes and the sampler base class.
texture1d_array.hpp
Include to use 1d array textures.
gli::sampler1d_array::operator()
texture_type const & operator()() const
Access the sampler texture object.
gli::sampler1d_array
1d array texture sampler
Definition: sampler1d_array.hpp:17
gli::texture1d_array
1d array texture
Definition: texture1d_array.hpp:11
gli::filter
filter
Texture filtring modes.
Definition: filter.hpp:9
gli::wrap
wrap
Texture coordinate wrapping mode.
Definition: sampler.hpp:11
gli::sampler1d_array::texel_fetch
texel_type texel_fetch(extent_type const &TexelCoord, size_type layer, size_type Level) const
Fetch a texel from the sampler texture.
gli
Namespace where all the classes and functions provided by GLI are exposed.
Definition: clear.hpp:6
gli::sampler1d_array::texture_lod
texel_type texture_lod(normalized_type const &SampleCoord, size_type layer, level_type Level) const
Sample the sampler texture at a specific level.
gli::sampler
Genetic sampler class.
Definition: sampler.hpp:33
gli::sampler1d_array::generate_mipmaps
void generate_mipmaps(filter Minification)
Generate all the mipmaps of the sampler texture from the texture base level.
gli::sampler1d_array::texel_write
void texel_write(extent_type const &TexelCoord, size_type layer, size_type Level, texel_type const &Texel)
Write a texel in the sampler texture.