pub struct VectorFrame {
pub width: f32,
pub height: f32,
pub view_box: Option<ViewBox>,
pub root: Group,
pub pts: Option<i64>,
pub time_base: TimeBase,
}Expand description
A decoded vector-graphics frame.
The width / height define the natural rendering canvas size in
user units. view_box lets a producer separate the user-coordinate
system from the canvas (an SVG viewBox attribute, or the PDF
MediaBox vs. CropBox); when None, callers should treat it as
(0, 0, width, height).
Fields§
§width: f32Viewport width in user units.
height: f32Viewport height in user units.
view_box: Option<ViewBox>Optional view box. None defaults to (0, 0, width, height).
root: GroupRoot group of the scene.
pts: Option<i64>Presentation timestamp in time_base units, or None if unknown.
time_base: TimeBaseTime base for pts. Consumers that don’t care about timing
(e.g. a one-shot SVG render) can use TimeBase::new(1, 1).
Implementations§
Source§impl VectorFrame
impl VectorFrame
Sourcepub fn new(width: f32, height: f32) -> Self
pub fn new(width: f32, height: f32) -> Self
Build a VectorFrame of the given canvas size with an empty root
group, no view box, no timestamp, and a 1/1 time base.
Sourcepub fn with_view_box(self, view_box: ViewBox) -> Self
pub fn with_view_box(self, view_box: ViewBox) -> Self
Replace the view box.
Sourcepub fn with_time_base(self, time_base: TimeBase) -> Self
pub fn with_time_base(self, time_base: TimeBase) -> Self
Replace the time base.
Trait Implementations§
Source§impl Clone for VectorFrame
impl Clone for VectorFrame
Source§fn clone(&self) -> VectorFrame
fn clone(&self) -> VectorFrame
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more