use derive_more::{Add, AddAssign};
use strum::EnumDiscriminants;
#[derive(Clone, Debug, PartialEq)]
pub enum AbsRel {
Absolute,
Relative,
}
#[derive(Add, AddAssign, Clone, Debug, PartialEq)]
pub struct Point {
pub x: f64,
pub y: f64,
}
#[derive(Clone, Debug, PartialEq)]
pub struct Cubic {
pub ctrl1: Point,
pub ctrl2: Point,
pub to: Point,
}
#[derive(Clone, Debug, PartialEq)]
pub struct Bezier2 {
pub ctrl1: Point,
pub to: Point,
}
#[derive(Clone, Debug, PartialEq)]
pub struct Arc {
pub radii: Point,
pub x_axis_rotation: f64,
pub large_arc: bool,
pub sweep: bool,
pub to: Point,
}
#[derive(Clone, Debug, PartialEq, EnumDiscriminants)]
pub enum PathCommandKind {
MoveTo(Vec<Point>),
LineTo(Vec<Point>),
HorizontalLineTo(Vec<f64>),
VerticalLineTo(Vec<f64>),
ClosePath,
CurveTo(Vec<Cubic>),
SmoothCurveTo(Vec<Bezier2>),
QuadraticCurveTo(Vec<Bezier2>),
SmoothQuadraticCurveTo(Vec<Point>),
EllipticalArcTo(Vec<Arc>),
}
pub type PathCommand = (AbsRel, PathCommandKind);
pub type PathCommands = Vec<PathCommand>;
pub struct BBox {
pub min_x: f64,
pub max_x: f64,
pub min_y: f64,
pub max_y: f64,
}