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:
Dennis Kobert
2023-10-17 11:02:07 -07:00
committed by Keavon Chambers
parent 34f2d61257
commit e1cdb2242d
10 changed files with 585 additions and 46 deletions
+4 -4
View File
@@ -16,7 +16,7 @@ use std::fmt::{Debug, Formatter, Result};
/// Representation of the handle point(s) in a bezier segment.
#[derive(Copy, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
enum BezierHandles {
pub enum BezierHandles {
Linear,
/// Handles for a quadratic curve.
Quadratic {
@@ -42,11 +42,11 @@ unsafe impl dyn_any::StaticType for BezierHandles {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Bezier {
/// Start point of the bezier curve.
start: DVec2,
pub start: DVec2,
/// Start point of the bezier curve.
end: DVec2,
pub end: DVec2,
/// Handles of the bezier curve.
handles: BezierHandles,
pub handles: BezierHandles,
}
impl Debug for Bezier {
+1 -1
View File
@@ -16,7 +16,7 @@ use std::ops::{Index, IndexMut};
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Subpath<ManipulatorGroupId: crate::Identifier> {
manipulator_groups: Vec<ManipulatorGroup<ManipulatorGroupId>>,
closed: bool,
pub closed: bool,
}
#[cfg(feature = "dyn-any")]