[−][src]Struct awmpde_structs::GrayAlphaImage
Methods from Deref<Target = GrayAlphaImage>
pub fn as_raw(&self) -> &Container
[src]
Returns the underlying raw buffer
pub fn dimensions(&self) -> (u32, u32)
[src]
The width and height of this image.
pub fn width(&self) -> u32
[src]
The width of this image.
pub fn height(&self) -> u32
[src]
The height of this image.
pub fn pixels(&self) -> Pixels<'_, P>
[src]
Returns an iterator over the pixels of this image. The iteration order is x = 0 to width then y = 0 to height
pub fn rows(&self) -> Rows<'_, P>
[src]
Returns an iterator over the rows of this image.
Only non-empty rows can be iterated in this manner. In particular the iterator will not
yield any item when the width of the image is 0
or a pixel type without any channels is
used. This ensures that its length can always be represented by usize
.
pub fn enumerate_pixels(&self) -> EnumeratePixels<'_, P>
[src]
Enumerates over the pixels of the image. The iterator yields the coordinates of each pixel along with a reference to them. The iteration order is x = 0 to width then y = 0 to height
pub fn enumerate_rows(&self) -> EnumerateRows<'_, P>
[src]
Enumerates over the rows of the image. The iterator yields the y-coordinate of each row along with a reference to them.
pub fn get_pixel(&self, x: u32, y: u32) -> &P
[src]
Gets a reference to the pixel at location (x, y)
Panics
Panics if (x, y)
is out of the bounds (width, height)
.
pub fn sample_layout(&self) -> SampleLayout
[src]
Get the format of the buffer when viewed as a matrix of samples.
pub fn as_flat_samples(&self) -> FlatSamples<&[<P as Pixel>::Subpixel]> where
Container: AsRef<[<P as Pixel>::Subpixel]>,
[src]
Container: AsRef<[<P as Pixel>::Subpixel]>,
Return a view on the raw sample buffer.
See into_flat_samples
for more details.
pub fn as_flat_samples_mut(
&mut self
) -> FlatSamples<&mut [<P as Pixel>::Subpixel]> where
Container: AsMut<[<P as Pixel>::Subpixel]>,
[src]
&mut self
) -> FlatSamples<&mut [<P as Pixel>::Subpixel]> where
Container: AsMut<[<P as Pixel>::Subpixel]>,
Return a mutable view on the raw sample buffer.
See into_flat_samples
for more details.
pub fn pixels_mut(&mut self) -> PixelsMut<'_, P>
[src]
Returns an iterator over the mutable pixels of this image.
pub fn rows_mut(&mut self) -> RowsMut<'_, P>
[src]
Returns an iterator over the mutable rows of this image.
Only non-empty rows can be iterated in this manner. In particular the iterator will not
yield any item when the width of the image is 0
or a pixel type without any channels is
used. This ensures that its length can always be represented by usize
.
pub fn enumerate_pixels_mut(&mut self) -> EnumeratePixelsMut<'_, P>
[src]
Enumerates over the pixels of the image. The iterator yields the coordinates of each pixel along with a mutable reference to them.
pub fn enumerate_rows_mut(&mut self) -> EnumerateRowsMut<'_, P>
[src]
Enumerates over the rows of the image. The iterator yields the y-coordinate of each row along with a mutable reference to them.
pub fn get_pixel_mut(&mut self, x: u32, y: u32) -> &mut P
[src]
Gets a reference to the mutable pixel at location (x, y)
Panics
Panics if (x, y)
is out of the bounds (width, height)
.
pub fn put_pixel(&mut self, x: u32, y: u32, pixel: P)
[src]
pub fn save<Q>(&self, path: Q) -> Result<(), ImageError> where
Q: AsRef<Path>,
[src]
Q: AsRef<Path>,
Saves the buffer to a file at the path specified.
The image format is derived from the file extension. Currently only jpeg and png files are supported.
pub fn save_with_format<Q>(
&self,
path: Q,
format: ImageFormat
) -> Result<(), ImageError> where
Q: AsRef<Path>,
[src]
&self,
path: Q,
format: ImageFormat
) -> Result<(), ImageError> where
Q: AsRef<Path>,
Saves the buffer to a file at the specified path in the specified format.
See save_buffer_with_format
for
supported types.
Trait Implementations
impl Debug for GrayAlphaImage
[src]
impl Deref for GrayAlphaImage
[src]
type Target = GrayAlphaImage
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl DerefMut for GrayAlphaImage
[src]
impl FromField for GrayAlphaImage
[src]
Auto Trait Implementations
impl RefUnwindSafe for GrayAlphaImage
impl Send for GrayAlphaImage
impl Sync for GrayAlphaImage
impl Unpin for GrayAlphaImage
impl UnwindSafe for GrayAlphaImage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,