Skip to main content

GradientFunction

Trait GradientFunction 

Source
pub trait GradientFunction {
    // Required method
    fn calculate(&self, x: i32, y: i32, d: i32) -> i32;
}
Expand description

Trait for gradient shape functions.

Maps a 2D point (x, y) to a scalar distance value. The d parameter is the gradient diameter/range (used by some gradient types like XY, conic).

Required Methods§

Source

fn calculate(&self, x: i32, y: i32, d: i32) -> i32

Implementors§