Skip to main content

OwnedImage

Struct OwnedImage 

Source
pub struct OwnedImage<T> { /* private fields */ }

Implementations§

Source§

impl<T> OwnedImage<T>

Source

pub fn new(shape: (usize, usize), data: Vec<T>) -> OwnedImage<T>

Source

pub fn zeros(shape: (usize, usize)) -> OwnedImage<T>
where T: Default + Clone,

Source

pub fn reshape(&mut self, new_shape: (usize, usize))

Trait Implementations§

Source§

impl<'a, T> Crop for OwnedImage<T>
where T: Clone + Debug,

Source§

fn take_rows(&mut self, n: usize) -> Result<(), ()>

Source§

fn drop_rows(&mut self, n: usize) -> Result<(), ()>

Source§

fn take_cols(&mut self, n: usize) -> Result<(), ()>

Source§

fn drop_cols(&mut self, n: usize) -> Result<(), ()>

Source§

fn central_col_crop(&mut self, n: usize) -> Result<(), ()>

Source§

fn central_row_crop(&mut self, n_rows: usize) -> Result<(), ()>

Source§

fn central_crop(&mut self, n_rows: usize, n_cols: usize) -> Result<(), ()>

Source§

impl<T> Debug for OwnedImage<T>
where T: Debug,

Source§

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

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

impl<T> FromIterator<T> for OwnedImage<T>

Source§

fn from_iter<I>(iter: I) -> OwnedImage<T>
where I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
Source§

impl<'a, T> Image for OwnedImage<T>

Source§

type Data = T

Source§

fn n_rows(&self) -> usize

Source§

fn n_cols(&self) -> usize

Source§

fn data(&self) -> &[<OwnedImage<T> as Image>::Data]

Source§

fn width(&self) -> usize

Source§

fn height(&self) -> usize

Source§

fn shape(&self) -> (usize, usize)

shape of image in rows x cols format
Source§

fn size(&self) -> usize

n_rows * n_cols
Source§

fn get_at(&self, row: usize, col: usize) -> &Self::Data

get data with position unsafe
Source§

fn get(&self, idx: usize) -> &Self::Data

get data with index unsafe
Source§

fn get_data(&self, indicies: &[usize]) -> Vec<&Self::Data>

get data with indicies unsafe
Source§

fn get_index(&self, row: usize, col: usize) -> usize

get data index for row and column
Source§

fn get_coords(&self, index: usize) -> (usize, usize)

get coordinates for index
Source§

fn is_square(&self) -> bool

Source§

fn centre_index(&self) -> usize

get data index for centre of the image
Source§

fn centre_row(&self) -> usize

get central row
Source§

fn centre_col(&self) -> usize

get central column
Source§

fn centre_position(&self) -> (usize, usize)

get row and column for central pixel
Source§

fn square_centre(&self) -> bool

determine if image has a sqaure centre ie 4 pixels make up central part
Source§

fn perimimeter_indicies_using<P>(&self, radius: usize) -> Vec<usize>
where P: Perimeter, Self: Sized,

indices for perimenter fo circle with specified radius using custom method
Source§

fn perimimeter_indicies_with(&self, method: Method, radius: usize) -> Vec<usize>
where Self: Sized,

indices for perimenter fo circle with specified radius using known method
Source§

fn perimimeter_indicies(&self, radius: usize) -> Vec<usize>
where Self: Sized,

indices for perimenter fo circle with specified radious defaults to angle carve
Source§

fn perimimeter_pixels(&self, radius: usize) -> Vec<&Self::Data>
where Self: Sized,

pixels on the perimeter of a cirlce with specified radius
Source§

fn apply_index_mask(&self, indicies: &[usize]) -> Vec<Self::Data>
where Self::Data: Copy,

Source§

fn apply_mask<I>(&self, mask_image: I) -> Vec<Self::Data>
where I: Image<Data = bool>, Self::Data: Copy,

Source§

fn mul<I>(&self, rhs: I) -> OwnedImage<Self::Data>
where I: Image<Data = Self::Data>, Self::Data: Mul<Output = Self::Data> + Copy,

Source§

fn div<I>(&self, rhs: I) -> OwnedImage<Self::Data>
where I: Image<Data = Self::Data>, Self::Data: Div<Output = Self::Data> + Copy,

Source§

fn map<T, F>(&self, f: F) -> OwnedImage<T>
where F: FnMut(&Self::Data) -> T,

Source§

fn write_tiff<P>(&self, path: P) -> Result<(), String>
where P: AsRef<Path>, Self::Data: ToColourType, [Self::Data]: TiffValue,

Source§

fn write_big_tiff<P>(&self, path: P) -> Result<(), String>
where P: AsRef<Path>, Self::Data: ToColourType, [Self::Data]: TiffValue,

Source§

fn get_tiff_writer_shape(&self) -> Result<(u32, u32), String>

Source§

impl<T> ImageMut for OwnedImage<T>

Source§

fn data_mut(&mut self) -> &mut [<OwnedImage<T> as Image>::Data]

Source§

fn get_at_mut(&mut self, row: usize, col: usize) -> &mut Self::Data

get data with position unsafe
Source§

fn get_mut(&mut self, idx: usize) -> &mut Self::Data

get data with index unsafe
Source§

fn add_to<'a, I>(&'a mut self, other: I)
where I: Image<Data = Self::Data> + 'a, Self::Data: Copy + AddAssign,

Source§

impl<'a, T> Pad for OwnedImage<T>
where T: Default + Clone,

Source§

fn pad_rows_start(&mut self, n: usize) -> Result<(), ()>

Source§

fn pad_rows_end(&mut self, n: usize) -> Result<(), ()>

Source§

fn pad_cols_start(&mut self, n: usize) -> Result<(), ()>

Source§

fn pad_cols_end(&mut self, n: usize) -> Result<(), ()>

Source§

fn central_row_pad(&mut self, n_rows: usize) -> Result<(), ()>

Source§

fn central_col_pad(&mut self, n_cols: usize) -> Result<(), ()>

Source§

fn central_pad(&mut self, n_rows: usize, n_cols: usize) -> Result<(), ()>

Source§

fn pad_to(&mut self, rows: usize, cols: usize) -> Result<(), ()>

Auto Trait Implementations§

§

impl<T> Forget for OwnedImage<T>

§

impl<T> Freeze for OwnedImage<T>
where Vec<T>: Freeze,

§

impl<T> Move for OwnedImage<T>

§

impl<T> RefUnwindSafe for OwnedImage<T>
where Vec<T>: RefUnwindSafe,

§

impl<T> Send for OwnedImage<T>
where Vec<T>: Send,

§

impl<T> Sync for OwnedImage<T>
where Vec<T>: Sync,

§

impl<T> Unpin for OwnedImage<T>
where Vec<T>: Unpin,

§

impl<T> UnsafeUnpin for OwnedImage<T>
where Vec<T>: UnsafeUnpin,

§

impl<T> UnwindSafe for OwnedImage<T>
where Vec<T>: UnwindSafe,

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<I> Fft for I
where I: Image<Data = f64>,

Source§

type Output = OwnedImage<Complex<f64>>

Source§

fn fft(&self) -> <I as Fft>::Output

Source§

fn shifted_fft(&self) -> <I as Fft>::Output

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<I> Stats for I
where I: Image<Data = f64>,

Source§

fn mean(&self) -> f64

Source§

fn var_with(&self, mean: f64) -> f64

Source§

fn std(&self) -> f64

Source§

fn var(&self) -> f64

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V