Trait fastfreeimage::FastImage

source ·
pub trait FastImage {
    type D: 'static + Copy;
    type C: ChanTrait;

    // Required methods
    fn image_slice(&self) -> &[Self::D];
    fn raw_ptr(&self) -> *const Self::D;
    fn stride(&self) -> c_int;
    fn size(&self) -> &FastImageSize;

    // Provided methods
    fn width(&self) -> c_int { ... }
    fn height(&self) -> c_int { ... }
    fn valid_row_iter(
        &self,
        size: &FastImageSize
    ) -> Result<ValidChunksExact<'_, Self::D>> { ... }
    fn pixel_slice(&self, row: usize, col: usize) -> &[Self::D] { ... }
}

Required Associated Types§

source

type D: 'static + Copy

Pixel data type (e.g. u8 or f32)

source

type C: ChanTrait

Number of channels (e.g. Chan1)

Required Methods§

source

fn image_slice(&self) -> &[Self::D]

Get the raw data for the entire image, including padding.

source

fn raw_ptr(&self) -> *const Self::D

source

fn stride(&self) -> c_int

Get the image stride in number of bytes.

source

fn size(&self) -> &FastImageSize

Get the image size in number of pixels.

Provided Methods§

source

fn width(&self) -> c_int

Get the image width in number of pixels.

source

fn height(&self) -> c_int

Get the image height in number of pixels.

source

fn valid_row_iter( &self, size: &FastImageSize ) -> Result<ValidChunksExact<'_, Self::D>>

Iterate over elements in each image row. Returns valid slices.

source

fn pixel_slice(&self, row: usize, col: usize) -> &[Self::D]

Get the raw data for a pixel.

Trait Implementations§

source§

impl ImageData<Mono8> for &dyn FastImage<D = u8, C = Chan1>

source§

fn width(&self) -> u32

Number of pixel columns in the image. Note: this is not the stride.
source§

fn height(&self) -> u32

Number of pixel rows in the image.
source§

fn buffer_ref(&self) -> ImageBufferRef<'_, Mono8>

Returns the image buffer specified by pixel format F. Read more
source§

fn buffer(self) -> ImageBuffer<Mono8>

Returns the image buffer specified by pixel format F. Read more
source§

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

Returns the raw image data as specified by pixel format F. Read more
source§

impl<C, D> Stride for &dyn FastImage<C = C, D = D>
where C: 'static + ChanTrait, D: 'static + Copy,

source§

fn stride(&self) -> usize

the width (in bytes) of each row of image data Read more

Implementors§

source§

impl<'a, C, D> FastImage for &'a FastImageData<C, D>
where C: ChanTrait, D: Copy + PartialEq,

§

type D = D

§

type C = C

source§

impl<'a, C, D> FastImage for &FastImageView<'a, C, D>
where C: 'static + ChanTrait, D: 'static + Copy + Debug + PartialEq,

§

type D = D

§

type C = C

source§

impl<'a, C, D> FastImage for &MutableFastImageView<'a, C, D>
where C: 'static + ChanTrait, D: 'static + Copy + Debug + PartialEq,

§

type D = D

§

type C = C

source§

impl<'a, C, D> FastImage for FastImageView<'a, C, D>
where C: 'static + ChanTrait, D: 'static + Copy + Debug + PartialEq,

§

type D = D

§

type C = C

source§

impl<'a, C, D> FastImage for MutableFastImageView<'a, C, D>
where C: 'static + ChanTrait, D: 'static + Copy + Debug + PartialEq,

§

type D = D

§

type C = C

source§

impl<C, D> FastImage for FastImageData<C, D>
where C: ChanTrait, D: Copy + PartialEq,

§

type D = D

§

type C = C