canvaskit-wasm 0.39
build 2026-04-29
CubicResampler
A plain JS object describing a Mitchell-Netravali bicubic resampling kernel. Two scalars — B and C — pick a point in the resampling family. Useful for high-quality image scaling (smoother than Linear, sharper than Mitchell defaults).
const sampler = { B: 0, C: 0.5 }; // Catmull-Rom
Fields
| Field | Type | Notes |
|---|---|---|
B | number | The "B" parameter. 1/3 is Mitchell-Netravali (smooth); 0 with C = 0.5 is Catmull-Rom (sharper). |
C | number | The "C" parameter. |
Where it's accepted
Wherever an API takes a sampling argument that isn't a FilterMode + MipmapMode pair:
Image.makeShaderCubicImageFilter.MakeImageImageFilter.MakeMatrixTransformCanvas.drawImageCubic(when present in the build)
See also
FilterOptions— alternative sampling description (linear / nearest + mipmap).