pub struct ChromaKeyNode {
pub key_color: [f32; 3],
pub tolerance: f32,
pub softness: f32,
/* private fields */
}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 RenderNode for ChromaKeyNode
Available on crate feature wgpu only.
impl RenderNode for ChromaKeyNode
Available on crate feature
wgpu only.Source§fn process(
&self,
inputs: &[&Texture],
outputs: &[&Texture],
ctx: &RenderContext,
)
fn process( &self, inputs: &[&Texture], outputs: &[&Texture], ctx: &RenderContext, )
Run the GPU render pass. Read more
Source§fn input_count(&self) -> usize
fn input_count(&self) -> usize
Number of input textures required by this node (default: 1).
Source§fn pass_count(&self) -> usize
fn pass_count(&self) -> usize
Number of render passes (default: 1). Multi-pass nodes (e.g. gaussian
blur) return 2 or more.
Source§impl RenderNodeCpu for ChromaKeyNode
impl RenderNodeCpu for ChromaKeyNode
Auto Trait Implementations§
impl !Freeze for ChromaKeyNode
impl !RefUnwindSafe for ChromaKeyNode
impl !UnwindSafe for ChromaKeyNode
impl Send for ChromaKeyNode
impl Sync for ChromaKeyNode
impl Unpin for ChromaKeyNode
impl UnsafeUnpin 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