pub struct Ramp {
pub texels: Vec<u8>,
}Expand description
A gradient’s colors, tabulated and encoded for upload.
Owned by the recording rather than by the caller, because the recorder is what knows the stops and nothing outside it should have to bake them.
Fields§
§texels: Vec<u8>RAMP_WIDTH texels, RGBA, linear, four half-floats each.
Implementations§
Source§impl Ramp
impl Ramp
Sourcepub fn bake(stops: &[GradientStop]) -> Self
pub fn bake(stops: &[GradientStop]) -> Self
Tabulate stops across the width.
The stops are taken as given: in order, and covering whatever part of the range they cover. Before the first and after the last the ramp holds the end colors, which is not a tile mode — tiling happens to the parameter before it reaches the ramp, so by here the question is only what a parameter inside the table means.
Trait Implementations§
impl Eq for Ramp
impl StructuralPartialEq for Ramp
Auto Trait Implementations§
impl Freeze for Ramp
impl RefUnwindSafe for Ramp
impl Send for Ramp
impl Sync for Ramp
impl Unpin for Ramp
impl UnsafeUnpin for Ramp
impl UnwindSafe for Ramp
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