#[repr(C, packed(1))]pub struct FilterPrimitive {
pub color_matrix: [f32; 16],
pub sample_offset: [f32; 2],
pub offset: [f32; 2],
pub mask_offset: [f32; 2],
pub kernel_size: [i32; 2],
pub mask_head: i32,
pub composite: i32,
pub dummy: [f32; 2],
pub base_color: [f32; 4],
}Fields§
§color_matrix: [f32; 16]§sample_offset: [f32; 2]The origin of the image placed in texture. Used to locate the original image position in the texture.
offset: [f32; 2]Filter effect offset for drop-shadow etc. This offset is applied during filter convolution sampling to create displaced effects like shadows.
mask_offset: [f32; 2]The origin of the mask layer in the texture.
kernel_size: [i32; 2]The size of the filter kernel.
mask_head: i32The index of the head mask layer.
composite: i32The composite mode for filter application.
- 0 = Replace: filter result completely replaces the original content
- 1 = ExcludeSource: filter result is only applied where original alpha is 0
dummy: [f32; 2]Explicit padding to align base_color to the 16-byte boundary required
by WGSL vec4<f32>. Do NOT remove — removing this will corrupt the GPU
struct layout and cause base_color to be read as zeros.
base_color: [f32; 4]the final pix color will be color * color_matrix + base_color
Trait Implementations§
Source§impl AsBytes for FilterPrimitive
impl AsBytes for FilterPrimitive
Source§impl Clone for FilterPrimitive
impl Clone for FilterPrimitive
Source§fn clone(&self) -> FilterPrimitive
fn clone(&self) -> FilterPrimitive
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FilterPrimitive
impl Debug for FilterPrimitive
Source§impl PartialEq for FilterPrimitive
impl PartialEq for FilterPrimitive
impl Copy for FilterPrimitive
impl StructuralPartialEq for FilterPrimitive
Auto Trait Implementations§
impl Freeze for FilterPrimitive
impl RefUnwindSafe for FilterPrimitive
impl Send for FilterPrimitive
impl Sync for FilterPrimitive
impl Unpin for FilterPrimitive
impl UnsafeUnpin for FilterPrimitive
impl UnwindSafe for FilterPrimitive
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
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>
Converts
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>
Converts
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