Skip to main content

Module span_gradient

Module span_gradient 

Source
Expand description

Gradient span generator and gradient functions.

Port of agg_span_gradient.h — provides gradient shape functions (linear, radial, diamond, conic, etc.) and the main SpanGradient generator that combines an interpolator, gradient function, and color function to produce gradient-colored spans.

Structs§

GradientConic
Conic (angular) gradient: |atan2(y,x)| * d / pi.
GradientDiamond
Diamond-shaped gradient: max(|x|, |y|).
GradientRadial
Radial gradient using fast integer square root.
GradientRadialD
Radial gradient using f64 square root (higher precision).
GradientRadialFocus
Radial gradient with an off-center focal point.
GradientReflectAdaptor
Reflecting gradient adaptor — mirrors gradient values at boundaries.
GradientRepeatAdaptor
Repeating gradient adaptor — wraps gradient values with modulo.
GradientSqrtXY
Square-root XY gradient: sqrt(|x|*|y|).
GradientX
Linear gradient along the X axis.
GradientXY
XY gradient: |x|*|y| / d.
GradientY
Linear gradient along the Y axis.
SpanGradient
Main gradient span generator.

Constants§

GRADIENT_SUBPIXEL_MASK
GRADIENT_SUBPIXEL_SCALE
GRADIENT_SUBPIXEL_SHIFT

Traits§

GradientFunction
Trait for gradient shape functions.