15 typedef size_t size_type;
18 typedef gli::swizzles swizzles_type;
19 typedef storage::data_type data_type;
20 typedef storage::extent_type extent_type;
36 extent_type
const& Extent,
40 swizzles_type
const& Swizzles = swizzles_type(SWIZZLE_RED, SWIZZLE_GREEN, SWIZZLE_BLUE, SWIZZLE_ALPHA));
51 size_type BaseLayer, size_type MaxLayer,
52 size_type BaseFace, size_type MaxFace,
53 size_type BaseLevel, size_type MaxLevel,
54 swizzles_type
const& Swizzles = swizzles_type(SWIZZLE_RED, SWIZZLE_GREEN, SWIZZLE_BLUE, SWIZZLE_ALPHA));
63 swizzles_type
const& Swizzles = swizzles_type(SWIZZLE_RED, SWIZZLE_GREEN, SWIZZLE_BLUE, SWIZZLE_ALPHA));
71 target_type
target()
const{
return this->Target;}
74 format_type
format()
const;
76 swizzles_type swizzles()
const;
94 size_type
faces()
const;
106 extent_type
extent(size_type Level = 0)
const;
109 size_type
size()
const;
113 template <
typename genType>
114 size_type
size()
const;
117 size_type
size(size_type Level)
const;
121 template <
typename genType>
122 size_type
size(size_type Level)
const;
128 template <
typename genType>
132 void const*
data()
const;
135 template <
typename genType>
136 genType
const*
data()
const;
139 void*
data(size_type Layer, size_type Face, size_type Level);
142 void const*
data(size_type Layer, size_type Face, size_type Level)
const;
145 template <
typename genType>
146 genType*
data(size_type Layer, size_type Face, size_type Level);
149 template <
typename genType>
150 genType
const*
data(size_type Layer, size_type Face, size_type Level)
const;
157 template <
typename genType>
158 void clear(genType
const & Texel);
161 template <
typename genType>
162 void clear(size_type Layer, size_type Face, size_type Level, genType
const & Texel);
165 template <
typename genType>
166 void swizzle(gli::swizzles
const & Swizzles);
170 size_type
base_offset(size_type Layer, size_type Face, size_type Level)
const;
178 std::shared_ptr<storage> Storage;
179 target_type
const Target;
180 format_type
const Format;
181 size_type
const BaseLayer;
182 size_type
const MaxLayer;
183 size_type
const BaseFace;
184 size_type
const MaxFace;
185 size_type
const BaseLevel;
186 size_type
const MaxLevel;
187 swizzles_type
const Swizzles;
196 #include "./core/texture.inl"
format_type format() const
Return the texture instance format.
Genetic texture class. It can support any target.
Namespace where all the classes and functions provided by GLI are exposed.
Include to use the target enum and query properties of targets.
size_type layers() const
Return max_layer() - base_layer() + 1.
target
Texture target: type/shape of the texture storage.
size_type size() const
Return the memory size of a texture instance storage in bytes.
void swizzle(gli::swizzles const &Swizzles)
Reorder the component in texture memory.
size_type base_face() const
Return the base face of the texture instance, effectively a memory offset in the actual texture stora...
size_type faces() const
Return max_face() - base_face() + 1.
size_type levels() const
Return max_level() - base_level() + 1.
extent_type extent(size_type Level=0) const
Return the size of a texture instance: width, height and depth.
target_type target() const
Return the target of a texture instance.
void clear()
Clear the entire texture storage with zeros.
format
Texture data format.
size_type base_offset(size_type Layer, size_type Face, size_type Level) const
Compute the relative memory offset to access the data for a specific layer, face and level...
size_type base_layer() const
Return the base layer of the texture instance, effectively a memory offset in the actual texture stor...
size_type base_level() const
Return the base level of the texture instance, effectively a memory offset in the actual texture stor...
bool empty() const
Return whether the texture instance is empty, no storage or description have been assigned to the ins...
Include to use images, a representation of a single texture level.
size_type max_layer() const
Return the max layer of the texture instance, effectively a memory offset to the beginning of the las...
size_type max_face() const
Return the max face of the texture instance, effectively a memory offset to the beginning of the last...
texture()
Create an empty texture instance.
size_type max_level() const
Return the max level of the texture instance, effectively a memory offset to the beginning of the las...
void * data()
Return a pointer to the beginning of the texture instance data.