HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT > Class Template Reference

Volume filtering (e.g., diffusion) with optional alpha masking. More...

#include <Filter.h>

Public Types

typedef GridT GridType
 
typedef MaskT MaskType
 
typedef GridType::TreeType TreeType
 
typedef TreeType::LeafNodeType LeafType
 
typedef GridType::ValueType ValueType
 
typedef MaskType::ValueType AlphaType
 
typedef tree::LeafManager
< TreeType
LeafManagerType
 
typedef LeafManagerType::LeafRange RangeType
 
typedef LeafManagerType::BufferType BufferType
 

Public Member Functions

 HBOOST_STATIC_ASSERT (hboost::is_floating_point< AlphaType >::value)
 
 Filter (GridT &grid, InterruptT *interrupt=NULL)
 
 Filter (const Filter &other)
 Shallow copy constructor called by tbb::parallel_for() threads during filtering. More...
 
int getGrainSize () const
 
void setGrainSize (int grainsize)
 Set the grain-size used for multi-threading. More...
 
AlphaType minMask () const
 Return the minimum value of the mask to be used for the derivation of a smooth alpha value. More...
 
AlphaType maxMask () const
 Return the maximum value of the mask to be used for the derivation of a smooth alpha value. More...
 
void setMaskRange (AlphaType min, AlphaType max)
 Define the range for the (optional) scalar mask. More...
 
bool isMaskInverted () const
 Return true if the mask is inverted, i.e. min->max in the original mask maps to 1->0 in the inverted alpha mask. More...
 
void invertMask (bool invert=true)
 Invert the optional mask, i.e. min->max in the original mask maps to 1->0 in the inverted alpha mask. More...
 
void mean (int width=1, int iterations=1, const MaskType *mask=NULL)
 One iteration of a fast separable mean-value (i.e. box) filter. More...
 
void gaussian (int width=1, int iterations=1, const MaskType *mask=NULL)
 One iteration of a fast separable Gaussian filter. More...
 
void median (int width=1, int iterations=1, const MaskType *mask=NULL)
 One iteration of a median-value filter. More...
 
void offset (ValueType offset, const MaskType *mask=NULL)
 
void operator() (const RangeType &range) const
 Used internally by tbb::parallel_for() More...
 

Detailed Description

template<typename GridT, typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
class openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >

Volume filtering (e.g., diffusion) with optional alpha masking.

Note
Only the values in the grid are changed, not its topology!

Definition at line 66 of file Filter.h.

Member Typedef Documentation

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
typedef MaskType::ValueType openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::AlphaType

Definition at line 74 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
typedef LeafManagerType::BufferType openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::BufferType

Definition at line 77 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
typedef GridT openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::GridType

Definition at line 69 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
typedef tree::LeafManager<TreeType> openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::LeafManagerType

Definition at line 75 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
typedef TreeType::LeafNodeType openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::LeafType

Definition at line 72 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
typedef MaskT openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::MaskType

Definition at line 70 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
typedef LeafManagerType::LeafRange openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::RangeType

Definition at line 76 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
typedef GridType::TreeType openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::TreeType

Definition at line 71 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
typedef GridType::ValueType openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::ValueType

Definition at line 73 of file Filter.h.

Constructor & Destructor Documentation

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::Filter ( GridT &  grid,
InterruptT *  interrupt = NULL 
)
inline

Constructor

Parameters
gridGrid to be filtered.
interruptOptional interrupter.

Definition at line 83 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::Filter ( const Filter< GridT, MaskT, InterruptT > &  other)
inline

Shallow copy constructor called by tbb::parallel_for() threads during filtering.

Parameters
otherThe other Filter from which to copy.

Definition at line 98 of file Filter.h.

Member Function Documentation

template<typename GridT , typename MaskT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::gaussian ( int  width = 1,
int  iterations = 1,
const MaskType mask = NULL 
)
inline

One iteration of a fast separable Gaussian filter.

Note
This is approximated as 4 iterations of a separable mean filter which typically leads an approximation that's better than 95%!
Parameters
widthThe width of the mean-value filter is 2*width+1 voxels.
iterationsNumber of times the mean-value filter is applied.
maskOptional alpha mask.

Definition at line 275 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
int openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::getGrainSize ( ) const
inline
Returns
the grain-size used for multi-threading

Definition at line 111 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::HBOOST_STATIC_ASSERT ( hboost::is_floating_point< AlphaType >::value  )
template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::invertMask ( bool  invert = true)
inline

Invert the optional mask, i.e. min->max in the original mask maps to 1->0 in the inverted alpha mask.

Definition at line 140 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
bool openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::isMaskInverted ( ) const
inline

Return true if the mask is inverted, i.e. min->max in the original mask maps to 1->0 in the inverted alpha mask.

Definition at line 137 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
AlphaType openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::maxMask ( ) const
inline

Return the maximum value of the mask to be used for the derivation of a smooth alpha value.

Definition at line 121 of file Filter.h.

template<typename GridT , typename MaskT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::mean ( int  width = 1,
int  iterations = 1,
const MaskType mask = NULL 
)
inline

One iteration of a fast separable mean-value (i.e. box) filter.

Parameters
widthThe width of the mean-value filter is 2*width+1 voxels.
iterationsNumber of times the mean-value filter is applied.
maskOptional alpha mask.

Definition at line 248 of file Filter.h.

template<typename GridT , typename MaskT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::median ( int  width = 1,
int  iterations = 1,
const MaskType mask = NULL 
)
inline

One iteration of a median-value filter.

Note
This filter is not separable and is hence relatively slow!
Parameters
widthThe width of the mean-value filter is 2*width+1 voxels.
iterationsNumber of times the mean-value filter is applied.
maskOptional alpha mask.

Definition at line 304 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
AlphaType openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::minMask ( ) const
inline

Return the minimum value of the mask to be used for the derivation of a smooth alpha value.

Definition at line 118 of file Filter.h.

template<typename GridT , typename MaskT , typename InterruptT >
void openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::offset ( ValueType  offset,
const MaskType mask = NULL 
)
inline

Offsets (i.e. adds) a constant value to all active voxels.

Parameters
offsetOffset in the same units as the grid.
maskOptional alpha mask.

Definition at line 321 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::operator() ( const RangeType range) const
inline

Used internally by tbb::parallel_for()

Parameters
rangeRange of LeafNodes over which to multi-thread.
Warning
Never call this method directly!

Definition at line 174 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::setGrainSize ( int  grainsize)
inline

Set the grain-size used for multi-threading.

Note
A grain size of 0 or less disables multi-threading!

Definition at line 114 of file Filter.h.

template<typename GridT , typename MaskT = typename GridT::template ValueConverter<float>::Type, typename InterruptT = util::NullInterrupter>
void openvdb::OPENVDB_VERSION_NAME::tools::Filter< GridT, MaskT, InterruptT >::setMaskRange ( AlphaType  min,
AlphaType  max 
)
inline

Define the range for the (optional) scalar mask.

Parameters
minMinimum value of the range.
maxMaximum value of the range.

Mask values outside the range are clamped to zero or one, and values inside the range map smoothly to 0->1 (unless the mask is inverted).

Exceptions
ValueErrorif min is not smaller than max.

Definition at line 128 of file Filter.h.


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