pub struct ChromaKeyNode {
pub key_color: [f32; 3],
pub tolerance: f32,
pub softness: f32,
}Expand description
Remove a solid colour from a texture by chroma distance, producing alpha.
The algorithm computes the Euclidean distance between the pixel’s chroma
vector (RGB − luma) and the key colour’s chroma vector, then applies a soft
threshold to set the alpha channel. Pixels that match key_color within
tolerance become fully transparent; pixels further than tolerance + softness stay fully opaque.
Fields§
§key_color: [f32; 3]Key colour in linear RGB [0.0, 1.0].
tolerance: f32Chroma distance threshold (0.0–1.0).
softness: f32Edge feather width (0.0–1.0).
Implementations§
Trait Implementations§
Source§impl RenderNodeCpu for ChromaKeyNode
impl RenderNodeCpu for ChromaKeyNode
Auto Trait Implementations§
impl Freeze for ChromaKeyNode
impl RefUnwindSafe for ChromaKeyNode
impl Send for ChromaKeyNode
impl Sync for ChromaKeyNode
impl Unpin for ChromaKeyNode
impl UnsafeUnpin for ChromaKeyNode
impl UnwindSafe for ChromaKeyNode
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