vpBoxFilter(3) | Library Functions Manual | vpBoxFilter(3) |
NAME¶
vpBoxFilter, vpLinearFilter, vpBicubicFilter, vpGaussianFilter - initialize a filter weight tableSYNOPSIS¶
#include <volpack.h>vpBoxFilter(num_taps,
num_phases, weights, weights_bytes )
- int num_taps, num_phases;
- float *weights;
- int weights_bytes;
vpLinearFilter(num_taps,
num_phases, weights, weights_bytes )
- int num_taps, num_phases;
- float *weights;
- int weights_bytes;
vpBicubicFilter(b_value,
c_value, num_taps, num_phases, weights, weights_bytes)
- double b_value, c_value;
- int num_taps, num_phases;
- float *weights;
- int weights_bytes;
vpGaussianFilter(sigma,
num_taps, num_phases, weights, weights_bytes)
- double sigma;
- int num_taps, num_phases;
- float *weights;
- int weights_bytes;
ARGUMENTS¶
- num_taps
- Number of filter taps.
- num_phases
- Number of filter phases.
- weights
- Array containing filter weights.
- weights_bytes
- Size (in bytes) of array containing filter weights.
- b_value
- "B" parameter in the formula for a Mitchell bicubic.
- c_value
- "C" parameter in the formula for a Mitchell bicubic.
- sigma
- Standard deviation for a Gaussian.
DESCRIPTION¶
These routines can be used to initialize filter weight tables for use with vpSetFilter and vpResample. See the vpSetFilter man page for information on the num_taps and num_phases arguments. vpBoxFilter creates a filter table for a box filter (a zero-order filter). With num_taps equal to 1 the filter is a nearest-neighbor filter, suitable for low-quality upsampling. To create a decimation filter that averages down, the number of taps should equal the decimation factor (as nearly as possible). vpLinearFilter creates a filter table for a linear filter (a first-order or tent filter). With num_taps equal to 2 the filter performs linear interpolation. vpBicubicFilter creates a filter table for a Mitchell bicubic filter. The first two arguments can be used to modify the shape of the filter kernel. Some standard parameter values are:- b_value = 1, c_value = 0
- Cubic B-spline.
- b_value = 0, c_value = 0.5
- Catmull-Rom spline.
ERRORS¶
The normal return value is VP_OK. The following error return values are possible:- VPERROR_BAD_SIZE
- The filter weight table size is invalid.
- VPERROR_BAD_VALUE
- The number of phases is not a positive power of two.
SEE ALSO¶
VolPack(3), vpResample(3), vpSetFilter(3)VolPack |