Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32_ColorGradients🞂TInvertedDistanceWeightingSamplerClass

TInvertedDistanceWeightingSampler

Shepard's Inverse Distance Weighting sampler.

Inheritance:TObject 🞂 TPersistent 🞂 TNotifiablePersistent 🞂 TCustomSampler 🞂 TCustomSparsePointGradientSampler 🞂 TCustomArbitrarySparsePointGradientSampler 🞂 TInvertedDistanceWeightingSampler

Declaration ​

pascal
TInvertedDistanceWeightingSampler = class(TCustomArbitrarySparsePointGradientSampler)

Description ​

TInvertedDistanceWeightingSampler samples smooth multivariate color gradients across scattered points using Shepard's Inverse Distance Weighting (IDW).

Power=1Power=2Power=4Power=8

Mathematics & Algorithm ​

Given N scattered control points Pi with colors Ci, the interpolated color C(P) at point P=(X,Y) is computed using Shepard's method with power parameter p (Power):

wi(P)=1d(P,Pi)p=1∥(X,Y)−(Xi,Yi)∥pC(P)=∑i=1Nwi(P)Ci∑i=1Nwi(P)

If P=Pi, then C(P)=Ci.

References ​