From 6deeee3848e291dee61e239f104dc29bb26f4608 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Tue, 16 Dec 2025 11:09:49 +0100 Subject: Benchmark with example, and raw rendering --- src/lib.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index b56c670..de4146d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,6 +19,7 @@ pub use configuration::{ pub use stage_type::StageType; use thiserror::Error; +use cairo::ImageSurface; /// Error types for rendering #[derive(Debug, Error)] @@ -86,6 +87,25 @@ pub fn render_to_svg( renderer::render_to_svg(map, stage_type, config) } +/// Renders a Wardley map to a cairo context. +/// +/// # Arguments +/// +/// * `map` - The parsed Wardley map +/// * `stage_type` - The stage type to use for axis labels +/// * `config` - Configuration options +/// +/// # Returns +/// +/// A string containing the SVG data +pub fn render_to_surface( + map: &Map, + stage_type: StageType, + config: &Configuration, +) -> Result { + renderer::render_to_surface(map, stage_type, config) +} + #[cfg(test)] mod tests { use super::*; -- cgit