pub struct EncodedGradient {
pub kind: EncodedKind,
pub transform: Affine,
pub x_advance: Vec2,
pub y_advance: Vec2,
pub ranges: Vec<GradientRange>,
pub pad: bool,
pub has_opacities: bool,
u8_lut: OnceCell<GradientLut<u8>>,
f32_lut: OnceCell<GradientLut<f32>>,
}
Expand description
An encoded gradient.
Fields§
§kind: EncodedKind
The underlying kind of gradient.
transform: Affine
A transform that needs to be applied to the position of the first processed pixel.
x_advance: Vec2
How much to advance into the x/y direction for one step in the x direction.
y_advance: Vec2
How much to advance into the x/y direction for one step in the y direction.
ranges: Vec<GradientRange>
The color ranges of the gradient.
pad: bool
Whether the gradient should be padded.
has_opacities: bool
Whether the gradient requires source_over
compositing.
u8_lut: OnceCell<GradientLut<u8>>
§f32_lut: OnceCell<GradientLut<f32>>
Implementations§
Source§impl EncodedGradient
impl EncodedGradient
Sourcepub fn u8_lut<S: Simd>(&self, simd: S) -> &GradientLut<u8>
pub fn u8_lut<S: Simd>(&self, simd: S) -> &GradientLut<u8>
Get the lookup table for sampling u8-based gradient values.
Sourcepub fn f32_lut<S: Simd>(&self, simd: S) -> &GradientLut<f32>
pub fn f32_lut<S: Simd>(&self, simd: S) -> &GradientLut<f32>
Get the lookup table for sampling f32-based gradient values.
Trait Implementations§
Source§impl Debug for EncodedGradient
impl Debug for EncodedGradient
Source§impl From<EncodedGradient> for EncodedPaint
impl From<EncodedGradient> for EncodedPaint
Source§fn from(value: EncodedGradient) -> Self
fn from(value: EncodedGradient) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for EncodedGradient
impl !RefUnwindSafe for EncodedGradient
impl Send for EncodedGradient
impl !Sync for EncodedGradient
impl Unpin for EncodedGradient
impl UnwindSafe for EncodedGradient
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