#[repr(C)]pub struct ColorMatrix(pub [f32; 20]);Expand description
标准 4×5 RGBA 色彩变换矩阵(行主序,第 5 列为归一化偏移 [-1.0..=1.0],对齐 Skia SkColorMatrix / SVG <feColorMatrix>)。
Tuple Fields§
§0: [f32; 20]Implementations§
Source§impl ColorMatrix
impl ColorMatrix
Sourcepub fn saturate(amount: f32) -> Self
pub fn saturate(amount: f32) -> Self
饱和度调整(amount = 0.0 为灰度,1.0 保持不变,> 1.0 增强鲜艳度,毛玻璃常配 1.4~1.8)。
Sourcepub fn brightness(amount: f32) -> Self
pub fn brightness(amount: f32) -> Self
亮度调整(1.0 保持不变,> 1.0 提亮,< 1.0 压暗)。
Sourcepub fn hue_rotate(deg: f32) -> Self
pub fn hue_rotate(deg: f32) -> Self
色相旋转(角度制 deg)。
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 Default for ColorMatrix
impl Default for ColorMatrix
impl Eq 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。