Trait vsvg::Crop

source ·
pub trait Crop<const N: usize>
where Self: Sized,
{ // Required methods fn transpose_axes(self) -> Self; fn crop_x(self, x: f64, keep_smaller: bool) -> ArrayVec<Self, N>; // Provided methods fn crop(self, x_min: f64, y_min: f64, x_max: f64, y_max: f64) -> Vec<Self> { ... } fn crop_y(self, y: f64, keep_smaller: bool) -> ArrayVec<Self, N> { ... } }
Expand description

Implement cropability for a geometric type.

Required Methods§

source

fn transpose_axes(self) -> Self

Transpose the geometry axes. This is used to provide a default implementation of crop_y using crop_x.

source

fn crop_x(self, x: f64, keep_smaller: bool) -> ArrayVec<Self, N>

Crop the geometry to a given vertically-split, half-plane defined with a X coordinate.

Provided Methods§

source

fn crop(self, x_min: f64, y_min: f64, x_max: f64, y_max: f64) -> Vec<Self>

Crop the geometry to a given rectangle.

source

fn crop_y(self, y: f64, keep_smaller: bool) -> ArrayVec<Self, N>

Crop the geometry to a given horizontally-split, half-plane defined with a X coordinate.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Crop<2> for Line

source§

fn transpose_axes(self) -> Self

source§

fn crop_x(self, x: f64, keep_smaller: bool) -> ArrayVec<Self, 2>

source§

impl Crop<3> for CubicBez

source§

fn transpose_axes(self) -> Self

source§

fn crop_x(self, x: f64, keep_smaller: bool) -> ArrayVec<Self, 3>

Implementors§