pub struct Output { /* private fields */ }Expand description
Opaque handle to one scene that has already been rendered.
Each output method borrows this handle, publishes its requested file immediately and returns a shared handle to the same frozen scene for chaining. Publication failure leaves the original handle usable; cloning never renders again.
Terminal methods complete the final native filename with their conventional
lowercase suffix. A filename already ending in the complete expected suffix
under ASCII case-insensitive comparison is preserved exactly; otherwise the
suffix is appended literally. Other filename text is never interpreted or
replaced, so plot.v1 becomes plot.v1.svg and plot.png passed to
Output::svg becomes plot.png.svg.
Suffix completion happens only after format conversion succeeds. The caller path must have a filename and must not currently identify a directory. Its parent must already exist.
Implementations§
Source§impl Output
impl Output
Sourcepub fn compose(
&self,
items: impl IntoIterator<Item = Placement>,
) -> Result<Composite>
pub fn compose( &self, items: impl IntoIterator<Item = Placement>, ) -> Result<Composite>
Compose independently prepared items on this base.
Sourcepub fn compose_with_options(
&self,
items: impl IntoIterator<Item = Placement>,
options: ComposeOptions,
) -> Result<Composite>
pub fn compose_with_options( &self, items: impl IntoIterator<Item = Placement>, options: ComposeOptions, ) -> Result<Composite>
Compose using an explicit viewport policy.
Sourcepub fn compose_with_operation(
&self,
items: impl IntoIterator<Item = Placement>,
options: ComposeOptions,
operation: &OperationOptions,
) -> Result<Composite>
pub fn compose_with_operation( &self, items: impl IntoIterator<Item = Placement>, options: ComposeOptions, operation: &OperationOptions, ) -> Result<Composite>
Compose with this call’s cancellation and viewport policy.
Source§impl Output
impl Output
Sourcepub fn save_with(
&self,
path: impl AsRef<Path>,
format: impl Into<Format>,
) -> Result<Output>
pub fn save_with( &self, path: impl AsRef<Path>, format: impl Into<Format>, ) -> Result<Output>
Publish one complete image atomically, according to the selected device. The returned Output is the complete immutable scene.
Sourcepub fn save_with_operation(
&self,
path: impl AsRef<Path>,
format: impl Into<Format>,
options: &OperationOptions,
) -> Result<Output>
pub fn save_with_operation( &self, path: impl AsRef<Path>, format: impl Into<Format>, options: &OperationOptions, ) -> Result<Output>
Publish a file under one operation, from preparation through install.
Sourcepub fn encode(&self, format: impl Into<Format>) -> Result<Arc<[u8]>>
pub fn encode(&self, format: impl Into<Format>) -> Result<Arc<[u8]>>
Encode a complete device artifact in immutable owned memory.
Sourcepub fn encode_with_operation(
&self,
format: impl Into<Format>,
options: &OperationOptions,
) -> Result<Arc<[u8]>>
pub fn encode_with_operation( &self, format: impl Into<Format>, options: &OperationOptions, ) -> Result<Arc<[u8]>>
Encode in memory under this call’s operation options.
Sourcepub fn write_to(
&self,
writer: &mut dyn Write,
format: impl Into<Format>,
) -> Result<Output>
pub fn write_to( &self, writer: &mut dyn Write, format: impl Into<Format>, ) -> Result<Output>
Write one complete artifact at the writer’s current position. A failed external write may report a confirmed prefix.
Sourcepub fn write_to_with_operation(
&self,
writer: &mut dyn Write,
format: impl Into<Format>,
options: &OperationOptions,
) -> Result<Output>
pub fn write_to_with_operation( &self, writer: &mut dyn Write, format: impl Into<Format>, options: &OperationOptions, ) -> Result<Output>
Write to a borrowed stream under one operation.
Sourcepub fn pixels(&self) -> Result<PixelBuffer>
pub fn pixels(&self) -> Result<PixelBuffer>
Read source-sized, straight RGBA8 samples of the complete scene.
Sourcepub fn pixels_with_options(&self, options: PixelOptions) -> Result<PixelBuffer>
pub fn pixels_with_options(&self, options: PixelOptions) -> Result<PixelBuffer>
Read immutable samples with explicit sampling and representation.
Sourcepub fn pixels_with_options_with_operation(
&self,
options: PixelOptions,
operation_options: &OperationOptions,
) -> Result<PixelBuffer>
pub fn pixels_with_options_with_operation( &self, options: PixelOptions, operation_options: &OperationOptions, ) -> Result<PixelBuffer>
Read immutable samples using this call’s operation options.
Sourcepub fn pixels_into(&self, target: PixelTarget<'_>) -> Result<()>
pub fn pixels_into(&self, target: PixelTarget<'_>) -> Result<()>
Fill the actual logical pixels of a caller-owned buffer.
Sourcepub fn pixels_into_with_options(
&self,
target: PixelTarget<'_>,
options: PixelOptions,
) -> Result<()>
pub fn pixels_into_with_options( &self, target: PixelTarget<'_>, options: PixelOptions, ) -> Result<()>
Fill a caller-owned target using the requested pixel options.
Sourcepub fn pixels_into_with_options_with_operation(
&self,
target: PixelTarget<'_>,
options: PixelOptions,
operation_options: &OperationOptions,
) -> Result<()>
pub fn pixels_into_with_options_with_operation( &self, target: PixelTarget<'_>, options: PixelOptions, operation_options: &OperationOptions, ) -> Result<()>
Fill a caller-owned target in one cancellable operation.
Source§impl Output
impl Output
Sourcepub fn width(&self) -> f64
pub fn width(&self) -> f64
Frozen canonical scene width in CSS pixels.
This is the SVG root width, independent of PNG raster sizing. Inspecting it does not measure, render, or alter the retained scene.
Sourcepub fn height(&self) -> f64
pub fn height(&self) -> f64
Frozen canonical scene height in CSS pixels.
This is the SVG root height, independent of PNG raster sizing. All chained publications retain the same canonical dimensions.
Sourcepub fn physical_size(&self) -> Option<PhysicalSize>
pub fn physical_size(&self) -> Option<PhysicalSize>
Original physical size request, if this root was explicitly sized in an absolute publication unit.
Sourcepub fn layout_report(&self) -> Result<&LayoutReport, Error>
pub fn layout_report(&self) -> Result<&LayoutReport, Error>
Read the same accepted layout retained by this frozen output.
Sourcepub fn image_font_substitutions(&self) -> Vec<ImageFontSubstitution>
pub fn image_font_substitutions(&self) -> Vec<ImageFontSubstitution>
Actual font substitutions made for external SVG image text during this scene’s preparation. Reading the records never selects fonts.
Sourcepub fn svg(&self, path: impl AsRef<Path>) -> Result<Self, Error>
pub fn svg(&self, path: impl AsRef<Path>) -> Result<Self, Error>
Publish a self-contained outlined SVG atomically.
After text outlining succeeds, the final native filename is completed
with .svg. A complete ASCII case-insensitive match such as .SVG is
preserved exactly; otherwise .svg is appended without interpreting an
existing extension.
Sourcepub fn svg_with_operation(
&self,
path: impl AsRef<Path>,
options: &OperationOptions,
) -> Result<Self, Error>
pub fn svg_with_operation( &self, path: impl AsRef<Path>, options: &OperationOptions, ) -> Result<Self, Error>
Publish outlined SVG under the supplied operation options.
Sourcepub fn svg_preserve_text(&self, path: impl AsRef<Path>) -> Result<Self, Error>
pub fn svg_preserve_text(&self, path: impl AsRef<Path>) -> Result<Self, Error>
Publish SVG with selectable and searchable text atomically.
The final filename is completed with .svg using the literal
suffix rule documented on Output.
Sourcepub fn svg_preserve_text_with_operation(
&self,
path: impl AsRef<Path>,
options: &OperationOptions,
) -> Result<Self, Error>
pub fn svg_preserve_text_with_operation( &self, path: impl AsRef<Path>, options: &OperationOptions, ) -> Result<Self, Error>
Publish selectable-text SVG under the supplied operation options.
Sourcepub fn png(&self, path: impl AsRef<Path>) -> Result<Self, Error>
pub fn png(&self, path: impl AsRef<Path>) -> Result<Self, Error>
Publish a 300-DPI balanced-compression PNG atomically.
The final native filename is completed with .png by
Output::png_with_options after rasterization succeeds.
Sourcepub fn png_with_operation(
&self,
path: impl AsRef<Path>,
options: &OperationOptions,
) -> Result<Self, Error>
pub fn png_with_operation( &self, path: impl AsRef<Path>, options: &OperationOptions, ) -> Result<Self, Error>
Publish default PNG with the supplied operation options.
Sourcepub fn png_preview(&self, path: impl AsRef<Path>) -> Result<Self, Error>
pub fn png_preview(&self, path: impl AsRef<Path>) -> Result<Self, Error>
Publish a source-sized balanced-compression PNG without density metadata.
The final native filename is completed with .png by
Output::png_with_options after rasterization succeeds.
Sourcepub fn png_preview_with_operation(
&self,
path: impl AsRef<Path>,
options: &OperationOptions,
) -> Result<Self, Error>
pub fn png_preview_with_operation( &self, path: impl AsRef<Path>, options: &OperationOptions, ) -> Result<Self, Error>
Publish source-sized PNG with the supplied operation options.
Sourcepub fn png_with_options(
&self,
path: impl AsRef<Path>,
options: PngOptions,
) -> Result<Self, Error>
pub fn png_with_options( &self, path: impl AsRef<Path>, options: PngOptions, ) -> Result<Self, Error>
Publish a PNG atomically using the exact caller-provided options.
After rasterization succeeds, the final native filename is completed
with .png. A complete ASCII case-insensitive match such as .PNG is
preserved exactly; otherwise .png is appended without interpreting an
existing extension.
Sourcepub fn png_with_options_with_operation(
&self,
path: impl AsRef<Path>,
options: PngOptions,
operation: &OperationOptions,
) -> Result<Self, Error>
pub fn png_with_options_with_operation( &self, path: impl AsRef<Path>, options: PngOptions, operation: &OperationOptions, ) -> Result<Self, Error>
Publish PNG using the device and cancellation options.
Trait Implementations§
Source§impl From<&Output> for PanelImage
impl From<&Output> for PanelImage
Source§impl From<&Output> for CompositionSource
impl From<&Output> for CompositionSource
Source§impl From<Output> for PanelImage
impl From<Output> for PanelImage
Source§impl From<Output> for CompositionSource
impl From<Output> for CompositionSource
Source§impl TryFrom<&Output> for PanelContent
impl TryFrom<&Output> for PanelContent
Auto Trait Implementations§
impl Forget for Output
impl Freeze for Outputwhere
*const ArcInner<RenderedScene> is !null: Freeze,
PhantomData<ArcInner<RenderedScene>>: Freeze,
impl Move for Output
impl RefUnwindSafe for Outputwhere
Atomic<usize>: RefUnwindSafe,
NonZero<u32>: RefUnwindSafe,
OnceLock<AssetView>: RefUnwindSafe,
OnceLock<Arc<[u8]>>: RefUnwindSafe,
impl Send for Output
impl Sync for Output
impl Unpin for Output
impl UnsafeUnpin for Outputwhere
*const ArcInner<RenderedScene> is !null: UnsafeUnpin,
PhantomData<ArcInner<RenderedScene>>: UnsafeUnpin,
impl UnwindSafe for Outputwhere
Arc<RenderedScene>: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
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
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> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.