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

TBilinearGradientSampler

Samples color gradients across 4 points using bilinear interpolation.

Inheritance:TObject 🞂 TPersistent 🞂 TNotifiablePersistent 🞂 TCustomSampler 🞂 TCustomSparsePointGradientSampler 🞂 TBilinearGradientSampler

Declaration ​

pascal
TBilinearGradientSampler = class(TCustomSparsePointGradientSampler)

Description ​

A sparse point gradient interpolator using a inverse bilinear interpolation.

Based on four (and only four) vertices, with each vertex specified with a certain color, an inverse bilinear interpolation of color is calculated. Outside this the colours extends as before, but discontinuities may occur.

Mathematics & Algorithm ​

Given 4 vertex coordinates P00,P10,P01,P11 and colors C00,C10,C01,C11, sampling coordinates (u,v)∈[0,1]×[0,1] parameterize the unit quad:

P(u,v)=(1−u)(1−v)P00+u(1−v)P10+(1−u)vP01+uvP11C(u,v)=(1−u)(1−v)C00+u(1−v)C10+(1−u)vC01+uvC11

References ​