vpBoxFilter(3)
π vpBoxFilter(3) β library functions manual, bestie edition π
okay so. gather round. this is the vpBoxFilter(3) page from the VolPack library functions manual, and we're gonna build filter weight tables together. it's giving math but make it cute. no cap. π
β¨ 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β how many filter taps. that's the count, bestie.num_phasesβ how many filter phases.weightsβ the array holding the filter weights.weights_bytesβ the size, in bytes, of that weights array. bytes, not vibes.b_valueβ the "B" parameter in the formula for a Mitchell bicubic.c_valueβ the "C" parameter in the formula for a Mitchell bicubic. yes they're a matching set, we love that for them.sigmaβ the standard deviation for a Gaussian. π
π¦ DESCRIPTION π¦
so these routines initialize filter weight tables for use with vpSetFilter and vpResample. if you wanna know the tea on the num_taps and num_phases arguments, that's all in the vpSetFilter man page. go read it. i'll wait. π
vpBoxFilter creates a filter table for a box filter β that's a zero-order filter. when num_taps equals 1, the filter is a nearest-neighbor filter, which is literally perfect for low-quality upsampling. and if you wanna build a decimation filter that averages down? then the number of taps should equal the decimation factor, as nearly as possible. periodt.
vpLinearFilter creates a filter table for a linear filter β a first-order filter, aka the tent filter. with num_taps equal to 2, the filter performs linear interpolation. iconic behavior honestly.
vpBicubicFilter creates a filter table for a Mitchell bicubic filter. the first two arguments let you modify the shape of the filter kernel. some standard parameter values, for the girlies who like a preset:
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. πΈ
and if you want more details, go read this paper, it's the source of all of this: Mitchell, D.P. and Netravali, A.N., "Reconstruction filters in computer graphics," Proc. SIGGRAPH '88 (Computer Graphics V22 N4), p. 221-8. academic queen behavior. π
vpGaussianFilter creates a filter table for a gaussian filter. the first argument is the standard deviation of the gaussian. simple as that. β¨
π ERRORS π
the normal return value is VP_OK. but sometimes the universe says no, and you might get one of these:
VPERROR_BAD_SIZEβ the filter weight table size is invalid.VPERROR_BAD_VALUEβ the number of phases is not a positive power of two.
not me getting VPERROR_BAD_VALUE because i forgot powers of two exist π two, four, eight, sixteen bestie. that's the assignment.
π SEE ALSO π
and that's the whole page, you're so welcome. this came to you from the VolPack library, and yes, we're still on vpBoxFilter(3) β go forth and filter responsibly. mwah. ππ§π
π¦ where this page comes from
- fedora 43: volpack 1.0c7-35.fc43 Β· BSD-3-Clause
- fedora 43: volpack 1.0c7-35.fc43 Β· BSD-3-Clause
- fedora 44: volpack 1.0c7-36.fc44 Β· BSD-3-Clause
- fedora 44: volpack 1.0c7-36.fc44 Β· BSD-3-Clause
- Copyright (c) 1995-2008, Stanford University
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms