The Vish Visualization Shell 0.3
Vish
Public Types | Public Member Functions | Public Attributes | List of all members
Wizt::RenderBasin::TextureStorageFormat Struct Reference

Enum for the storage type of the texture, which will affect memory utilization on the GPU. More...

#include <ocean/Anemonia/RenderBasin.hpp>

Public Types

enum  BitPrecision {
  Unspecified , Bit4 , Bit5 , Bit8 ,
  Bit12 , Bit16 , Bit32 , HalfFloat ,
  Float , Double
}
 The numerical precision of the texture. More...
 
enum  ColorMode {
  None =0 , R , RG , RGB ,
  RGBA , DEPTH , Automatic
}
 Options for color channels in the texture. More...
 

Public Member Functions

bool isIntensityTexture () const
 Check if this is supposed to be an intensity texture.
 
std::string str () const
 Create a description for this texture storage format.
 
 TextureStorageFormat (bool doAlpha=false, ColorMode theColors=None, BitPrecision theAlphaBits=Unspecified, BitPrecision theColorBits=Unspecified, bool doCompression=true)
 Construct a texture storage format.
 

Public Attributes

unsigned Alpha:1
 Include alpha channel (boolean)
 
BitPrecision AlphaBits:4
 Numerical precision for alpha channel.
 
BitPrecision ColorBits:4
 Numerical precision for color channel.
 
ColorMode Colors:3
 How many color channels to include.
 
unsigned Compressed:1
 Enable Texture compression, if possible for the specified precision.
 
unsigned Integer:1
 This is an integer texture, corresponding to a isampler2D or usampler2D in the shader code.
 
unsigned Normalized:1
 The texture is a floating point value that is normalized to the range [0,1] or [-1,1].
 
int OpenGLTextureType
 Allowing to override the bitwise specification by giving an OpenGL enum.
 
unsigned Signed:1
 The texture values might be negative.
 

Detailed Description

Enum for the storage type of the texture, which will affect memory utilization on the GPU.

OpenGL specifies a set of texture storage options such as described at http://www.opengl.org/wiki/Image_Format and http://www.opengl.org/registry/specs/ARB/texture_compression.txt

This class tries to match these using a some bit structure clarifying the requestable properties. Not all texture storage format are available through this API, but since the driver implementation is free to chose another storage anyway this might not be of much relevance in practice. Specifying a specific storage layout is anticipated to be easier using this structure.

The intensity texture format replicates the single intensity component value in the red, green, blue, and alpha channels.

Member Enumeration Documentation

◆ BitPrecision

The numerical precision of the texture.

Enumerator
Unspecified 

leave to driver implementation

Bit4 

4 Bit

Bit5 

5 Bit

Bit8 

8 Bit

Bit12 

12 Bit

Bit16 

32 Bit integer

Bit32 

16 Bit integer

HalfFloat 

16 bit floating point format

Float 

32 bit floating point format

◆ ColorMode

Options for color channels in the texture.

Enumerator
None 

no colors

just red component

RG 

red and green component

RGB 

red,green, blue components

RGBA 

four components

DEPTH 

for depth buffers

Automatic 

Let the implementation figure out something itself.

Constructor & Destructor Documentation

◆ TextureStorageFormat()

Wizt::RenderBasin::TextureStorageFormat::TextureStorageFormat ( bool  doAlpha = false,
ColorMode  theColors = None,
BitPrecision  theAlphaBits = Unspecified,
BitPrecision  theColorBits = Unspecified,
bool  doCompression = true 
)

Construct a texture storage format.

Note that if both Alpha is false and Colors is set to None, then this texture is interpreted as an Intensity texture which has all four channels set from the same one storage value.

See also isIntensityTexture()

Member Data Documentation

◆ Compressed

unsigned Wizt::RenderBasin::TextureStorageFormat::Compressed

Enable Texture compression, if possible for the specified precision.

http://www.opengl.org/registry/specs/ARB/texture_compression.txt