pub struct ColorMatrix {
pub rows: [[f32; 4]; 3],
}Fields§
§rows: [[f32; 4]; 3]Implementations§
Source§impl ColorMatrix
impl ColorMatrix
pub const IDENTITY: ColorMatrix
pub const fn new(rows: [[f32; 4]; 3]) -> Self
pub fn saturate(amount: f32) -> Self
pub fn grayscale() -> Self
pub fn brightness(amount: f32) -> Self
pub fn contrast(amount: f32) -> Self
pub fn invert() -> Self
pub fn tint(color: Color) -> Self
pub fn then(&self, next: &ColorMatrix) -> ColorMatrix
Trait Implementations§
Source§impl Clone for ColorMatrix
impl Clone for ColorMatrix
impl Copy for ColorMatrix
Source§impl Debug for ColorMatrix
impl Debug for ColorMatrix
Source§impl PartialEq for ColorMatrix
impl PartialEq for ColorMatrix
Source§impl ShaderEffect for ColorMatrix
impl ShaderEffect for ColorMatrix
const WGSL: &'static str = "fn effect(in: EffectInput) -> vec4<f32> {\n let color = sample_content(in.local);\n if (color.a <= 0.0) {\n return vec4<f32>(0.0);\n }\n let straight = vec4<f32>(color.rgb / color.a, 1.0);\n let mapped = vec3<f32>(dot(param(0), straight), dot(param(1), straight), dot(param(2), straight));\n return vec4<f32>(clamp(mapped, vec3<f32>(0.0), vec3<f32>(1.0)) * color.a, color.a);\n}\n"
const INPUTS: Inputs = Inputs::CONTENT
fn uniforms(&self, uniforms: &mut [f32; 16])
const CLOCK: Option<usize> = None
fn margin(&self) -> f32
fn content_blur(&self) -> f32
fn backdrop_blur(&self) -> f32
fn backdrop_reach(&self) -> Option<f32>
impl StructuralPartialEq for ColorMatrix
Auto Trait Implementations§
impl Forget for ColorMatrix
impl Freeze for ColorMatrix
impl Move for ColorMatrix
impl RefUnwindSafe for ColorMatrix
impl Send for ColorMatrix
impl Sync for ColorMatrix
impl Unpin for ColorMatrix
impl UnsafeUnpin for ColorMatrix
impl UnwindSafe for ColorMatrix
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