11 template <
typename T, precision P>
12 inline size_t linear_index(tvec1<T, P>
const & Coord, tvec1<T, P>
const & Dimensions)
14 GLI_ASSERT(glm::all(glm::lessThan(Coord, Dimensions)));
15 return static_cast<size_t>(Coord.x);
19 template <
typename T, precision P>
20 inline size_t linear_index(tvec2<T, P>
const & Coord, tvec2<T, P>
const & Dimensions)
22 GLI_ASSERT(glm::all(glm::lessThan(Coord, Dimensions)));
23 return static_cast<size_t>(Coord.x + Coord.y * Dimensions.x);
27 template <
typename T, precision P>
28 inline size_t linear_index(tvec3<T, P>
const & Coord, tvec3<T, P>
const & Dimensions)
30 GLI_ASSERT(glm::all(glm::lessThan(Coord, Dimensions)));
31 return static_cast<size_t>(Coord.x + Coord.y * Dimensions.x + Coord.z * Dimensions.x * Dimensions.y);
Namespace where all the classes and functions provided by GLI are exposed.
Include to use basic GLI types.
size_t linear_index(tvec1< T, P > const &Coord, tvec1< T, P > const &Dimensions)
Compute an offset from the beginning of a storage to a specific texel stored in linear order...