mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 23:08:05 +08:00
Lay Groundwork for Rust-based SVG rasterization (#1422)
* Add functions for constructing a usvg tree * Actually encode the image in the usvg tree * Implement path translation * Render document using resvg
This commit is contained in:
committed by
Keavon Chambers
parent
34f2d61257
commit
e1cdb2242d
@@ -184,7 +184,7 @@ impl NodeRuntime {
|
||||
resolution: viewport_resolution,
|
||||
..Default::default()
|
||||
},
|
||||
export_format: graphene_core::application_io::ExportFormat::Svg,
|
||||
export_format: graphene_core::application_io::ExportFormat::Canvas,
|
||||
},
|
||||
image_frame: None,
|
||||
};
|
||||
@@ -402,7 +402,7 @@ impl NodeGraphExecutor {
|
||||
use image::{ImageBuffer, Rgba};
|
||||
use std::io::Cursor;
|
||||
|
||||
let (result_bytes, width, height) = image.into_flat_u8();
|
||||
let (result_bytes, width, height) = image.to_flat_u8();
|
||||
|
||||
let mut output: ImageBuffer<Rgba<u8>, _> = image::ImageBuffer::from_raw(width, height, result_bytes).ok_or_else(|| "Invalid image size".to_string())?;
|
||||
if let Some(size) = resize {
|
||||
|
||||
Reference in New Issue
Block a user