Struct retro_pixel::ImageSlice [−][src]
pub struct ImageSlice<'a, P: 'a> { /* fields omitted */ }
A shared view of some image data.
Methods
impl<'a, P: 'a> ImageSlice<'a, P>
[src]
impl<'a, P: 'a> ImageSlice<'a, P>
pub unsafe fn from_raw_parts(
width: usize,
height: usize,
pitch: isize,
ptr: *const P
) -> Self
[src]
pub unsafe fn from_raw_parts(
width: usize,
height: usize,
pitch: isize,
ptr: *const P
) -> Self
Makes an image slice from the base parts.
Absolutely no checks are performed, you must not lie to this method.
Trait Implementations
impl<'a, P: Debug + 'a> Debug for ImageSlice<'a, P>
[src]
impl<'a, P: Debug + 'a> Debug for ImageSlice<'a, P>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a, P: Clone + 'a> Clone for ImageSlice<'a, P>
[src]
impl<'a, P: Clone + 'a> Clone for ImageSlice<'a, P>
fn clone(&self) -> ImageSlice<'a, P>
[src]
fn clone(&self) -> ImageSlice<'a, P>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a, P: PartialEq + 'a> PartialEq for ImageSlice<'a, P>
[src]
impl<'a, P: PartialEq + 'a> PartialEq for ImageSlice<'a, P>
fn eq(&self, other: &ImageSlice<'a, P>) -> bool
[src]
fn eq(&self, other: &ImageSlice<'a, P>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ImageSlice<'a, P>) -> bool
[src]
fn ne(&self, other: &ImageSlice<'a, P>) -> bool
This method tests for !=
.
impl<'a, P: Eq + 'a> Eq for ImageSlice<'a, P>
[src]
impl<'a, P: Eq + 'a> Eq for ImageSlice<'a, P>
impl<'a, P: PartialOrd + 'a> PartialOrd for ImageSlice<'a, P>
[src]
impl<'a, P: PartialOrd + 'a> PartialOrd for ImageSlice<'a, P>
fn partial_cmp(&self, other: &ImageSlice<'a, P>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &ImageSlice<'a, P>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &ImageSlice<'a, P>) -> bool
[src]
fn lt(&self, other: &ImageSlice<'a, P>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &ImageSlice<'a, P>) -> bool
[src]
fn le(&self, other: &ImageSlice<'a, P>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &ImageSlice<'a, P>) -> bool
[src]
fn gt(&self, other: &ImageSlice<'a, P>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &ImageSlice<'a, P>) -> bool
[src]
fn ge(&self, other: &ImageSlice<'a, P>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, P: Ord + 'a> Ord for ImageSlice<'a, P>
[src]
impl<'a, P: Ord + 'a> Ord for ImageSlice<'a, P>
fn cmp(&self, other: &ImageSlice<'a, P>) -> Ordering
[src]
fn cmp(&self, other: &ImageSlice<'a, P>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<'a, P: Hash + 'a> Hash for ImageSlice<'a, P>
[src]
impl<'a, P: Hash + 'a> Hash for ImageSlice<'a, P>
fn hash<__HP: Hasher>(&self, state: &mut __HP)
[src]
fn hash<__HP: Hasher>(&self, state: &mut __HP)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a, P: 'a> Index<(usize, usize)> for ImageSlice<'a, P>
[src]
impl<'a, P: 'a> Index<(usize, usize)> for ImageSlice<'a, P>
type Output = P
The returned type after indexing.
fn index(&self, (x, y): (usize, usize)) -> &Self::Output
[src]
fn index(&self, (x, y): (usize, usize)) -> &Self::Output
Performs the indexing (container[index]
) operation.
impl<'a, P: 'a> ReadableImage<P> for ImageSlice<'a, P>
[src]
impl<'a, P: 'a> ReadableImage<P> for ImageSlice<'a, P>
fn width(&self) -> usize
[src]
fn width(&self) -> usize
Can't exceed isize::MAX
fn height(&self) -> usize
[src]
fn height(&self) -> usize
Can't exceed isize::MAX
fn pitch(&self) -> isize
[src]
fn pitch(&self) -> isize
Offset from the start of one row to the start of the next row.
fn as_ptr(&self) -> *const P
[src]
fn as_ptr(&self) -> *const P
Raw const pointer to the data.
fn get(&self, loc: (usize, usize)) -> Option<&P>
[src]
fn get(&self, loc: (usize, usize)) -> Option<&P>
Performs an optional indexing by reference, gives None
for out of bounds.
fn slice(&self, r: Range<(usize, usize)>) -> ImageSlice<P>
[src]
fn slice(&self, r: Range<(usize, usize)>) -> ImageSlice<P>
Grabs out a sub-slice of the data. Read more
ⓘImportant traits for ImageRefIter<'a, P>fn iter(&self) -> ImageRefIter<P>
[src]
fn iter(&self) -> ImageRefIter<P>
Lets you iterate any image by reference.
fn to_vecimage(&self) -> VecImage<P> where
Self: Sized,
P: Default + Clone,
[src]
fn to_vecimage(&self) -> VecImage<P> where
Self: Sized,
P: Default + Clone,
This is like to_owned
, you get your own version of the data. Read more
fn upscale(&self, scale: usize) -> VecImage<P> where
P: Copy + Default,
[src]
fn upscale(&self, scale: usize) -> VecImage<P> where
P: Copy + Default,
Scales up into a new VecImage
by the given amount. Read more
impl<'a, P: 'a> IntoIterator for ImageSlice<'a, P>
[src]
impl<'a, P: 'a> IntoIterator for ImageSlice<'a, P>
Auto Trait Implementations
impl<'a, P> !Send for ImageSlice<'a, P>
impl<'a, P> !Send for ImageSlice<'a, P>
impl<'a, P> !Sync for ImageSlice<'a, P>
impl<'a, P> !Sync for ImageSlice<'a, P>