use super::path::*;
use super::to_curves::*;
use super::super::curve::*;
use super::super::super::geo::*;
pub fn path_bounding_box<P: BezierPath, Bounds: BoundingBox<Point=P::Point>>(path: &P) -> Bounds {
path_to_curves(path)
.map(|curve: Curve<P::Point>| curve.bounding_box())
.reduce(|first: Bounds, second| first.union_bounds(second))
.unwrap_or_else(|| Bounds::from_min_max(P::Point::origin(), P::Point::origin()))
}
pub fn path_fast_bounding_box<P: BezierPath, Bounds: BoundingBox<Point=P::Point>>(path: &P) -> Bounds {
path_to_curves(path)
.map(|curve: Curve<P::Point>| curve.fast_bounding_box())
.reduce(|first: Bounds, second| first.union_bounds(second))
.unwrap_or_else(|| Bounds::from_min_max(P::Point::origin(), P::Point::origin()))
}