---
name: "FilterTab"
section: "3"
platform: "linux"
package: "libvolpack1-dev"
version: "1.0b3-10"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/FilterTab"
---

# FilterTab(3)

initialize a filter weight table

## NAME

vpBoxFilter, vpLinearFilter, vpBicubicFilter, vpGaussianFilter - initialize a filter weight table

## SYNOPSIS

\#include \<volpack.h\>

vpResult

**vpBoxFilter(***num\_taps, num\_phases, weights, weights\_bytes***)**

-

  int *num\_taps, num\_phases*;

-

  float \**weights*;

-

  int *weights\_bytes*;

vpResult

**vpLinearFilter(***num\_taps, num\_phases, weights, weights\_bytes***)**

-

  int *num\_taps, num\_phases*;

-

  float \**weights*;

-

  int *weights\_bytes*;

vpResult

**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*;

vpResult

**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.

With four filter taps the cubic B-spline filter is suitable for upsampling.  For more details, see the following paper: Mitchell, D.P. and Netravali, A.N., "Reconstruction filters in computer graphics," Proc. SIGGRAPH '88 (Computer Graphics V22 N4), p. 221-8.

**vpGaussianFilter** creates a filter table for a gaussian filter. The first argument is the standard deviation of the gaussian.

## 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)](/VolPack/3.md), vpResample(3), vpSetFilter(3)
