Trait resvg::Render [] [src]

pub trait Render {
    fn render_to_image(
        &self,
        tree: &Tree,
        opt: &Options
    ) -> Option<Box<OutputImage>>;
fn render_node_to_image(
        &self,
        node: &Node,
        opt: &Options
    ) -> Option<Box<OutputImage>>;
fn calc_node_bbox(&self, node: &Node, opt: &Options) -> Option<Rect>; }

A generic interface for image rendering.

Instead of using backend implementation directly, you can use this trait to write backend-independent code.

Required Methods

Renders SVG to image.

Returns None if an image allocation failed.

Renders SVG node to image.

Returns None if an image allocation failed.

Calculates node's absolute bounding box.

Note: this method can be pretty expensive.

Implementors