Description

Collection of texture related operations.

Variables

   
   
const unsigned int RAW_16BIT_BW

Functions

   
   
PixelFormatGL pixelFormatToGLPixelFormat(const Util::AttributeFormat & pixelFormat)
   
Util::AttributeFormat glPixelFormatToPixelFormat(const PixelFormatGL & glPixelFormat)
   
uint32_t textureTypeToGLTextureType( TextureType type)
   
Util::Reference < Texture > createStdCubeTexture(uint32_t width, bool alpha)
   
Util::Reference < Texture > createHDRCubeTexture(uint32_t width, bool alpha)
   
Util::Reference < Texture > createStdTexture(uint32_t width, uint32_t height, bool alpha)
   
Util::Reference < Texture > createNoiseTexture(uint32_t width, uint32_t height, bool alpha, float scaling)
   
Util::Reference < Texture > createHDRTexture(uint32_t width, uint32_t height, bool alpha)
   
Util::Reference < Texture > createRedTexture(uint32_t width, uint32_t height, bool useByte)
   
Util::Reference < Texture > createDepthStencilTexture(uint32_t width, uint32_t height)
   
Util::Reference < Texture > createDepthTexture(uint32_t width, uint32_t height, uint32_t layers)
   
Util::Reference < Texture > createHDRDepthTexture(uint32_t width, uint32_t height, uint32_t layers)
   
Util::Reference < Texture > createMultisampleDepthTexture(uint32_t width, uint32_t height, uint32_t samples)
   
Util::Reference < Texture > createMultisampleTexture(uint32_t width, uint32_t height, bool alpha, uint32_t samples)
   
Util::Reference < Texture > createColorTexture( TextureType type, uint32_t sizeX, uint32_t sizeY, uint32_t numLayers, Util::TypeConstant dataType, uint8_t numComponents, bool filtering, bool clampToEdge, uint32_t samples)
   
Util::Reference < Texture > createDataTexture( TextureType type, uint32_t sizeX, uint32_t sizeY, uint32_t numLayers, Util::TypeConstant dataType, uint8_t numComponents)
   
Util::Reference < Texture > createTextureDataArray_Vec4(const uint32_t size)
   
Util::Reference < Texture > createChessTexture(uint32_t width, uint32_t height, int fieldSize_powOfTwo)
   
Util::Reference < Texture > createColorPalette(const std::vector< Util::Color4f > & colors)
   
Util::Reference < Texture > createTextureFromBitmap(const Util::Bitmap & bitmap, TextureType type, uint32_t numLayers, bool clampToEdge)
   
Util::Reference < Texture > createTextureFromRAW(const Util::FileName & filename, unsigned int type, bool flip_h)
   
Util::Reference < Texture > createTextureFromScreen(int xpos, int ypos, const Texture::Format & format)
   
Util::Reference < Texture > createTextureFromScreen(int xpos, int ypos, int width, int height, bool useAlpha)
   
void updateTextureFromScreen( RenderingContext & context, Texture & t, const Geometry::Rect_i & textureRect, int screenPosX, int screenPosY)
   
void updateTextureFromScreen( RenderingContext & context, Texture & t)
   
void drawTextureToScreen( RenderingContext & rc, const Geometry::Rect_i & screenRect, Texture & t, const Geometry::Rect_f & textureRect)
   
void drawTextureToScreen( RenderingContext & rc, const Geometry::Rect_i & screenRect, const std::vector< Texture * > & textures, const std::vector< Geometry::Rect_f > & textureRects)
   
bool compareTextures( Texture * t1, Texture * t2)
   
Util::Reference < Util::Bitmap > createBitmapFromTexture( RenderingContext & context, Texture & texture)
the texture is downloaded to memory (if necessary), the proper Util-color format is chosen and the texture is flipped vertically.
   
Util::Reference < Util::Bitmap > createBitmapFromLocalTexture(const Texture & texture)
like createBitmapFromTexture, but the texture is NOT downloaded, but a warning is issued if it should have been.
   
Util::Reference < Util::PixelAccessor > createColorPixelAccessor( RenderingContext & context, Texture & texture)
Create a standard pixel accessor for reading color values.
   
Util::Reference < Util::PixelAccessor > createDepthPixelAccessor( RenderingContext & context, Texture & texture)
Create a special pixel accessor for reading depth values. This has to be used for packed depth and stencil image formats.
   
Util::Reference < Util::PixelAccessor > createStencilPixelAccessor( RenderingContext & context, Texture & texture)
Create a special pixel accessor for reading stencil values. This has to be used for packed depth and stencil image formats.
   
float minDepthDistance( RenderingContext & context, Texture & firstTex, Texture & secondTex)

Documentation

variable
Rendering::TextureUtils::RAW_16BIT_BW

public
 
 
const unsigned int RAW_16BIT_BW

Defined in Rendering/Texture/TextureUtils.h:42


function
Rendering::TextureUtils::pixelFormatToGLPixelFormat

public
     
     
PixelFormatGL pixelFormatToGLPixelFormat( const Util::AttributeFormat & pixelFormat )

Defined in Rendering/Texture/TextureUtils.h:44


function
Rendering::TextureUtils::glPixelFormatToPixelFormat

public
     
     
Util::AttributeFormat glPixelFormatToPixelFormat( const PixelFormatGL & glPixelFormat )

Defined in Rendering/Texture/TextureUtils.h:45


function
Rendering::TextureUtils::textureTypeToGLTextureType

public
     
     
uint32_t textureTypeToGLTextureType( TextureType type )

Defined in Rendering/Texture/TextureUtils.h:46


function
Rendering::TextureUtils::createStdCubeTexture

public
     
     
Util::Reference < Texture > createStdCubeTexture( uint32_t width,
  bool alpha
)    

Defined in Rendering/Texture/TextureUtils.h:48


function
Rendering::TextureUtils::createHDRCubeTexture

public
     
     
Util::Reference < Texture > createHDRCubeTexture( uint32_t width,
  bool alpha
)    

Defined in Rendering/Texture/TextureUtils.h:49


function
Rendering::TextureUtils::createStdTexture

public
     
     
Util::Reference < Texture > createStdTexture( uint32_t width,
  uint32_t height,
  bool alpha
)    

Defined in Rendering/Texture/TextureUtils.h:50


function
Rendering::TextureUtils::createNoiseTexture

public
     
     
Util::Reference < Texture > createNoiseTexture( uint32_t width,
  uint32_t height,
  bool alpha,
  float scaling
)    

Defined in Rendering/Texture/TextureUtils.h:51


function
Rendering::TextureUtils::createHDRTexture

public
     
     
Util::Reference < Texture > createHDRTexture( uint32_t width,
  uint32_t height,
  bool alpha
)    

Defined in Rendering/Texture/TextureUtils.h:52


function
Rendering::TextureUtils::createRedTexture

public
     
     
Util::Reference < Texture > createRedTexture( uint32_t width,
  uint32_t height,
  bool useByte
)    

Defined in Rendering/Texture/TextureUtils.h:53


function
Rendering::TextureUtils::createDepthStencilTexture

public
     
     
Util::Reference < Texture > createDepthStencilTexture( uint32_t width,
  uint32_t height
)    

Defined in Rendering/Texture/TextureUtils.h:54


function
Rendering::TextureUtils::createDepthTexture

public
     
     
Util::Reference < Texture > createDepthTexture( uint32_t width,
  uint32_t height,
  uint32_t layers
)    

Defined in Rendering/Texture/TextureUtils.h:55


function
Rendering::TextureUtils::createHDRDepthTexture

public
     
     
Util::Reference < Texture > createHDRDepthTexture( uint32_t width,
  uint32_t height,
  uint32_t layers
)    

Defined in Rendering/Texture/TextureUtils.h:56


function
Rendering::TextureUtils::createMultisampleDepthTexture

public
     
     
Util::Reference < Texture > createMultisampleDepthTexture( uint32_t width,
  uint32_t height,
  uint32_t samples
)    

Defined in Rendering/Texture/TextureUtils.h:57


function
Rendering::TextureUtils::createMultisampleTexture

public
     
     
Util::Reference < Texture > createMultisampleTexture( uint32_t width,
  uint32_t height,
  bool alpha,
  uint32_t samples
)    

Defined in Rendering/Texture/TextureUtils.h:58


function
Rendering::TextureUtils::createColorTexture

public
     
     
Util::Reference < Texture > createColorTexture( TextureType type,
  uint32_t sizeX,
  uint32_t sizeY,
  uint32_t numLayers,
  Util::TypeConstant dataType,
  uint8_t numComponents,
  bool filtering,
  bool clampToEdge,
  uint32_t samples
)    

TextureType== TextureType::TEXTURE_1D /2D/3D/1D_ARRAY/2D_ARRAY/CUBE_MAPnumComponents== 1 || 2 || 3|| 4dataType== FLOAT || UINT8 || UINT32 || INT32

Note: If the texture should be used as image(load and store), only 1,2,or 4 components are valid.

Defined in Rendering/Texture/TextureUtils.h:66


function
Rendering::TextureUtils::createDataTexture

public
     
     
Util::Reference < Texture > createDataTexture( TextureType type,
  uint32_t sizeX,
  uint32_t sizeY,
  uint32_t numLayers,
  Util::TypeConstant dataType,
  uint8_t numComponents
)    

numComponents== 1 || 2 || 3|| 4dataType== FLOAT || UINT8 || UINT32 || INT32

Note: no filtering is performed

Note: If the texture should be used as image(load and store), only 1,2,or 4 components are valid.

Defined in Rendering/Texture/TextureUtils.h:73


function
Rendering::TextureUtils::createTextureDataArray_Vec4

public
     
     
Util::Reference < Texture > createTextureDataArray_Vec4( const uint32_t size )

Defined in Rendering/Texture/TextureUtils.h:76


function
Rendering::TextureUtils::createChessTexture

public
     
     
Util::Reference < Texture > createChessTexture( uint32_t width,
  uint32_t height,
  int fieldSize_powOfTwo
)    

Defined in Rendering/Texture/TextureUtils.h:77


function
Rendering::TextureUtils::createColorPalette

public
     
     
Util::Reference < Texture > createColorPalette( const std::vector< Util::Color4f > & colors )

Defined in Rendering/Texture/TextureUtils.h:79


function
Rendering::TextureUtils::createTextureFromBitmap

public
     
     
Util::Reference < Texture > createTextureFromBitmap( const Util::Bitmap & bitmap,
  TextureType type,
  uint32_t numLayers,
  bool clampToEdge
)    

Create a texture of the giventextureTypefrom the givenbitmap.

  • For textureType TEXTURE_1D and TEXTURE_2D, numLayers must be 1.

  • For textureType TEXTURE_CUBE_MAP, numLayers must be 6.

  • For textureType TEXTURE_CUBE_MAP_ARRAY, numLayers must be a multiple of 6.

Defined in Rendering/Texture/TextureUtils.h:85


function
Rendering::TextureUtils::createTextureFromRAW

public
     
     
Util::Reference < Texture > createTextureFromRAW( const Util::FileName & filename,
  unsigned int type,
  bool flip_h
)    

Defined in Rendering/Texture/TextureUtils.h:86


function
Rendering::TextureUtils::createTextureFromScreen

public
     
     
Util::Reference < Texture > createTextureFromScreen( int xpos,
  int ypos,
  const Texture::Format & format
)    

Defined in Rendering/Texture/TextureUtils.h:87


function
Rendering::TextureUtils::createTextureFromScreen

public
     
     
Util::Reference < Texture > createTextureFromScreen( int xpos,
  int ypos,
  int width,
  int height,
  bool useAlpha
)    

Defined in Rendering/Texture/TextureUtils.h:88


function
Rendering::TextureUtils::updateTextureFromScreen

public
     
     
void updateTextureFromScreen( RenderingContext & context,
  Texture & t,
  const Geometry::Rect_i & textureRect,
  int screenPosX,
  int screenPosY
)    

Defined in Rendering/Texture/TextureUtils.h:90


function
Rendering::TextureUtils::updateTextureFromScreen

public
     
     
void updateTextureFromScreen( RenderingContext & context,
  Texture & t
)    

Defined in Rendering/Texture/TextureUtils.h:91


function
Rendering::TextureUtils::drawTextureToScreen

public
     
     
void drawTextureToScreen( RenderingContext & rc,
  const Geometry::Rect_i & screenRect,
  Texture & t,
  const Geometry::Rect_f & textureRect
)    

Defined in Rendering/Texture/TextureUtils.h:92


function
Rendering::TextureUtils::drawTextureToScreen

public
     
     
void drawTextureToScreen( RenderingContext & rc,
  const Geometry::Rect_i & screenRect,
  const std::vector< Texture * > & textures,
  const std::vector< Geometry::Rect_f > & textureRects
)    

Defined in Rendering/Texture/TextureUtils.h:93


function
Rendering::TextureUtils::compareTextures

public
     
     
bool compareTextures( Texture * t1,
  Texture * t2
)    

Defined in Rendering/Texture/TextureUtils.h:98


function
Rendering::TextureUtils::createBitmapFromTexture

public
     
     
Util::Reference < Util::Bitmap > createBitmapFromTexture( RenderingContext & context,
  Texture & texture
)    

the texture is downloaded to memory (if necessary), the proper Util-color format is chosen and the texture is flipped vertically.

Defined in Rendering/Texture/TextureUtils.h:101


function
Rendering::TextureUtils::createBitmapFromLocalTexture

public
     
     
Util::Reference < Util::Bitmap > createBitmapFromLocalTexture( const Texture & texture )

like createBitmapFromTexture, but the texture is NOT downloaded, but a warning is issued if it should have been.

Defined in Rendering/Texture/TextureUtils.h:104


function
Rendering::TextureUtils::createColorPixelAccessor

public
     
     
Util::Reference < Util::PixelAccessor > createColorPixelAccessor( RenderingContext & context,
  Texture & texture
)    

Create a standard pixel accessor for reading color values.

Defined in Rendering/Texture/TextureUtils.h:107


function
Rendering::TextureUtils::createDepthPixelAccessor

public
     
     
Util::Reference < Util::PixelAccessor > createDepthPixelAccessor( RenderingContext & context,
  Texture & texture
)    

Create a special pixel accessor for reading depth values. This has to be used for packed depth and stencil image formats.

Defined in Rendering/Texture/TextureUtils.h:110


function
Rendering::TextureUtils::createStencilPixelAccessor

public
     
     
Util::Reference < Util::PixelAccessor > createStencilPixelAccessor( RenderingContext & context,
  Texture & texture
)    

Create a special pixel accessor for reading stencil values. This has to be used for packed depth and stencil image formats.

Defined in Rendering/Texture/TextureUtils.h:113


function
Rendering::TextureUtils::minDepthDistance

public
     
     
float minDepthDistance( RenderingContext & context,
  Texture & firstTex,
  Texture & secondTex
)    

Compares two depth texture and determines their minimal distance. Note: This method is heavily customized to support the snapping functionality implemented by getNodeToSceneDistance in scripts/Util/Picking_Utils.escipt. For the comparison the second texture is flipped horizontally and it’s values are inverted. In order to have a sound definition of a (positive) distance the implementation checks that the first texture lies completely behind the second one. If this is not the case -1.0f is returned. In case the two textures are disjoint (they don’t have a common pixel with a depth value unequal to the clearDepth-value) the method returns -2.0f.

Defined in Rendering/Texture/TextureUtils.h:123