colour.kernel_cardinal_spline#

colour.kernel_cardinal_spline(x: ArrayLike, a: float = 0.5, b: float = 0.0) numpy.ndarray[source]#

Return the cardinal spline kernel evaluated at given samples.

Notable cardinal spline \(a\) and \(b\) parameterizations:

  • Catmull-Rom: \((a=0.5, b=0)\)

  • Cubic B-Spline: \((a=0, b=1)\)

  • Mitchell-Netravalli: \((a=\cfrac{1}{3}, b=\cfrac{1}{3})\)

Parameters
  • x (ArrayLike) – Samples at which to evaluate the cardinal spline kernel.

  • a (float) – \(a\) control parameter.

  • b (float) – \(b\) control parameter.

Returns

The cardinal spline kernel evaluated at given samples.

Return type

numpy.ndarray

References

[BB09]

Examples

>>> kernel_cardinal_spline(np.linspace(0, 1, 10))  
array([ 1.        ,  0.9711934...,  0.8930041...,  0.7777777...,  0.6378600...,
        0.4855967...,  0.3333333...,  0.1934156...,  0.0781893...,  0.        ])