vrecko
virtual reality framework
|
#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)) |
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.
[in] | fileName | Path to the file with the texture. All filetypes accepted by OSG are also permitted. |
[in] | alphaMap | TRUE 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] | computeColorAsRGBAverage | If 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] | colorKey | TRUE if the color key is used to make texture transparent, FALSE otherwise. |
[in] | colorKeyValue | Value 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)) |