Struct usvg::ConvolveMatrix[][src]

pub struct ConvolveMatrix { /* fields omitted */ }

A convolve matrix representation.

Used primarily by FeConvolveMatrix.

Implementations

impl ConvolveMatrix[src]

pub fn new(
    target_x: u32,
    target_y: u32,
    columns: u32,
    rows: u32,
    data: Vec<f64>
) -> Option<Self>
[src]

Creates a new ConvolveMatrix.

Returns None when:

  • columns * rows != data.len()
  • target_x >= columns
  • target_y >= rows

pub fn target_x(&self) -> u32[src]

Returns a matrix’s X target.

targetX in the SVG.

pub fn target_y(&self) -> u32[src]

Returns a matrix’s Y target.

targetY in the SVG.

pub fn columns(&self) -> u32[src]

Returns a number of columns in the matrix.

Part of the order attribute in the SVG.

pub fn rows(&self) -> u32[src]

Returns a number of rows in the matrix.

Part of the order attribute in the SVG.

pub fn get(&self, x: u32, y: u32) -> f64[src]

Returns a matrix value at the specified position.

Panics

  • When position is out of bounds.

pub fn data(&self) -> &[f64]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns a reference to an internal data.

Trait Implementations

impl Clone for ConvolveMatrix[src]

impl Debug for ConvolveMatrix[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.