Added setValue method and osg::Image setup to osg::TransferFunction1D, and setup

of TransferFunction1D into osgterrain example.
This commit is contained in:
Robert Osfield
2007-04-02 13:06:59 +00:00
parent 826be748e8
commit 43c24da12d
3 changed files with 25 additions and 1 deletions

View File

@@ -46,6 +46,8 @@ void TransferFunction1D::setInputRange(float minimum, float maximum)
void TransferFunction1D::allocate(unsigned int numX)
{
_colors.resize(numX);
_image = new osg::Image;
_image->setImage(numX,1,1,GL_RGBA, GL_RGBA, GL_FLOAT, (unsigned char*)&_colors[0], osg::Image::NO_DELETE);
}
void TransferFunction1D::clear(const osg::Vec4& color)