index::objects::vector_object

Struct VectorObject

Source
pub struct VectorObject {
    pub points: Vec<(f64, f64)>,
    pub fill: GradientImageOrColor,
    pub fill_rule: &'static str,
    pub stroke: GradientImageOrColor,
    pub stroke_width: f64,
    pub line_cap: &'static str,
    pub line_join: &'static str,
    pub subobjects: Vec<VectorObject>,
    pub index: usize,
}

Fields§

§points: Vec<(f64, f64)>§fill: GradientImageOrColor§fill_rule: &'static str§stroke: GradientImageOrColor§stroke_width: f64§line_cap: &'static str§line_join: &'static str§subobjects: Vec<VectorObject>§index: usize

Implementations§

Source§

impl VectorObject

Source

pub fn new() -> VectorObject

Source

pub fn get_critical_point(&self, key: (f64, f64)) -> (f64, f64)

Source

pub fn get_subobjects_recursively( &self, with_points: Option<bool>, ) -> Vec<VectorObject>

Source

pub fn match_style(&self, other: &VectorObject) -> VectorObject

Source

pub fn get_num_curves(&self) -> usize

Source

pub fn get_subcurve(&self, start: f64, end: f64) -> VectorObject

Source

pub fn get_fill_opacity(&self) -> f64

Source

pub fn get_stroke_opacity(&self) -> f64

Source

pub fn get_subpaths(&self) -> Vec<Vec<(f64, f64)>>

Source

pub fn get_bounding_box(&self) -> ((f64, f64), (f64, f64))

Source

pub fn get_center(&self) -> (f64, f64)

Source

pub fn get_center_of_mass(&self) -> (f64, f64)

Source

pub fn get_height(&self) -> f64

Source

pub fn get_width(&self) -> f64

Source

pub fn get_cubic_bezier_tuples( &self, ) -> Vec<((f64, f64), (f64, f64), (f64, f64), (f64, f64))>

Source

pub fn get_index(&self) -> usize

Source

pub fn set_index(&self, index: usize) -> Self

Source

pub fn merged_points(&self) -> Vec<(f64, f64)>

Source

pub fn increment_index(&self, increment: usize, recursive: bool) -> Self

Source

pub fn apply_function( &self, f: &impl Fn(f64, f64) -> (f64, f64), recursive: bool, about_point: Option<(f64, f64)>, about_edge: Option<(f64, f64)>, ) -> Self

Source

pub fn get_points(&self) -> &Vec<(f64, f64)>

Source

pub fn get_nth_curve_points(&self, n: usize) -> Vec<(f64, f64)>

Source

pub fn get_nth_curve_length_pieces( &self, n: usize, sample_points: Option<usize>, ) -> Vec<f64>

Source

pub fn is_closed(&self) -> bool

Source

pub fn get_partial_copy( &self, start: f64, end: f64, recursive: bool, ) -> VectorObject

Source

pub fn get_fill(&self) -> GradientImageOrColor

Source

pub fn get_stroke(&self) -> GradientImageOrColor

Source

pub fn get_stroke_width(&self) -> f64

Source

pub fn get_line_cap(&self) -> &'static str

Source

pub fn get_line_join(&self) -> &'static str

Source

pub fn get_subobjects(&self) -> Vec<VectorObject>

Source

pub fn scale(&self, scale_factor: f64, recursive: bool) -> VectorObject

Source

pub fn set_subobject(&self, index: usize, subobject: VectorObject) -> Self

Source

pub fn set_slice_subobjects( &self, start: usize, end: usize, subobjects: Vec<VectorObject>, ) -> Self

Source

pub fn stretch(&self, stretch: (f64, f64), recursive: bool) -> Self

Source

pub fn get_subobject(&self, index: usize) -> VectorObject

Source

pub fn slice_subobjects(&self, start: usize, end: usize) -> Vec<Self>

Source

pub fn shift(&self, shift: (f64, f64), recursive: bool) -> VectorObject

Source

pub fn move_to(&self, position: (f64, f64), recursive: bool) -> VectorObject

Source

pub fn set_fill( &self, fill: GradientImageOrColor, recursive: bool, ) -> VectorObject

Source

pub fn set_fill_opacity(&self, opacity: f64, recursive: bool) -> VectorObject

Source

pub fn set_stroke( &self, stroke: GradientImageOrColor, recursive: bool, ) -> VectorObject

Source

pub fn add(&self, other: &VectorObject) -> Self

Source

pub fn remove(&self, index: usize) -> Self

Source

pub fn set_stroke_opacity(&self, opacity: f64, recursive: bool) -> VectorObject

Source

pub fn set_stroke_width( &self, stroke_width: f64, recursive: bool, ) -> VectorObject

Source

pub fn set_line_cap( &self, line_cap: &'static str, recursive: bool, ) -> VectorObject

Source

pub fn set_line_join(&self, line_join: &'static str, recursive: bool) -> Self

Source

pub fn set_points(&self, points: Vec<(f64, f64)>) -> Self

Source

pub fn set_subobjects(&self, subobjects: Vec<VectorObject>) -> Self

Source

pub fn rotate(&self, angle: f64, recursive: bool) -> Self

Source

pub fn next_to_other( &self, other: &VectorObject, direction: (f64, f64), buff: f64, aligned_edge: (f64, f64), recursive: bool, ) -> Self

Source

pub fn next_to_point( &self, point: (f64, f64), direction: (f64, f64), buff: f64, aligned_edge: (f64, f64), recursive: bool, ) -> VectorObject

Source

pub fn arrange_subobjects( &self, direction: (f64, f64), buff: f64, aligned_edge: (f64, f64), recursive: bool, ) -> Self

Source

pub fn set_background_image( &self, image_base64: String, mime_type: String, width: usize, height: usize, recursive: bool, ) -> Self

Source

pub fn set_fill_image_corners( &self, top_left_corner: (f64, f64), bottom_right_corner: (f64, f64), recursive: bool, ) -> Self

Source

pub fn set_fill_rule(&self, fill_rule: &'static str, recursive: bool) -> Self

Source

pub fn get_fill_rule(&self) -> &'static str

Source

pub fn set_stroke_image_corners( &self, top_left_corner: (f64, f64), bottom_right_corner: (f64, f64), recursive: bool, ) -> Self

Source

pub fn get_fill_image_corners(&self) -> ((f64, f64), (f64, f64))

Source

pub fn get_stroke_image_corners(&self) -> ((f64, f64), (f64, f64))

Source

pub fn get_pieces(&self, n_pieces: usize) -> VectorObject

Trait Implementations§

Source§

impl Clone for VectorObject

Source§

fn clone(&self) -> VectorObject

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VectorObject

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.