#[repr(C, packed(1))]pub struct MaskLayer {
pub transform: [f32; 6],
pub min: [f32; 2],
pub max: [f32; 2],
pub mask_tex_idx: u32,
pub prev_mask_idx: i32,
pub kind: u32,
pub paint_style: u32,
pub stroke_half_width: f32,
pub aa_epsilon: f32,
pub p0: [f32; 4],
}Expand description
The mask layer describes an alpha channel layer that is used in the fragment shader to sample the alpha channel and apply it to the color.
Fields§
§transform: [f32; 6]A 2x3 column-major matrix, transform a vertex position to its mask texture position for atlas, or local position for sdf.
min: [f32; 2]The min bound for atlas texture space, or local rect min for sdf.
max: [f32; 2]The max bound for atlas texture space, or local rect max for sdf.
mask_tex_idx: u32The index of the texture(alpha) that contained this layer,
load_textures method provide all textures a draw phase need.
prev_mask_idx: i32The index of the previous mask layer needs to continue to be applied. The negative value means there isn’t any more mask layer that needs to be applied.
kind: u320 for atlas, 1 for sdf-rect.
paint_style: u320 for fill, 1 for stroke.
stroke_half_width: f32half stroke width in local space when paint_style is stroke.
aa_epsilon: f32anti-aliasing epsilon.
p0: [f32; 4]generic sdf parameters. for circle: [cx, cy, r, 0], for round-rect: corner radii.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MaskLayer
impl RefUnwindSafe for MaskLayer
impl Send for MaskLayer
impl Sync for MaskLayer
impl Unpin for MaskLayer
impl UnsafeUnpin for MaskLayer
impl UnwindSafe for MaskLayer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more