pub struct TransformNode {
pub translate: [f32; 2],
pub rotate: f32,
pub scale: [f32; 2],
/* private fields */
}Expand description
Apply a 2D affine transform (translate, rotate, scale) to a texture.
Pixels that fall outside the [0, 1] UV range after the inverse transform are rendered as fully transparent.
The CPU path is a no-op (passthrough); use the GPU path for actual transformation.
Fields§
§translate: [f32; 2]UV-space translation (positive = shift right/down).
rotate: f32Counter-clockwise rotation in radians.
scale: [f32; 2]Scale factors (1.0 = no change; > 1.0 = zoom in).
Implementations§
Trait Implementations§
Source§impl Default for TransformNode
impl Default for TransformNode
Source§impl RenderNode for TransformNode
Available on crate feature wgpu only.
impl RenderNode for TransformNode
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 TransformNode
impl RenderNodeCpu for TransformNode
Auto Trait Implementations§
impl !Freeze for TransformNode
impl !RefUnwindSafe for TransformNode
impl !UnwindSafe for TransformNode
impl Send for TransformNode
impl Sync for TransformNode
impl Unpin for TransformNode
impl UnsafeUnpin for TransformNode
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