vpBoxFilter(3)
π vpBoxFilter β the filter weight table glow-up π
okay bestie, welcome to vpBoxFilter(3) from the Library Functions Manual. this is the one where you build filter weight tables, and honestly? it's giving math but make it cute. π
she's the whole girl group: vpBoxFilter, vpLinearFilter, vpBicubicFilter, and vpGaussianFilter β four functions, one mission: initialize a filter weight table. periodt. β¨
πΈ 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;
copy that exactly, no cap. π«Ά
β¨ ARGUMENTS β¨
num_tapsβ the number of filter taps, bestie. how many lil sips the filter takes. πnum_phasesβ the number of filter phases. yes it's a whole phase era.weightsβ the array holding the filter weights. this is where the magic gets stored. πweights_bytesβ how big that array is, in bytes. size check, slay.b_valueβ the "B" parameter in the formula for a Mitchell bicubic. iconic letter.c_valueβ the "C" parameter in the formula for a Mitchell bicubic. her sister. πsigmaβ the standard deviation for a Gaussian. spread it out, babe. π
π DESCRIPTION π
so these routines initialize filter weight tables for use with vpSetFilter and vpResample. if you wanna know what num_taps and num_phases are actually doing, go read the vpSetFilter man page β she explains it. iykyk. π
πΈ vpBoxFilter
creates a filter table for a box filter β that's a zero-order filter, babes. when num_taps equals 1, the filter is a nearest-neighbor filter, which is suitable for low-quality upsampling. (low-quality! she said it, not me. π)
and if you wanna 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 β that's a first-order filter, aka a tent filter, and yes the tent is camping. βΊ
with num_taps equal to 2, the filter performs linear interpolation. chef's kiss. π
πΈ vpBicubicFilter
creates a filter table for a Mitchell bicubic filter. the first two arguments let you modify the shape of the filter kernel β customizing her silhouette, honestly. some standard parameter values, bestie:
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 for more details, go read this paper β it's real, i'm not making it up:
Mitchell, D.P. and Netravali, A.N., "Reconstruction filters in computer graphics," Proc. SIGGRAPH '88 (Computer Graphics V22 N4), p. 221-8.
academic baddies only. ππ
πΈ vpGaussianFilter
creates a filter table for a gaussian filter. the first argument is the standard deviation of the gaussian. that's it, that's the vibe. πΈ
π ERRORS π
the normal return value is VP_OK. if you get anything else, something's off and we're gonna talk about it. possible error return values:
VPERROR_BAD_SIZEβ the filter weight table size is invalid. πVPERROR_BAD_VALUEβ the number of phases is not a positive power of two. and no, bestie, that one's non-negotiable. π
π¦ SEE ALSO π¦
go read them, they're all part of the same friend group. π«Ά
reminder bestie: this whole page is VolPack's, and it's filed under vpBoxFilter(3). treat her with respect. π
and that's the page, queen. you understood it, you ate, no crumbs. slay π β¨
π¦ where this page comes from
- debian bookworm: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- debian trixie: libvolpack1-dev 1.0b3-10 Β· BSD-3-Clause
- ubuntu jammy: libvolpack1-dev 1.0b3-9 Β· BSD-3-Clause
- ubuntu noble: libvolpack1-dev 1.0b3-9.1 Β· BSD-3-Clause
- ubuntu questing: libvolpack1-dev 1.0b3-11
- ubuntu resolute: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- ubuntu stonking: libvolpack1-dev 1.0b3-11build1 Β· BSD-3-Clause
- Copyright (c) 1994 The Board of Trustees of The Leland Stanford
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms