GLI  0.6.0
texture2d.hpp
Go to the documentation of this file.
1 
29 #pragma once
30 
31 #include "image.hpp"
32 
33 namespace gli
34 {
35  class texture2DArray;
36  class textureCube;
37  class textureCubeArray;
38 
40  class texture2D
41  {
42  public:
50 
51  public:
52  texture2D();
53 
55  explicit texture2D(
56  size_type const & Levels,
57  format_type const & Format,
58  dim_type const & Dimensions);
59 
61  explicit texture2D(
62  format_type const & Format,
63  dim_type const & Dimensions);
64 
66  explicit texture2D(
67  storage const & Storage);
68 
70  explicit texture2D(
71  storage const & Storage,
72  format_type const & Format,
73  size_type BaseLayer,
74  size_type MaxLayer,
75  size_type BaseFace,
76  size_type MaxFace,
77  size_type BaseLevel,
78  size_type MaxLevel);
79 
81  explicit texture2D(
82  texture2D const & Texture,
83  size_type const & BaseLevel,
84  size_type const & MaxLevel);
85 
87  explicit texture2D(
88  texture2DArray const & Texture,
89  size_type const & BaseLayer,
90  size_type const & BaseLevel,
91  size_type const & MaxLevel);
92 
94  explicit texture2D(
95  textureCube const & Texture,
96  size_type const & BaseFace,
97  size_type const & BaseLevel,
98  size_type const & MaxLevel);
99 
101  explicit texture2D(
102  textureCubeArray const & Texture,
103  size_type const & BaseLayer, size_type const & BaseFace,
104  size_type const & BaseLevel, 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  dim_type dimensions() const;
112  size_type layers() const;
113  size_type faces() const;
114  size_type levels() const;
115  glm::ivec4 swizzle() const;
116 
117  size_type size() const;
118  void * data();
119  void const * data() const;
120 
121  template <typename genType>
122  size_type size() const;
123  template <typename genType>
124  genType * data();
125  template <typename genType>
126  genType const * data() const;
127 
128  void clear();
129  template <typename genType>
130  void clear(genType const & Texel);
131  template <typename genType>
132  genType fetch(dim_type const & TexelCoord, size_type const & Level);
133 
134  size_type baseLayer() const;
135  size_type maxLayer() const;
136  size_type baseFace() const;
137  size_type maxFace() const;
138  size_type baseLevel() const;
139  size_type maxLevel() const;
140 
141  private:
142  storage Storage;
143  size_type BaseLayer;
144  size_type MaxLayer;
145  size_type BaseFace;
146  size_type MaxFace;
147  size_type BaseLevel;
148  size_type MaxLevel;
149  format_type Format;
150  };
151 }//namespace gli
152 
153 
size_type maxLevel() const
size_t size_type
Definition: storage.hpp:68
genType fetch(dim_type const &TexelCoord, size_type const &Level)
dim_type dimensions() const
image operator[](size_type const &Level) const
size_type levels() const
size_type layers() const
size_type maxFace() const
texcoord2_t texcoord2_type
Definition: storage.hpp:65
storage::format_type format_type
Definition: texture2d.hpp:46
size_type baseFace() const
size_type baseLayer() const
texture2D
Definition: texture2d.hpp:40
storage::size_type level_type
Definition: texture2d.hpp:48
bool empty() const
OpenGL Image (gli.g-truc.net)
size_type size() const
storage::size_type face_type
Definition: texture2d.hpp:49
Image.
Definition: image.hpp:41
format_type format() const
glm::ivec4 swizzle() const
storage::dim2_type dim_type
Definition: texture2d.hpp:43
storage::texcoord2_type texcoord_type
Definition: texture2d.hpp:44
storage::size_type size_type
Definition: texture2d.hpp:45
size_type maxLayer() const
storage::size_type layer_type
Definition: texture2d.hpp:47
dim2_t dim2_type
Definition: storage.hpp:60
size_type baseLevel() const
size_type faces() const
format
Definition: format.hpp:33