OpenSceneGraph
3.0.1
|
1D variant of TransferFunction. More...
Public Types | |
typedef std::map< float, osg::Vec4 > | ColorMap |
Public Member Functions | |
TransferFunction1D () | |
TransferFunction1D (const TransferFunction1D &tf, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
Copy constructor using CopyOp to manage deep vs shallow copy. | |
META_Object (osg, TransferFunction1D) float getMinimum() const | |
Get the minimum 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 represent 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. | |
ColorMap & | getColorMap () |
Get the color map that stores the mapping between the the transfer function value and the colour it maps to. | |
const ColorMap & | getColorMap () const |
Get the const color map that stores the mapping between the the transfer 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 |
1D variant of TransferFunction.
typedef std::map<float, osg::Vec4> osg::TransferFunction1D::ColorMap |
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.
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] |
Clear the whole range to just represent 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 transfer 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 transfer 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 minimum 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 recomputation of 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.
ColorMap osg::TransferFunction1D::_colorMap [protected] |
![]() | Generated at Mon Oct 3 2011 12:39:45 for the OpenSceneGraph by doxygen 1.7.5. |