pub enum ShadingGradient {
Axial {
coords: [f32; 4],
extend: [bool; 2],
stops: Vec<Rgba>,
},
Radial {
coords: [f32; 6],
extend: [bool; 2],
stops: Vec<Rgba>,
},
FunctionBased {
domain: [f32; 4],
matrix: Transform2D,
grid: (usize, usize),
samples: Vec<Rgba>,
},
}Expand description
Evaluated geometry + sampled colour for a Type 1–3 shading
(§8.7.4.5.2–4). The colour function is sampled at a fixed resolution
so a downstream rasteriser sees concrete RGB stops rather than an
abstract function object; the geometry (axis / circles / domain
rectangle) and Extend flags are carried so the consumer can map a
device-space point to its parametric value.
Variants§
Axial
Type 2 (axial) shading (§8.7.4.5.3): a colour blend along the
linear axis from (x0, y0) to (x1, y1).
Fields
Radial
Type 3 (radial) shading (§8.7.4.5.4): a colour blend between the
circle (x0, y0, r0) and (x1, y1, r1).
Fields
FunctionBased
Type 1 (function-based) shading (§8.7.4.5.2): the colour at every
point of the Domain rectangle is the value of a 2-in / n-out
function. Sampled onto a uniform grid over the domain.
Fields
matrix: Transform2DMatrix mapping the domain rectangle into target space.
Trait Implementations§
Source§impl Clone for ShadingGradient
impl Clone for ShadingGradient
Source§fn clone(&self) -> ShadingGradient
fn clone(&self) -> ShadingGradient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ShadingGradient
impl Debug for ShadingGradient
Source§impl PartialEq for ShadingGradient
impl PartialEq for ShadingGradient
Source§fn eq(&self, other: &ShadingGradient) -> bool
fn eq(&self, other: &ShadingGradient) -> bool
self and other values to be equal, and is used by ==.