Om  1.0.0
A universal framework for multimedia simulation
Public Types | Public Member Functions | List of all members
om::graphics::textures::TextureUsage Class Reference

A class that specifies how a texture is semantically used for rendering. More...

#include <omGraphicsTextureUsage.h>

Public Types

enum  Enum {
  UNDEFINED = 0, AMBIENT_COLOR_MAP, DIFFUSE_COLOR_MAP, SPECULAR_COLOR_MAP,
  NORMAL_MAP, DISPLACEMENT_MAP, HEIGHT_MAP = DISPLACEMENT_MAP, ENVIRONMENT_MAP,
  SKY_MAP, LIGHT_MAP, ALPHA_MAP, DIRECTIONAL_LIGHT_SHADOW_MAP,
  DIRECTIONAL_LIGHT_CSM, DIRECTIONAL_LIGHT_CSM_0, DIRECTIONAL_LIGHT_CSM_1 = DIRECTIONAL_LIGHT_CSM_0 + 1, DIRECTIONAL_LIGHT_CSM_2 = DIRECTIONAL_LIGHT_CSM_0 + 2,
  DIRECTIONAL_LIGHT_CSM_3 = DIRECTIONAL_LIGHT_CSM_0 + 3, DIRECTIONAL_LIGHT_CSM_4 = DIRECTIONAL_LIGHT_CSM_0 + 4, DIRECTIONAL_LIGHT_CSM_5 = DIRECTIONAL_LIGHT_CSM_0 + 5, DIRECTIONAL_LIGHT_CSM_6 = DIRECTIONAL_LIGHT_CSM_0 + 6,
  DIRECTIONAL_LIGHT_CSM_7 = DIRECTIONAL_LIGHT_CSM_0 + 7, DIRECTIONAL_LIGHT_CSM_ARRAY, POINT_LIGHT_SHADOW_CUBE_MAP, SPOT_LIGHT_SHADOW_MAP,
  GUI_GLYPH, GUI_IMAGE
}
 

Public Member Functions

 TextureUsage ()
 Create a new undefined texture usage. More...
 
 TextureUsage (Enum newUsage)
 Create a new texture usage with the specified texture usage enum value. More...
 
 TextureUsage (Enum newUsage, Index newIndex)
 Create a new texture usage with the specified texture usage enum value and index. More...
 
 operator Enum () const
 Convert this texture usage to an enum value. More...
 
Bool operator== (const TextureUsage::Enum otherEnum) const
 Return whether or not this texture usage is the same as another. More...
 
Bool operator== (const TextureUsage &other) const
 Return whether or not this texture usage is the same as another. More...
 
Bool operator!= (const TextureUsage::Enum otherEnum) const
 Return whether or not this texture usage is different than another. More...
 
Bool operator!= (const TextureUsage &other) const
 Return whether or not this texture usage is different than another. More...
 
Bool isValidType (const TextureType &type) const
 Return whether or not the specified texture type is a valid type for this usage. More...
 
Bool isValidType (const Texture &texture) const
 Return whether or not the specified texture is a valid type for this usage. More...
 
Bool isShadow () const
 Return whether or not this texture usage represents a shadow map (depth texture) format. More...
 
Index getIndex () const
 Return an index for the shader attribute usage. More...
 
void setIndex (Index newIndex)
 Return an index for the shader attribute usage. More...
 
String toString () const
 Return a string representation of the texture usage. More...
 
 operator String () const
 Convert this texture usage into a string representation. More...
 
Hash getHashCode () const
 Return a hash code for this texture usage. More...
 

Detailed Description

A class that specifies how a texture is semantically used for rendering.

Each instance allows the user to specify an enum value indicating the type of usage and also an integral index for that usage. This allows the user to specify multiple color map usages, for instance.

Member Enumeration Documentation

Enumerator
UNDEFINED 

An unfefined texture usage.

AMBIENT_COLOR_MAP 

A usage that specifies that the texture is used as an ambient color texture map.

DIFFUSE_COLOR_MAP 

A usage that specifies that the texture is used as a diffuse color texture map.

SPECULAR_COLOR_MAP 

A usage that specifies that the texture is used as a specular color texture map.

NORMAL_MAP 

A usage that specifies that the texture is used as an object's normal map.

DISPLACEMENT_MAP 

A usage that specifies that the texture is used as an object's height/displacement map.

HEIGHT_MAP 

A usage that specifies that the texture is used as an object's height/displacement map.

ENVIRONMENT_MAP 

A usage that specifies that the texture is used as an object's environment map.

SKY_MAP 

A usage that specifies that the texture is used as a texture map for a scene's sky.

LIGHT_MAP 

A usage that specifies that the texture is used as a scene's light map.

ALPHA_MAP 

A usage that specifies that the texture is used as an alpha map.

DIRECTIONAL_LIGHT_SHADOW_MAP 

A usage that specifies that the texture is used as a directional light shadow map.

DIRECTIONAL_LIGHT_CSM 

A usage that specifies that the texture is used as a directional light packed cascaded shadow map for all cascades.

DIRECTIONAL_LIGHT_CSM_0 

A usage for the closest shadow map cascade to the camera.

DIRECTIONAL_LIGHT_CSM_1 
DIRECTIONAL_LIGHT_CSM_2 
DIRECTIONAL_LIGHT_CSM_3 
DIRECTIONAL_LIGHT_CSM_4 
DIRECTIONAL_LIGHT_CSM_5 
DIRECTIONAL_LIGHT_CSM_6 
DIRECTIONAL_LIGHT_CSM_7 
DIRECTIONAL_LIGHT_CSM_ARRAY 

A usage for a texture array of directional light shadow map cascades.

POINT_LIGHT_SHADOW_CUBE_MAP 

A usage that specifies that the texture is used as a point light shadow cube map.

SPOT_LIGHT_SHADOW_MAP 

A usage that specifies that the texture is used as a spot light shadow map.

GUI_GLYPH 

A usage that specifies that the texture is used as an text glyph in a GUI.

GUI_IMAGE 

A usage that specifies that the texture is used as an image in a GUI.

Constructor & Destructor Documentation

om::graphics::textures::TextureUsage::TextureUsage ( )
inline

Create a new undefined texture usage.

om::graphics::textures::TextureUsage::TextureUsage ( Enum  newUsage)
inline

Create a new texture usage with the specified texture usage enum value.

om::graphics::textures::TextureUsage::TextureUsage ( Enum  newUsage,
Index  newIndex 
)
inline

Create a new texture usage with the specified texture usage enum value and index.

Member Function Documentation

om::graphics::textures::TextureUsage::operator Enum ( ) const
inline

Convert this texture usage to an enum value.

Bool om::graphics::textures::TextureUsage::operator== ( const TextureUsage::Enum  otherEnum) const
inline

Return whether or not this texture usage is the same as another.

This operator does not compare any usage index, just the usage type.

Bool om::graphics::textures::TextureUsage::operator== ( const TextureUsage other) const
inline

Return whether or not this texture usage is the same as another.

Bool om::graphics::textures::TextureUsage::operator!= ( const TextureUsage::Enum  otherEnum) const
inline

Return whether or not this texture usage is different than another.

This operator does not compare any usage index, just the usage type.

Bool om::graphics::textures::TextureUsage::operator!= ( const TextureUsage other) const
inline

Return whether or not this texture usage is different than another.

Bool om::graphics::textures::TextureUsage::isValidType ( const TextureType type) const

Return whether or not the specified texture type is a valid type for this usage.

Bool om::graphics::textures::TextureUsage::isValidType ( const Texture texture) const

Return whether or not the specified texture is a valid type for this usage.

Bool om::graphics::textures::TextureUsage::isShadow ( ) const

Return whether or not this texture usage represents a shadow map (depth texture) format.

Index om::graphics::textures::TextureUsage::getIndex ( ) const
inline

Return an index for the shader attribute usage.

This value allows the user to keep track of multiple distinct usages separately (i.e. for multiple color maps) that have the same usage type.

void om::graphics::textures::TextureUsage::setIndex ( Index  newIndex)
inline

Return an index for the shader attribute usage.

This value allows the user to keep track of multiple distinct usages separately (i.e. for multiple color maps) that have the same usage type.

String om::graphics::textures::TextureUsage::toString ( ) const

Return a string representation of the texture usage.

om::graphics::textures::TextureUsage::operator String ( ) const
inline

Convert this texture usage into a string representation.

Hash om::graphics::textures::TextureUsage::getHashCode ( ) const
inline

Return a hash code for this texture usage.


The documentation for this class was generated from the following file: