pub enum SceneNode {
Rect {
x: f32,
y: f32,
w: f32,
h: f32,
fill: Color,
stroke: Option<Color>,
stroke_width: f32,
corner_radius: f32,
},
Circle {
cx: f32,
cy: f32,
r: f32,
fill: Color,
stroke: Option<Color>,
stroke_width: f32,
},
Path {
d: String,
fill: Option<Color>,
stroke: Option<Color>,
stroke_width: f32,
opacity: f32,
},
Text {
x: f32,
y: f32,
content: String,
font_size: f32,
color: Color,
font_weight: u16,
font_sources: Vec<String>,
},
Image {
src: String,
x: f32,
y: f32,
w: f32,
h: f32,
fit: ImageFit,
opacity: f32,
},
Video {
src: String,
time: f64,
looped: bool,
x: f32,
y: f32,
w: f32,
h: f32,
fit: ImageFit,
opacity: f32,
},
Audio {
track: AudioTrack,
},
LinearGradient {
x: f32,
y: f32,
w: f32,
h: f32,
angle_deg: f32,
stops: Vec<GradientStop>,
},
RadialGradient {
cx: f32,
cy: f32,
r: f32,
stops: Vec<GradientStop>,
},
Group {
transform: Transform2D,
opacity: f32,
children: Vec<SceneNode>,
},
Layer {
opacity: f32,
blend_mode: BlendMode,
clip: Option<ClipRegion>,
mask: Option<Vec<SceneNode>>,
mask_mode: MaskMode,
filters: Vec<SceneFilter>,
shadow: Option<SceneShadow>,
children: Vec<SceneNode>,
},
}Expand description
A node in the scene graph.
Variants§
Rect
Solid-coloured rectangle with optional corner radius.
Fields
Circle
Circle.
Path
Arbitrary SVG path string (M, L, C, Q, Z commands).
Text
Single-line text.
Fields
Image
Local raster image asset. src may be a filesystem path or file:// URI.
Video
A decoded frame from a local video file at time seconds.
Fields
Audio
Non-visual audio track collected by the output encoder.
Fields
§
track: AudioTrackLinearGradient
Linear gradient background covering a rectangle.
RadialGradient
Radial gradient background.
Group
Group with a 2D transform applied to all children.
Layer
Offscreen compositing boundary with filters, clipping, masking, shadow, and a destination blend mode.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SceneNode
impl<'de> Deserialize<'de> for SceneNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for SceneNode
Auto Trait Implementations§
impl Freeze for SceneNode
impl RefUnwindSafe for SceneNode
impl Send for SceneNode
impl Sync for SceneNode
impl Unpin for SceneNode
impl UnsafeUnpin for SceneNode
impl UnwindSafe for SceneNode
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more