pub mod affine;
pub mod arclen;
mod far;
mod hash;
#[doc(hidden)]
pub mod parity;
pub mod query;
pub mod raster;
mod scene;
pub mod shapes;
pub mod spatial;
mod stroke;
mod tree;
pub mod trim;
#[cfg(test)]
mod tests;
pub use far::{MAX_DEVICE, project_far};
pub use hash::StableHash;
pub use kurbo;
pub use scene::{IRect, PaintKind, ScenePaint, SceneStop, VectorOp, VectorScene};
pub use stroke::{StrokeStyle, stroke_outline};
pub use tree::{
EvaluatedGeometry, EvaluatedItem, EvaluatedPath, EvaluatedSubpath, EvaluatedTransform,
EvaluatedVertex, ItemPath, build_scene, build_scene_in, build_scene_with_items, item_paths,
scene_paint,
};
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
pub struct CanvasSize {
pub width: u32,
pub height: u32,
}
impl CanvasSize {
#[must_use]
pub const fn new(width: u32, height: u32) -> Self {
Self { width, height }
}
#[must_use]
pub fn scale(self) -> kurbo::Vec2 {
kurbo::Vec2::new(f64::from(self.width), f64::from(self.height))
}
#[must_use]
pub fn unit(self) -> f64 {
f64::from(self.width.min(self.height))
}
#[must_use]
pub fn point(self, x: f64, y: f64) -> kurbo::Point {
kurbo::Point::new(x * f64::from(self.width), y * f64::from(self.height))
}
}