Skip to content

WeightingFunctionName enum

Enum of built-in weighting functions.

ts
enum WeightingFunctionName {
  BOX = "Box",
  CUBIC_BC = "CubicBC",
}

BOX

A Box filter is an equal weighting function (all weights equal). DO NOT LIMIT results by support or resize point sampling will work as it requests points beyond its normal 0.0 support size.

CUBIC_BC

Cubic Filters using B,C determined values:

NameBCDescription
Mitchell-Netravali1/31/3"Balanced" cubic spline filter
Catmull-Rom01/2Interpolatory and exact on linears
Spline10B-Spline Gaussian approximation
Hermite00B-Spline interpolator
Details

See paper by Mitchell and Netravali, Reconstruction Filters in Computer Graphics Computer Graphics, Volume 22, Number 4, August 1988

Coefficents are determined from B,C values:

P0=(62B)6=coeff[0]P1=0P2=(18+12B+6C)6=coeff[1]P3=(129B6C)6=coeff[2]Q0=(8B+24C)6=coeff[3]Q1=(12B48C)6=coeff[4]Q2=(6B+30C)6=coeff[5]Q3=(1B6C)6=coeff[6]

which are used to define the filter:

P0+P1x+P2x2+P3x3,0<=x<1Q0+Q1x+Q2x2+Q3x3,1<=x<2

which ensures function is continuous in value and derivative (slope).