Trait image2::ImageData

source ·
pub trait ImageData<T>: Sync + Send + AsRef<[T]> + AsMut<[T]>where
    T: Copy + Type,{
    // Provided methods
    fn flush(&self) -> Result<(), Error> { ... }
    fn data(&self) -> &[T]  { ... }
    fn data_mut(&mut self) -> &mut [T]  { ... }
    fn as_ptr(&self) -> *const T { ... }
    fn as_mut_ptr(&mut self) -> *mut T { ... }
    fn buffer(&self) -> &[u8]  { ... }
    fn buffer_mut(&mut self) -> &mut [u8]  { ... }
}
Expand description

ImageData is used to hold pixel data for images

Provided Methods§

source

fn flush(&self) -> Result<(), Error>

Flush image data to disk, this is a no-op except when using memory-mapped data

source

fn data(&self) -> &[T]

Get slice

source

fn data_mut(&mut self) -> &mut [T]

Get mutable slice

source

fn as_ptr(&self) -> *const T

Get pointer

source

fn as_mut_ptr(&mut self) -> *mut T

Get mutable pointer

source

fn buffer(&self) -> &[u8]

Get byte slice

source

fn buffer_mut(&mut self) -> &mut [u8]

Get mutable byte slice

Trait Implementations§

source§

impl<T: Type> Index<Range<usize>> for dyn ImageData<T>

§

type Output = [T]

The returned type after indexing.
source§

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

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

impl<T: Type> Index<usize> for dyn ImageData<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<T: Type> IndexMut<Range<usize>> for dyn ImageData<T>

source§

fn index_mut(&mut self, index: Range<usize>) -> &mut Self::Output

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

impl<T: Type> IndexMut<usize> for dyn ImageData<T>

source§

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

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

Implementations on Foreign Types§

source§

impl<T: Type> ImageData<T> for [T]

source§

impl<T: Type> ImageData<T> for Vec<T>

source§

impl<T: Type> ImageData<T> for Box<[T]>

source§

impl<T: Type> ImageData<T> for &mut [T]

Implementors§

source§

impl<T: Type> ImageData<T> for Mmap<T>