diff options
| author | Ruben Beltran del Rio <jj@r.bdr.sh> | 2025-12-16 11:09:49 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <jj@r.bdr.sh> | 2025-12-16 11:15:32 +0100 |
| commit | 6deeee3848e291dee61e239f104dc29bb26f4608 (patch) | |
| tree | e97308fc347e2abef2272942a7e5d71e56ac0469 /src/lib.rs | |
| parent | f08648e4b5a9f7855a2ed9068a386e2f3c596322 (diff) | |
Benchmark with example, and raw rendering
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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<ImageSurface, RenderError> { + renderer::render_to_surface(map, stage_type, config) +} + #[cfg(test)] mod tests { use super::*; |