GLI  0.5.0
texture2d.hpp
Go to the documentation of this file.
1 
29 #ifndef GLI_CORE_TEXTURE2D_INCLUDED
30 #define GLI_CORE_TEXTURE2D_INCLUDED
31 
32 #include "image.hpp"
33 
34 namespace gli
35 {
36  class texture2DArray;
37  class textureCube;
38  class textureCubeArray;
39 
41  class texture2D
42  {
43  public:
48 
49  public:
50  texture2D();
51 
53  explicit texture2D(
54  size_type const & Levels,
55  format_type const & Format,
56  dimensions_type const & Dimensions);
57 
59  explicit texture2D(
60  format_type const & Format,
61  dimensions_type const & Dimensions);
62 
64  explicit texture2D(
65  storage const & Storage);
66 
68  explicit texture2D(
69  storage const & Storage,
70  format_type const & Format,
71  size_type BaseLayer,
72  size_type MaxLayer,
73  size_type BaseFace,
74  size_type MaxFace,
75  size_type BaseLevel,
76  size_type MaxLevel);
77 
79  explicit texture2D(
80  texture2D const & Texture,
81  size_type const & BaseLevel,
82  size_type const & MaxLevel);
83 
85  explicit texture2D(
86  texture2DArray const & Texture,
87  size_type const & BaseLayer,
88  size_type const & BaseLevel,
89  size_type const & MaxLevel);
90 
92  explicit texture2D(
93  textureCube const & Texture,
94  size_type const & BaseFace,
95  size_type const & BaseLevel,
96  size_type const & MaxLevel);
97 
99  explicit texture2D(
100  textureCubeArray const & Texture,
101  size_type const & BaseLayer,
102  size_type const & BaseFace,
103  size_type const & BaseLevel,
104  size_type const & MaxLevel);
105 
106  operator storage() const;
107  image operator[] (size_type const & Level) const;
108 
109  bool empty() const;
110  format_type format() const;
111  dimensions_type dimensions() const;
112  size_type layers() const;
113  size_type faces() const;
114  size_type levels() const;
115 
116  size_type size() const;
117  void * data();
118  void const * data() const;
119 
120  template <typename genType>
121  size_type size() const;
122  template <typename genType>
123  genType * data();
124  template <typename genType>
125  genType const * data() const;
126 
127  void clear();
128  template <typename genType>
129  void clear(genType const & Texel);
130 
131  size_type baseLayer() const;
132  size_type maxLayer() const;
133  size_type baseFace() const;
134  size_type maxFace() const;
135  size_type baseLevel() const;
136  size_type maxLevel() const;
137 
138  private:
139  storage Storage;
140  size_type BaseLayer;
141  size_type MaxLayer;
142  size_type BaseFace;
143  size_type MaxFace;
144  size_type BaseLevel;
145  size_type MaxLevel;
146  format_type Format;
147  };
148 }//namespace gli
149 
150 #endif//GLI_CORE_TEXTURE2D_INCLUDED
size_type maxLevel() const
gli::format format_type
Definition: texture2d.hpp:47
glm::uvec2 dimensions2_type
Definition: storage.hpp:60
Image.
Definition: image.hpp:42
image operator[](size_type const &Level) const
size_type levels() const
size_type layers() const
size_type maxFace() const
size_type baseFace() const
size_type baseLayer() const
texture2D
Definition: texture2d.hpp:41
bool empty() const
OpenGL Image (gli.g-truc.net)
size_type size() const
dimensions_type dimensions() const
std::size_t size_type
Definition: storage.hpp:68
storage::dimensions2_type dimensions_type
Definition: texture2d.hpp:44
format_type format() const
storage::texcoord2_type texcoord_type
Definition: texture2d.hpp:45
storage::size_type size_type
Definition: texture2d.hpp:46
size_type maxLayer() const
glm::vec2 texcoord2_type
Definition: storage.hpp:65
size_type baseLevel() const
size_type faces() const
format
Definition: format.hpp:34