Struct v_frame::plane::PlaneSlice

source ·
pub struct PlaneSlice<'a, T: Pixel> {
    pub plane: &'a Plane<T>,
    pub x: isize,
    pub y: isize,
}

Fields§

§plane: &'a Plane<T>§x: isize§y: isize

Implementations§

source§

impl<'a, T: Pixel> PlaneSlice<'a, T>

source

pub fn as_ptr(&self) -> *const T

source

pub fn rows_iter(&self) -> RowsIter<'_, T>

source

pub fn clamp(&self) -> PlaneSlice<'a, T>

source

pub fn subslice(&self, xo: usize, yo: usize) -> PlaneSlice<'a, T>

source

pub fn reslice(&self, xo: isize, yo: isize) -> PlaneSlice<'a, T>

source

pub fn go_up(&self, i: usize) -> PlaneSlice<'a, T>

A slice starting i pixels above the current one.

source

pub fn go_left(&self, i: usize) -> PlaneSlice<'a, T>

A slice starting i pixels to the left of the current one.

source

pub fn p(&self, add_x: usize, add_y: usize) -> T

source

pub fn accessible(&self, add_x: usize, add_y: usize) -> bool

Checks if add_y and add_x lies in the allocated bounds of the underlying plane.

source

pub fn accessible_neg(&self, sub_x: usize, sub_y: usize) -> bool

Checks if -sub_x and -sub_y lies in the allocated bounds of the underlying plane.

source

pub fn row_cropped(&self, y: usize) -> &[T]

This version of the function crops off the padding on the right side of the image

source

pub fn row(&self, y: usize) -> &[T]

This version of the function includes the padding on the right side of the image

Trait Implementations§

source§

impl<'a, T: Clone + Pixel> Clone for PlaneSlice<'a, T>

source§

fn clone(&self) -> PlaneSlice<'a, T>

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<'a, T: Debug + Pixel> Debug for PlaneSlice<'a, T>

source§

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

Formats the value using the given formatter. Read more
source§

impl<'a, T: Pixel> Index<usize> for PlaneSlice<'a, T>

§

type Output = [T]

The returned type after indexing.
source§

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

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, T: Copy + Pixel> Copy for PlaneSlice<'a, T>

Auto Trait Implementations§

§

impl<'a, T> RefUnwindSafe for PlaneSlice<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for PlaneSlice<'a, T>

§

impl<'a, T> Sync for PlaneSlice<'a, T>

§

impl<'a, T> Unpin for PlaneSlice<'a, T>

§

impl<'a, T> UnwindSafe for PlaneSlice<'a, T>
where T: RefUnwindSafe,

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> 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> 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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.