OpenSceneGraph 2.8.4
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
osg::TransferFunction1D Class Reference

1D variant of TransferFunction. More...

Inheritance diagram for osg::TransferFunction1D:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::map< float,
osg::Vec4
ColorMap

Public Member Functions

 TransferFunction1D ()
 TransferFunction1D (const TransferFunction1D &tf, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 Copy constructor using CopyOp to manage deep vs shallow copy.
 META_Object (osg, TransferFunction1D) float getMinimum() const
 Get the mnimum transfer function value.
float getMaximum () const
 Get the maximum transfer function value.
void allocate (unsigned int numImageCells)
 allocate the osg::Image with specified dimension.
void clear (const osg::Vec4 &color=osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f))
 Clear the whole range to just represet a single color.
osg::Vec4 getPixelValue (unsigned int i) const
 Get pixel value from the image.
unsigned int getNumberImageCells () const
 Get the number of image cells that are assigned to the represent the transfer function when download to the GPU.
void setColor (float v, const osg::Vec4 &color, bool updateImage=true)
 Set the color for a specified transfer function value.
osg::Vec4 getColor (float v) const
 Get the color for a specified transfer function value, interpolating the value if no exact match is found.
ColorMapgetColorMap ()
 Get the color map that stores the mapping between the the tranfser function value and the colour it maps to.
const ColorMapgetColorMap () const
 Get the const color map that stores the mapping between the the tranfser function value and the colour it maps to.
void assign (const ColorMap &vcm)
 Assign a color map and automatically update the image to make sure they are in sync.
void updateImage ()
 Manually update the associate osg::Image to represent the colors assigned in the color map.

Protected Member Functions

void assignToImage (float lower_v, const osg::Vec4 &lower_c, float upper_v, const osg::Vec4 &upper_c)

Protected Attributes

ColorMap _colorMap

Detailed Description

1D variant of TransferFunction.


Member Typedef Documentation

typedef std::map<float, osg::Vec4> osg::TransferFunction1D::ColorMap

Constructor & Destructor Documentation

osg::TransferFunction1D::TransferFunction1D ( )
osg::TransferFunction1D::TransferFunction1D ( const TransferFunction1D tf,
const CopyOp copyop = CopyOp::SHALLOW_COPY 
)

Copy constructor using CopyOp to manage deep vs shallow copy.


Member Function Documentation

void osg::TransferFunction1D::allocate ( unsigned int  numImageCells)

allocate the osg::Image with specified dimension.

The Image tracks the color map, and is used to represent the transfer function when download to GPU.

void osg::TransferFunction1D::assign ( const ColorMap vcm)

Assign a color map and automatically update the image to make sure they are in sync.

void osg::TransferFunction1D::assignToImage ( float  lower_v,
const osg::Vec4 lower_c,
float  upper_v,
const osg::Vec4 upper_c 
) [protected]
void osg::TransferFunction1D::clear ( const osg::Vec4 color = osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f))

Clear the whole range to just represet a single color.

osg::Vec4 osg::TransferFunction1D::getColor ( float  v) const

Get the color for a specified transfer function value, interpolating the value if no exact match is found.

ColorMap& osg::TransferFunction1D::getColorMap ( ) [inline]

Get the color map that stores the mapping between the the tranfser function value and the colour it maps to.

const ColorMap& osg::TransferFunction1D::getColorMap ( ) const [inline]

Get the const color map that stores the mapping between the the tranfser function value and the colour it maps to.

float osg::TransferFunction1D::getMaximum ( ) const [inline]

Get the maximum transfer function value.

unsigned int osg::TransferFunction1D::getNumberImageCells ( ) const [inline]

Get the number of image cells that are assigned to the represent the transfer function when download to the GPU.

osg::Vec4 osg::TransferFunction1D::getPixelValue ( unsigned int  i) const [inline]

Get pixel value from the image.

osg::TransferFunction1D::META_Object ( osg  ,
TransferFunction1D   
) const [inline]

Get the mnimum transfer function value.

void osg::TransferFunction1D::setColor ( float  v,
const osg::Vec4 color,
bool  updateImage = true 
)

Set the color for a specified transfer function value.

updateImage defaults to true, and tells the setColor function to update the associate osg::Image that tracks the color map. Pass in false as the updateImage parameter if you are setting up many values at once to avoid recomputating og the image data, then once all setColor calls are made explictly call updateImage() to bring the osg::Image back into sync with the color map.

void osg::TransferFunction1D::updateImage ( )

Manually update the associate osg::Image to represent the colors assigned in the color map.


Member Data Documentation


The documentation for this class was generated from the following file:

osg logo
Generated at Sun Jan 8 2012 13:16:24 for the OpenSceneGraph by doxygen 1.7.4.