0.8.1 API documentation
Classes | Enumerations | Functions
gli Namespace Reference

Namespace where all the classes and functions provided by GLI are exposed. More...

Classes

class  dx
 Translation class to convert GLI enums into DirectX enums. More...
 
class  gl
 Translation class to convert GLI enums into OpenGL values. More...
 
class  image
 Image, representation for a single texture level. More...
 
class  sampler
 Genetic sampler class. More...
 
class  sampler1d
 1d texture sampler More...
 
class  sampler1d_array
 1d array texture sampler More...
 
class  sampler2d
 2d texture sampler More...
 
class  sampler2d_array
 2d array texture sampler More...
 
class  sampler3d
 3d texture sampler More...
 
class  sampler_cube
 Cube map texture sampler. More...
 
class  sampler_cube_array
 Cube map array texture sampler. More...
 
class  texture
 Genetic texture class. It can support any target. More...
 
class  texture1d
 1d texture More...
 
class  texture1d_array
 1d array texture More...
 
class  texture2d
 2d texture More...
 
class  texture2d_array
 2d array texture More...
 
class  texture3d
 3d texture More...
 
class  texture_cube
 Cube map texture. More...
 
class  texture_cube_array
 Cube map array texture. More...
 

Enumerations

enum  filter
 Texture filtring modes.
 
enum  format
 Texture data format.
 
enum  swizzle
 Represent the source of a channel.
 
enum  target
 Texture target: type/shape of the texture storage_linear.
 
enum  wrap
 Texture coordinate wrapping mode.
 

Functions

ivec3 block_extent (format Format)
 Return the dimensions in texels of the block for a format.
 
size_t block_size (format Format)
 Return the size in bytes of a block for a format.
 
template<typename texture_type >
void clear (texture_type &Texture)
 Clear a complete texture.
 
template<typename texture_type , typename gen_type >
void clear (texture_type &Texture, gen_type const &BlockData)
 Clear a complete texture.
 
template<typename texture_type , typename gen_type >
void clear (texture_type &Texture, size_t Layer, size_t Face, size_t Level, gen_type const &BlockData)
 Clear a specific image of a texture.
 
size_t component_count (format Format)
 Return the number of components of a format.
 
template<typename texture_type >
texture_type convert (texture_type const &Texture, format Format)
 Convert texture data to a new format. More...
 
template<typename texture_src_type , typename texture_dst_type >
void copy (texture_src_type const &TextureSrc, size_t LayerSrc, size_t FaceSrc, size_t LevelSrc, texture_dst_type &TextureDst, size_t LayerDst, size_t FaceDst, size_t LevelDst)
 Copy a specific image of a texture.
 
template<typename texture_src_type , typename texture_dst_type >
void copy (texture_src_type const &TextureSrc, texture_dst_type &TextureDst)
 Copy a texture.
 
image duplicate (image const &Image)
 Duplicate an image and create a new image with a new storage_linear allocation.
 
template<typename texType >
texture duplicate (texType const &Texture)
 Duplicate a texture and create a new texture with a new storage_linear allocation.
 
template<typename texType >
texture duplicate (texType const &Texture, format Format)
 Duplicate a texture and create a new texture with a new storage_linear allocation but a different format. More...
 
texture duplicate (texture1d const &Texture, texture1d::size_type BaseLevel, texture1d::size_type MaxLevel)
 Duplicate a subset of a texture and create a new texture with a new storage_linear allocation.
 
texture duplicate (texture1d_array const &Texture, texture1d_array::size_type BaseLayer, texture1d_array::size_type MaxLayer, texture1d_array::size_type BaseLevel, texture1d_array::size_type MaxLevel)
 Duplicate a subset of a texture and create a new texture with a new storage_linear allocation.
 
texture duplicate (texture2d const &Texture, texture2d::size_type BaseLevel, texture2d::size_type MaxLevel)
 Duplicate a subset of a texture and create a new texture with a new storage_linear allocation.
 
texture duplicate (texture2d_array const &Texture, texture2d_array::size_type BaseLayer, texture2d_array::size_type MaxLayer, texture2d_array::size_type BaseLevel, texture2d_array::size_type MaxLevel)
 Duplicate a subset of a texture and create a new texture with a new storage_linear allocation.
 
texture duplicate (texture3d const &Texture, texture3d::size_type BaseLevel, texture3d::size_type MaxLevel)
 Duplicate a subset of a texture and create a new texture with a new storage_linear allocation.
 
texture duplicate (texture_cube const &Texture, texture_cube::size_type BaseFace, texture_cube::size_type MaxFace, texture_cube::size_type BaseLevel, texture_cube::size_type MaxLevel)
 Duplicate a subset of a texture and create a new texture with a new storage_linear allocation.
 
texture duplicate (texture_cube_array const &Texture, texture_cube_array::size_type BaseLayer, texture_cube_array::size_type MaxLayer, texture_cube_array::size_type BaseFace, texture_cube_array::size_type MaxFace, texture_cube_array::size_type BaseLevel, texture_cube_array::size_type MaxLevel)
 Duplicate a subset of a texture and create a new texture with a new storage_linear allocation.
 
template<typename texture_type >
texture_type generate_mipmaps (texture_type const &Texture, filter Minification)
 Allocate a texture and generate all the mipmaps of the texture using the Minification filter.
 
texture1d generate_mipmaps (texture1d const &Texture, texture1d::size_type BaseLevel, texture1d::size_type MaxLevel, filter Minification)
 Allocate a texture and generate the mipmaps of the texture from the BaseLevel to the MaxLevel included using the Minification filter.
 
texture1d_array generate_mipmaps (texture1d_array const &Texture, texture1d_array::size_type BaseLayer, texture1d_array::size_type MaxLayer, texture1d_array::size_type BaseLevel, texture1d_array::size_type MaxLevel, filter Minification)
 Allocate a texture and generate the mipmaps of the texture from the BaseLayer to the MaxLayer and from the BaseLevel to the MaxLevel included levels using the Minification filter.
 
texture2d generate_mipmaps (texture2d const &Texture, texture2d::size_type BaseLevel, texture2d::size_type MaxLevel, filter Minification)
 Allocate a texture and generate the mipmaps of the texture from the BaseLevel to the MaxLevel included using the Minification filter.
 
texture2d_array generate_mipmaps (texture2d_array const &Texture, texture2d_array::size_type BaseLayer, texture2d_array::size_type MaxLayer, texture2d_array::size_type BaseLevel, texture2d_array::size_type MaxLevel, filter Minification)
 Allocate a texture and generate the mipmaps of the texture from the BaseLayer to the MaxLayer and from the BaseLevel to the MaxLevel included levels using the Minification filter.
 
texture3d generate_mipmaps (texture3d const &Texture, texture3d::size_type BaseLevel, texture3d::size_type MaxLevel, filter Minification)
 Allocate a texture and generate the mipmaps of the texture from the BaseLevel to the MaxLevel included using the Minification filter.
 
texture_cube generate_mipmaps (texture_cube const &Texture, texture_cube::size_type BaseFace, texture_cube::size_type MaxFace, texture_cube::size_type BaseLevel, texture_cube::size_type MaxLevel, filter Minification)
 Allocate a texture and generate the mipmaps of the texture from the BaseLayer to the MaxLayer, from the BaseFace to the MaxFace and from the BaseLevel to the MaxLevel included levels using the Minification filter.
 
texture_cube_array generate_mipmaps (texture_cube_array const &Texture, texture_cube_array::size_type BaseLayer, texture_cube_array::size_type MaxLayer, texture_cube_array::size_type BaseFace, texture_cube_array::size_type MaxFace, texture_cube_array::size_type BaseLevel, texture_cube_array::size_type MaxLevel, filter Minification)
 Allocate a texture and generate the mipmaps of the texture from the BaseLayer to the MaxLayer and from the BaseLevel to the MaxLevel included levels using the Minification filter.
 
bool is_border (wrap Wrap)
 Evaluate whether the texture coordinate wrapping mode relies on border color.
 
bool is_channel (swizzle Swizzle)
 Determine whether the Swizzle value represent a channel.
 
bool is_compressed (format Format)
 Evaluate whether a format is compressed.
 
bool is_dds_ext (target Target, format Format)
 Evaluate whether a target and format combinaison is only supported by the DDS container through GLI DDS extension.
 
bool is_srgb (format Format)
 Evaluate whether a format stores sRGB color space values.
 
bool is_target_1d (target Target)
 Check whether a target is a 1D target.
 
bool is_target_array (target Target)
 Check whether a target is an array target.
 
bool is_target_cube (target Target)
 Check whether a target is a cube map target.
 
bool is_target_rect (target Target)
 Check whether a target is a rectangle target.
 
bool is_valid (format Format)
 Evaluate whether a format value is value or not.
 
template<typename T , precision P, template< typename, precision > class vecType>
levels (vecType< T, P > const &Extent)
 Compute the number of mipmaps levels necessary to create a mipmap complete texture. More...
 
texture load (char const *Path)
 Loads a texture storage_linear from file. More...
 
texture load (std::string const &Path)
 Loads a texture storage_linear from file. More...
 
texture load (char const *Data, std::size_t Size)
 Loads a texture storage_linear from memory. More...
 
texture load_dds (char const *Path)
 Loads a texture storage_linear from DDS file. More...
 
texture load_dds (std::string const &Path)
 Loads a texture storage_linear from DDS file. More...
 
texture load_dds (char const *Data, std::size_t Size)
 Loads a texture storage_linear from DDS memory. More...
 
texture load_kmg (char const *Path)
 Loads a texture storage_linear from KMG (Khronos Image) file. More...
 
texture load_kmg (std::string const &Path)
 Loads a texture storage_linear from KMG (Khronos Image) file. More...
 
texture load_kmg (char const *Data, std::size_t Size)
 Loads a texture storage_linear from KMG (Khronos Image) memory. More...
 
texture load_ktx (char const *Path)
 Loads a texture storage_linear from KTX file. More...
 
texture load_ktx (std::string const &Path)
 Loads a texture storage_linear from KTX file. More...
 
texture load_ktx (char const *Data, std::size_t Size)
 Loads a texture storage_linear from KTX memory. More...
 
bool operator!= (image const &ImageA, image const &ImageB)
 Compare two images. Two images are equal when the date is the same.
 
bool operator!= (texture const &A, texture const &B)
 Compare two textures. Two textures are the same when the data, the format and the targets are the same.
 
bool operator== (image const &ImageA, image const &ImageB)
 Compare two images. Two images are equal when the date is the same.
 
bool operator== (texture const &A, texture const &B)
 Compare two textures. Two textures are the same when the data, the format and the targets are the same.
 
template<typename vec_type >
vec_type reduce (texture1d const &In0, texture1d const &In1, typename reduce_func< vec_type >::type TexelFunc, typename reduce_func< vec_type >::type ReduceFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
vec_type reduce (texture1d_array const &In0, texture1d_array const &In1, typename reduce_func< vec_type >::type TexelFunc, typename reduce_func< vec_type >::type ReduceFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
vec_type reduce (texture2d const &In0, texture2d const &In1, typename reduce_func< vec_type >::type TexelFunc, typename reduce_func< vec_type >::type ReduceFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
vec_type reduce (texture2d_array const &In0, texture2d_array const &In1, typename reduce_func< vec_type >::type TexelFunc, typename reduce_func< vec_type >::type ReduceFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
vec_type reduce (texture3d const &In0, texture3d const &In1, typename reduce_func< vec_type >::type TexelFunc, typename reduce_func< vec_type >::type ReduceFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
vec_type reduce (texture_cube const &In0, texture_cube const &In1, typename reduce_func< vec_type >::type TexelFunc, typename reduce_func< vec_type >::type ReduceFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
vec_type reduce (texture_cube_array const &In0, texture_cube_array const &In1, typename reduce_func< vec_type >::type TexelFunc, typename reduce_func< vec_type >::type ReduceFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename texture_type , typename vec_type >
vec_type reduce (texture_type const &In0, texture_type const &In1, typename reduce_func< vec_type >::type TexelFunc, typename reduce_func< vec_type >::type ReduceFunc)
 Compute per-texel operations using a user defined function. More...
 
bool save (texture const &Texture, char const *Path)
 Save a texture storage_linear to file. More...
 
bool save (texture const &Texture, std::string const &Path)
 Save a texture storage_linear to file. More...
 
bool save_dds (texture const &Texture, char const *Path)
 Save a texture storage_linear to a DDS file. More...
 
bool save_dds (texture const &Texture, std::string const &Path)
 Save a texture storage_linear to a DDS file. More...
 
bool save_dds (texture const &Texture, std::vector< char > &Memory)
 Save a texture storage_linear to a DDS file. More...
 
bool save_kmg (texture const &Texture, char const *Path)
 Save a texture storage_linear to a KMG (Khronos Image) file. More...
 
bool save_kmg (texture const &Texture, std::string const &Path)
 Save a texture storage_linear to a KMG (Khronos Image) file. More...
 
bool save_kmg (texture const &Texture, std::vector< char > &Memory)
 Save a texture storage_linear to a KMG (Khronos Image) file. More...
 
bool save_ktx (texture const &Texture, char const *Path)
 Save a texture storage_linear to a KTX file. More...
 
bool save_ktx (texture const &Texture, std::string const &Path)
 Save a texture storage_linear to a KTX file. More...
 
bool save_ktx (texture const &Texture, std::vector< char > &Memory)
 Save a texture storage_linear to a KTX file. More...
 
template<typename vec_type >
void transform (texture1d &Out, texture1d const &In0, texture1d const &In1, typename transform_func< vec_type >::type TexelFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
void transform (texture1d_array &Out, texture1d_array const &In0, texture1d_array const &In1, typename transform_func< vec_type >::type TexelFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
void transform (texture2d &Out, texture2d const &In0, texture2d const &In1, typename transform_func< vec_type >::type TexelFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
void transform (texture2d_array &Out, texture2d_array const &In0, texture2d_array const &In1, typename transform_func< vec_type >::type TexelFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
void transform (texture3d &Out, texture3d const &In0, texture3d const &In1, typename transform_func< vec_type >::type TexelFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
void transform (texture_cube &Out, texture_cube const &In0, texture_cube const &In1, typename transform_func< vec_type >::type TexelFunc)
 Compute per-texel operations using a user defined function. More...
 
template<typename vec_type >
void transform (texture_cube_array &Out, texture_cube_array const &In0, texture_cube_array const &In1, typename transform_func< vec_type >::type TexelFunc)
 Compute per-texel operations using a user defined function. More...
 
image view (image const &Image)
 Create an image view of an existing image, sharing the same memory storage_linear.
 
texture view (texture const &Texture)
 Create a texture view of an existing texture, sharing the same memory storage_linear.
 
texture view (texture const &Texture, texture::size_type BaseLayer, texture::size_type MaxLayer, texture::size_type BaseFace, texture::size_type MaxFace, texture::size_type BaseLevel, texture::size_type MaxLevel)
 Create a texture view of an existing texture, sharing the same memory storage_linear but giving access only to a subset of layers, levels and faces.
 
template<typename texType >
texture view (texType const &Texture)
 Create a texture view of an existing texture, sharing the same memory storage_linear.
 
template<typename texType >
texture view (texType const &Texture, format Format)
 Create a texture view of an existing texture, sharing the same memory storage_linear but a different format. More...
 
texture view (texture1d const &Texture, texture1d::size_type BaseLevel, texture1d::size_type MaxLevel)
 Create a texture view of an existing texture, sharing the same memory storage_linear but giving access only to a subset of levels.
 
texture view (texture1d_array const &Texture, texture1d_array::size_type BaseLayer, texture1d_array::size_type MaxLayer, texture1d_array::size_type BaseLevel, texture1d_array::size_type MaxLevel)
 Create a texture view of an existing texture, sharing the same memory storage_linear but giving access only to a subset of levels and layers.
 
texture view (texture2d const &Texture, texture2d::size_type BaseLevel, texture2d::size_type MaxLevel)
 Create a texture view of an existing texture, sharing the same memory storage_linear but giving access only to a subset of levels.
 
texture view (texture2d_array const &Texture, texture2d_array::size_type BaseLayer, texture2d_array::size_type MaxLayer, texture2d_array::size_type BaseLevel, texture2d_array::size_type MaxLevel)
 Create a texture view of an existing texture, sharing the same memory storage_linear but giving access only to a subset of levels and layers.
 
texture view (texture3d const &Texture, texture3d::size_type BaseLevel, texture3d::size_type MaxLevel)
 Create a texture view of an existing texture, sharing the same memory storage_linear but giving access only to a subset of levels.
 
texture view (texture_cube const &Texture, texture_cube::size_type BaseFace, texture_cube::size_type MaxFace, texture_cube::size_type BaseLevel, texture_cube::size_type MaxLevel)
 Create a texture view of an existing texture, sharing the same memory storage_linear but giving access only to a subset of levels and faces.
 
texture view (texture_cube_array const &Texture, texture_cube_array::size_type BaseLayer, texture_cube_array::size_type MaxLayer, texture_cube_array::size_type BaseFace, texture_cube_array::size_type MaxFace, texture_cube_array::size_type BaseLevel, texture_cube_array::size_type MaxLevel)
 Create a texture view of an existing texture, sharing the same memory storage_linear but giving access only to a subset of layers, levels and faces.
 

Detailed Description

Namespace where all the classes and functions provided by GLI are exposed.

Function Documentation

texture_type gli::convert ( texture_type const &  Texture,
format  Format 
)

Convert texture data to a new format.

Parameters
TextureSource texture, the format must be uncompressed.
FormatDestination Texture format, it must be uncompressed.
texture gli::duplicate ( texType const &  Texture,
format  Format 
)

Duplicate a texture and create a new texture with a new storage_linear allocation but a different format.

The format must be a compatible format, a format which block size match the original format.

T gli::levels ( vecType< T, P > const &  Extent)

Compute the number of mipmaps levels necessary to create a mipmap complete texture.

Parameters
ExtentExtent of the texture base level mipmap
Template Parameters
vecTypeVector type used to express the dimentions of a texture of any kind.
#include <gli/levels.hpp>
...
gli::texture2d::extent_type Extent(32, 10);
gli::texture2d Texture(gli::levels(Extent));
texture gli::load ( char const *  Path)

Loads a texture storage_linear from file.

Returns an empty storage_linear in case of failure.

Parameters
PathPath of the file to open including filaname and filename extension
texture gli::load ( std::string const &  Path)

Loads a texture storage_linear from file.

Returns an empty storage_linear in case of failure.

Parameters
PathPath of the file to open including filaname and filename extension
texture gli::load ( char const *  Data,
std::size_t  Size 
)

Loads a texture storage_linear from memory.

Returns an empty storage_linear in case of failure.

Parameters
DataData of a texture
SizeSize of the data
texture gli::load_dds ( char const *  Path)

Loads a texture storage_linear from DDS file.

Returns an empty storage_linear in case of failure.

Parameters
PathPath of the file to open including filaname and filename extension
texture gli::load_dds ( std::string const &  Path)

Loads a texture storage_linear from DDS file.

Returns an empty storage_linear in case of failure.

Parameters
PathPath of the file to open including filaname and filename extension
texture gli::load_dds ( char const *  Data,
std::size_t  Size 
)

Loads a texture storage_linear from DDS memory.

Returns an empty storage_linear in case of failure.

Parameters
DataPointer to the beginning of the texture container data to read
SizeSize of texture container Data to read
texture gli::load_kmg ( char const *  Path)

Loads a texture storage_linear from KMG (Khronos Image) file.

Returns an empty storage_linear in case of failure.

Parameters
PathPath of the file to open including filaname and filename extension
texture gli::load_kmg ( std::string const &  Path)

Loads a texture storage_linear from KMG (Khronos Image) file.

Returns an empty storage_linear in case of failure.

Parameters
PathPath of the file to open including filaname and filename extension
texture gli::load_kmg ( char const *  Data,
std::size_t  Size 
)

Loads a texture storage_linear from KMG (Khronos Image) memory.

Returns an empty storage_linear in case of failure.

Parameters
DataPointer to the beginning of the texture container data to read
SizeSize of texture container Data to read
texture gli::load_ktx ( char const *  Path)

Loads a texture storage_linear from KTX file.

Returns an empty storage_linear in case of failure.

Parameters
PathPath of the file to open including filaname and filename extension
texture gli::load_ktx ( std::string const &  Path)

Loads a texture storage_linear from KTX file.

Returns an empty storage_linear in case of failure.

Parameters
PathPath of the file to open including filaname and filename extension
texture gli::load_ktx ( char const *  Data,
std::size_t  Size 
)

Loads a texture storage_linear from KTX memory.

Returns an empty storage_linear in case of failure.

Parameters
DataPointer to the beginning of the texture container data to read
SizeSize of texture container Data to read
vec_type gli::reduce ( texture1d const &  In0,
texture1d const &  In1,
typename reduce_func< vec_type >::type  TexelFunc,
typename reduce_func< vec_type >::type  ReduceFunc 
)

Compute per-texel operations using a user defined function.

Parameters
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function for per texel operation.
ReduceFuncPointer to a binary function to reduce texels.
vec_type gli::reduce ( texture1d_array const &  In0,
texture1d_array const &  In1,
typename reduce_func< vec_type >::type  TexelFunc,
typename reduce_func< vec_type >::type  ReduceFunc 
)

Compute per-texel operations using a user defined function.

Parameters
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function for per texel operation.
ReduceFuncPointer to a binary function to reduce texels.
vec_type gli::reduce ( texture2d const &  In0,
texture2d const &  In1,
typename reduce_func< vec_type >::type  TexelFunc,
typename reduce_func< vec_type >::type  ReduceFunc 
)

Compute per-texel operations using a user defined function.

Parameters
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function for per texel operation.
ReduceFuncPointer to a binary function to reduce texels.
vec_type gli::reduce ( texture2d_array const &  In0,
texture2d_array const &  In1,
typename reduce_func< vec_type >::type  TexelFunc,
typename reduce_func< vec_type >::type  ReduceFunc 
)

Compute per-texel operations using a user defined function.

Parameters
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function for per texel operation.
ReduceFuncPointer to a binary function to reduce texels.
vec_type gli::reduce ( texture3d const &  In0,
texture3d const &  In1,
typename reduce_func< vec_type >::type  TexelFunc,
typename reduce_func< vec_type >::type  ReduceFunc 
)

Compute per-texel operations using a user defined function.

Parameters
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function for per texel operation.
ReduceFuncPointer to a binary function to reduce texels.
vec_type gli::reduce ( texture_cube const &  In0,
texture_cube const &  In1,
typename reduce_func< vec_type >::type  TexelFunc,
typename reduce_func< vec_type >::type  ReduceFunc 
)

Compute per-texel operations using a user defined function.

Parameters
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function for per texel operation.
ReduceFuncPointer to a binary function to reduce texels.
vec_type gli::reduce ( texture_cube_array const &  In0,
texture_cube_array const &  In1,
typename reduce_func< vec_type >::type  TexelFunc,
typename reduce_func< vec_type >::type  ReduceFunc 
)

Compute per-texel operations using a user defined function.

Parameters
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function for per texel operation.
ReduceFuncPointer to a binary function to reduce texels.
vec_type gli::reduce ( texture_type const &  In0,
texture_type const &  In1,
typename reduce_func< vec_type >::type  TexelFunc,
typename reduce_func< vec_type >::type  ReduceFunc 
)

Compute per-texel operations using a user defined function.

Parameters
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function for per texel operation.
ReduceFuncPointer to a binary function to reduce texels.
bool gli::save ( texture const &  Texture,
char const *  Path 
)

Save a texture storage_linear to file.

Parameters
TextureSource texture to save
PathPath for where to save the file. It must include the filaname and filename extension. The function use the filename extension included in the path to figure out the file container to use.
Returns
Returns false if the function fails to save the file.
bool gli::save ( texture const &  Texture,
std::string const &  Path 
)

Save a texture storage_linear to file.

Parameters
TextureSource texture to save
PathPath for where to save the file. It must include the filaname and filename extension. The function use the filename extension included in the path to figure out the file container to use.
Returns
Returns false if the function fails to save the file.
bool gli::save_dds ( texture const &  Texture,
char const *  Path 
)

Save a texture storage_linear to a DDS file.

Parameters
TextureSource texture to save
PathPath for where to save the file. It must include the filaname and filename extension. This function ignores the filename extension in the path and save to DDS anyway but keep the requested filename extension.
Returns
Returns false if the function fails to save the file.
bool gli::save_dds ( texture const &  Texture,
std::string const &  Path 
)

Save a texture storage_linear to a DDS file.

Parameters
TextureSource texture to save
PathPath for where to save the file. It must include the filaname and filename extension. This function ignores the filename extension in the path and save to DDS anyway but keep the requested filename extension.
Returns
Returns false if the function fails to save the file.
bool gli::save_dds ( texture const &  Texture,
std::vector< char > &  Memory 
)

Save a texture storage_linear to a DDS file.

Parameters
TextureSource texture to save
MemoryStorage for the DDS container. The function resizes the containers to fit the necessary storage_linear.
Returns
Returns false if the function fails to save the file.
bool gli::save_kmg ( texture const &  Texture,
char const *  Path 
)

Save a texture storage_linear to a KMG (Khronos Image) file.

Parameters
TextureSource texture to save
PathPath for where to save the file. It must include the filaname and filename extension. This function ignores the filename extension in the path and save to KMG anyway but keep the requested filename extension.
Returns
Returns false if the function fails to save the file.
bool gli::save_kmg ( texture const &  Texture,
std::string const &  Path 
)

Save a texture storage_linear to a KMG (Khronos Image) file.

Parameters
TextureSource texture to save
PathPath for where to save the file. It must include the filaname and filename extension. This function ignores the filename extension in the path and save to KMG anyway but keep the requested filename extension.
Returns
Returns false if the function fails to save the file.
bool gli::save_kmg ( texture const &  Texture,
std::vector< char > &  Memory 
)

Save a texture storage_linear to a KMG (Khronos Image) file.

Parameters
TextureSource texture to save
MemoryStorage for the KMG container. The function resizes the containers to fit the necessary storage_linear.
Returns
Returns false if the function fails to save the file.
bool gli::save_ktx ( texture const &  Texture,
char const *  Path 
)

Save a texture storage_linear to a KTX file.

Parameters
TextureSource texture to save
PathPath for where to save the file. It must include the filaname and filename extension. This function ignores the filename extension in the path and save to KTX anyway but keep the requested filename extension.
Returns
Returns false if the function fails to save the file.
bool gli::save_ktx ( texture const &  Texture,
std::string const &  Path 
)

Save a texture storage_linear to a KTX file.

Parameters
TextureSource texture to save
PathPath for where to save the file. It must include the filaname and filename extension. This function ignores the filename extension in the path and save to KTX anyway but keep the requested filename extension.
Returns
Returns false if the function fails to save the file.
bool gli::save_ktx ( texture const &  Texture,
std::vector< char > &  Memory 
)

Save a texture storage_linear to a KTX file.

Parameters
TextureSource texture to save
MemoryStorage for the KTX container. The function resizes the containers to fit the necessary storage_linear.
Returns
Returns false if the function fails to save the file.
void gli::transform ( texture1d Out,
texture1d const &  In0,
texture1d const &  In1,
typename transform_func< vec_type >::type  TexelFunc 
)

Compute per-texel operations using a user defined function.

Parameters
OutOutput texture.
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function.
void gli::transform ( texture1d_array Out,
texture1d_array const &  In0,
texture1d_array const &  In1,
typename transform_func< vec_type >::type  TexelFunc 
)

Compute per-texel operations using a user defined function.

Parameters
OutOutput texture.
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function.
void gli::transform ( texture2d Out,
texture2d const &  In0,
texture2d const &  In1,
typename transform_func< vec_type >::type  TexelFunc 
)

Compute per-texel operations using a user defined function.

Parameters
OutOutput texture.
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function.
void gli::transform ( texture2d_array Out,
texture2d_array const &  In0,
texture2d_array const &  In1,
typename transform_func< vec_type >::type  TexelFunc 
)

Compute per-texel operations using a user defined function.

Parameters
OutOutput texture.
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function.
void gli::transform ( texture3d Out,
texture3d const &  In0,
texture3d const &  In1,
typename transform_func< vec_type >::type  TexelFunc 
)

Compute per-texel operations using a user defined function.

Parameters
OutOutput texture.
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function.
void gli::transform ( texture_cube Out,
texture_cube const &  In0,
texture_cube const &  In1,
typename transform_func< vec_type >::type  TexelFunc 
)

Compute per-texel operations using a user defined function.

Parameters
OutOutput texture.
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function.
void gli::transform ( texture_cube_array Out,
texture_cube_array const &  In0,
texture_cube_array const &  In1,
typename transform_func< vec_type >::type  TexelFunc 
)

Compute per-texel operations using a user defined function.

Parameters
OutOutput texture.
In0First input texture.
In1Second input texture.
TexelFuncPointer to a binary function.
texture gli::view ( texType const &  Texture,
format  Format 
)

Create a texture view of an existing texture, sharing the same memory storage_linear but a different format.

The format must be a compatible format, a format which block size match the original format.