diff --git a/src/osg/TransferFunction.cpp b/src/osg/TransferFunction.cpp index 0f069210f..db8eecf44 100644 --- a/src/osg/TransferFunction.cpp +++ b/src/osg/TransferFunction.cpp @@ -1,14 +1,14 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield - * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or - * (at your option) any later version. The full license is in LICENSE file - * included with this distribution, and on the openscenegraph.org website. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * OpenSceneGraph Public License for more details. +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield +* +* This library is open source and may be redistributed and/or modified under +* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or +* (at your option) any later version. The full license is in LICENSE file +* included with this distribution, and on the openscenegraph.org website. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* OpenSceneGraph Public License for more details. */ #include @@ -63,7 +63,7 @@ void TransferFunction1D::clear(const osg::Vec4& color) ColorMap newColours; newColours[getMinimum()] = color; newColours[getMaximum()] = color; - + assign(newColours); } @@ -74,8 +74,8 @@ void TransferFunction1D::assignToImage(float lower_v, const osg::Vec4& lower_c, float endPos = float(getNumberImageCells()-1); float multiplier = endPos/(maximum - minimum); osg::Vec4* imageData = reinterpret_cast(_image->data()); - - float lower_iPos = (lower_v - minimum)*multiplier; + + float lower_iPos = (lower_v - minimum)*multiplier; float upper_iPos = (upper_v - minimum)*multiplier; float start_iPos = ceilf(lower_iPos); @@ -86,15 +86,20 @@ void TransferFunction1D::assignToImage(float lower_v, const osg::Vec4& lower_c, if (end_iPos<0.0f) return; if (end_iPos>endPos) end_iPos=endPos; + //osg::notify(osg::NOTICE)<<"TransferFunction1D::assignToImage[lower_v="<getTexelOffset()[3]="<getTexelOffset()[3]<getTexelScale()[3]="<getTexelScale()[3]<