14 #ifndef OSG_TRANSFERFUNCTION
15 #define OSG_TRANSFERFUNCTION 1
17 #include <osg/Texture>
42 osg::
Image* getImage() {
return _image.get(); }
67 float getMinimum()
const {
return _colorMap.empty() ? 0.0f : _colorMap.begin()->first; }
70 float getMaximum()
const {
return _colorMap.empty() ? 0.0f : _colorMap.rbegin()->first; }
74 void allocate(
unsigned int numImageCells);
82 if (_image.valid() && i<static_cast<unsigned int>(_image->s()))
84 return *
reinterpret_cast<osg::Vec4*
>(_image->data(i));
100 void setColor(
float v,
const osg::Vec4& color,
bool updateImage=
true);
117 void assign(
const ColorMap& vcm);
126 void assignToImage(
float lower_v,
const osg::Vec4& lower_c,
float upper_v,
const osg::Vec4& upper_c);
const ColorMap & getColorMap() const
std::map< float, osg::Vec4 > ColorMap
META_Object(osg, TransferFunction1D) float getMinimum() const
osg::Vec4 getPixelValue(unsigned int i) const
osg::ref_ptr< osg::Image > _image
unsigned int getNumberImageCells() const
void setColorMap(const ColorMap &vcm)
META_Object(osg, TransferFunction) osg
const osg::Image * getImage() const