pub struct SpanGradient<'a, G, F> { /* private fields */ }Expand description
Main gradient span generator.
Combines an interpolator (for coordinate transformation), a gradient function (for shape), and a color function (for color lookup) to produce gradient-colored pixel spans.
Port of C++ span_gradient<ColorT, Interpolator, GradientF, ColorF>.
Implementations§
Source§impl<'a, G: GradientFunction, F: ColorFunction> SpanGradient<'a, G, F>
impl<'a, G: GradientFunction, F: ColorFunction> SpanGradient<'a, G, F>
pub fn new( interpolator: SpanInterpolatorLinear, gradient_function: G, color_function: &'a F, d1: f64, d2: f64, ) -> Self
pub fn interpolator(&self) -> &SpanInterpolatorLinear
pub fn interpolator_mut(&mut self) -> &mut SpanInterpolatorLinear
pub fn gradient_function(&self) -> &G
pub fn color_function(&self) -> &F
pub fn d1(&self) -> f64
pub fn d2(&self) -> f64
pub fn set_d1(&mut self, v: f64)
pub fn set_d2(&mut self, v: f64)
Trait Implementations§
Source§impl<'a, G, F> SpanGenerator for SpanGradient<'a, G, F>
impl<'a, G, F> SpanGenerator for SpanGradient<'a, G, F>
Auto Trait Implementations§
impl<'a, G, F> Freeze for SpanGradient<'a, G, F>where
G: Freeze,
impl<'a, G, F> RefUnwindSafe for SpanGradient<'a, G, F>where
G: RefUnwindSafe,
F: RefUnwindSafe,
impl<'a, G, F> Send for SpanGradient<'a, G, F>
impl<'a, G, F> Sync for SpanGradient<'a, G, F>
impl<'a, G, F> Unpin for SpanGradient<'a, G, F>where
G: Unpin,
impl<'a, G, F> UnwindSafe for SpanGradient<'a, G, F>where
G: UnwindSafe,
F: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more