Skip to main content

Image

Type Alias Image 

Source
pub type Image<T, const CHANNELS: usize> = ImageChannels<[ImageChannel<T>; CHANNELS]>;

Aliased Type§

pub struct Image<T, const CHANNELS: usize>(/* private fields */);

Implementations§

Source§

impl<const CHANNELS: usize, T: PixelType> Image<T, CHANNELS>

Source

pub fn new_vec_flat( input: Vec<T::Primitive>, width: NonZeroU32, height: NonZeroU32, ) -> Self
where T: PixelType,

§Panics

Panics if the buffer size is not compatible with the width and height.

Source

pub fn new_vec(input: Vec<T>, width: NonZeroU32, height: NonZeroU32) -> Self
where T: Clone,

§Panics

Panics if the buffer size is not compatible with the width and height.

Source

pub fn into_channels(self) -> [ImageChannel<T>; CHANNELS]

Source

pub fn into_vec(self) -> Vec<T>
where T: Clone,

Source

pub fn from_interleaved(i: &Image<[T; CHANNELS], 1>) -> Self

Source

pub fn from_flat_interleaved( v: &[T], (width, height): (NonZeroU32, NonZeroU32), ) -> Self
where T: Copy,

§Panics

Panics if the buffer size is not compatible with the width, height, and channel count.

Source§

impl<T> Image<T, 1>
where T: PixelType,

Source

pub fn new_arc(input: Arc<[T]>, width: NonZeroU32, height: NonZeroU32) -> Self
where T::Primitive: Clone,

Source

pub fn from_channel(ch: ImageChannel<T>) -> Self

Source§

impl<const PIXEL_ELEMENTS: usize, T: PixelTypePrimitive> Image<[T; PIXEL_ELEMENTS], 1>

Source

pub fn from_planar_image<const CHANNELS: usize>(i: &Image<T, CHANNELS>) -> Self
where T: Copy,

Source

pub fn from_planar<const CHANNELS: usize>( channels: [&[T]; CHANNELS], width: NonZeroU32, height: NonZeroU32, ) -> Self
where T: Copy,

§Panics

Panics if the buffer size is not compatible with the width, height, and channel count.

Trait Implementations§

Source§

impl<T: PixelType, const CHANNELS: usize> TryFrom<DynamicImage> for Image<T, CHANNELS>

Source§

type Error = IncompatibleImageError<DynamicImage>

The type returned in the event of a conversion error.
Source§

fn try_from(value: DynamicImage) -> Result<Self, Self::Error>

Performs the conversion.