vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Texture.h File Reference
#include <osg/Texture2D>
#include <string>

Go to the source code of this file.

Functions

osg::ref_ptr< osg::Texture2D > LoadOSGTextureWithColorKey (char *fileName, bool alphaMap, bool computeColorAsRGBAverage, bool colorKey, const osg::Vec4ub &colorKeyValue=osg::Vec4ub(255, 0, 255, 0))
 

Detailed Description

Author
Jakub Kroupal (original Atmospheric plug-in)
Rastislav Tisovcik (revised Clouds ability)
Version
2.0
Date
2008 (Atmospheric), January 2011 - February 2011 (Clouds)

Function Documentation

osg::ref_ptr<osg::Texture2D> LoadOSGTextureWithColorKey ( char *  fileName,
bool  alphaMap,
bool  computeColorAsRGBAverage,
bool  colorKey,
const osg::Vec4ub &  colorKeyValue = osg::Vec4ub(255, 0, 255, 0) 
)

Loads an OSG Texture with additional parameters such as colorkey or possibility to load the texture as an alpha map. The pixel format of the texture has to be GL_RGB or GL_RGBA.

Parameters
[in]fileNamePath to the file with the texture. All filetypes accepted by OSG are also permitted.
[in]alphaMapTRUE if the RGB values of the texture should be transformed to the greyscale so the texture could be used as an alpha map, FALSE otherwise - if the RGB values should not be modified.
[in]computeColorAsRGBAverageIf the alphaMap is TRUE, this parameter determines whether the RGB values of the alpha map are computed as an average of their values (TRUE) or if they're set on full white (FALSE). If alphaMap is FALSE, this parameter has no influence at all.
[in]colorKeyTRUE if the color key is used to make texture transparent, FALSE otherwise.
[in]colorKeyValueValue of the color key. If the colorKey parameter is TRUE, pixels with colorKeyValue are set to be fully transparent. If the colorKey is FALSE, this parameter has no influence and pixels are set to be fully opaque if the aphaMap is FALSE or their alpha value is computed from the RGB values if the alphaMap is TRUE. (optional parameter, default value = (255,0,255,0))
Returns
Loaded OSG texture with GL_RGBA pixel format.