pub struct Image<P, S = ImageSize> { /* private fields */ }Expand description
Generic image type
The image is laid out in row-major order, and can be indexed either by a
usize index or a (row, column) tuple.
0 ------------> width (columns)
| |
| |
| |
V--------------
height (rows)Implementations§
Source§impl<P: Send, S: ImageSizeLike + Sync> Image<P, S>
impl<P: Send, S: ImageSizeLike + Sync> Image<P, S>
Sourcepub fn apply_effect<F: Fn(usize, usize) -> P + Send + Sync>(
&mut self,
f: F,
threads: Option<&ThreadPool>,
)
pub fn apply_effect<F: Fn(usize, usize) -> P + Send + Sync>( &mut self, f: F, threads: Option<&ThreadPool>, )
Generates an image by computing a per-pixel function
This should be called on the output image; the closure takes (x, y)
tuples and is expected to capture one or more source images.
Source§impl<P, S: ImageSizeLike> Image<P, S>
impl<P, S: ImageSizeLike> Image<P, S>
Trait Implementations§
Source§impl<P, S: ImageSizeLike> Index<(usize, usize)> for Image<P, S>
Indexes an image with (row, col)
impl<P, S: ImageSizeLike> Index<(usize, usize)> for Image<P, S>
Indexes an image with (row, col)
Source§impl<'a, P: 'a, S> IntoIterator for &'a Image<P, S>
impl<'a, P: 'a, S> IntoIterator for &'a Image<P, S>
Auto Trait Implementations§
impl<P, S> Freeze for Image<P, S>where
S: Freeze,
impl<P, S> RefUnwindSafe for Image<P, S>where
S: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, S> Send for Image<P, S>
impl<P, S> Sync for Image<P, S>
impl<P, S> Unpin for Image<P, S>
impl<P, S> UnsafeUnpin for Image<P, S>where
S: UnsafeUnpin,
impl<P, S> UnwindSafe for Image<P, S>where
S: UnwindSafe,
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.