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>
impl<const CHANNELS: usize, T: PixelType> Image<T, CHANNELS>
Sourcepub fn new_vec_flat(
input: Vec<T::Primitive>,
width: NonZeroU32,
height: NonZeroU32,
) -> Selfwhere
T: PixelType,
pub fn new_vec_flat(
input: Vec<T::Primitive>,
width: NonZeroU32,
height: NonZeroU32,
) -> Selfwhere
T: PixelType,
§Panics
Panics if the buffer size is not compatible with the width and height.
Sourcepub fn new_vec(input: Vec<T>, width: NonZeroU32, height: NonZeroU32) -> Selfwhere
T: Clone,
pub fn new_vec(input: Vec<T>, width: NonZeroU32, height: NonZeroU32) -> Selfwhere
T: Clone,
§Panics
Panics if the buffer size is not compatible with the width and height.
pub fn into_channels(self) -> [ImageChannel<T>; CHANNELS]
pub fn into_vec(self) -> Vec<T>where
T: Clone,
pub fn from_interleaved(i: &Image<[T; CHANNELS], 1>) -> Selfwhere
T: PixelTypePrimitive + Copy,
Sourcepub fn from_flat_interleaved(
v: &[T],
(width, height): (NonZeroU32, NonZeroU32),
) -> Selfwhere
T: Copy,
pub fn from_flat_interleaved(
v: &[T],
(width, height): (NonZeroU32, NonZeroU32),
) -> Selfwhere
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,
impl<T> Image<T, 1>where
T: PixelType,
pub fn new_arc(input: Arc<[T]>, width: NonZeroU32, height: NonZeroU32) -> Selfwhere
T::Primitive: Clone,
pub fn from_channel(ch: ImageChannel<T>) -> Self
Source§impl<const PIXEL_ELEMENTS: usize, T: PixelTypePrimitive> Image<[T; PIXEL_ELEMENTS], 1>
impl<const PIXEL_ELEMENTS: usize, T: PixelTypePrimitive> Image<[T; PIXEL_ELEMENTS], 1>
pub fn from_planar_image<const CHANNELS: usize>(i: &Image<T, CHANNELS>) -> Selfwhere
T: Copy,
Sourcepub fn from_planar<const CHANNELS: usize>(
channels: [&[T]; CHANNELS],
width: NonZeroU32,
height: NonZeroU32,
) -> Selfwhere
T: Copy,
pub fn from_planar<const CHANNELS: usize>(
channels: [&[T]; CHANNELS],
width: NonZeroU32,
height: NonZeroU32,
) -> Selfwhere
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>
impl<T: PixelType, const CHANNELS: usize> TryFrom<DynamicImage> for Image<T, CHANNELS>
Source§type Error = IncompatibleImageError<DynamicImage>
type Error = IncompatibleImageError<DynamicImage>
The type returned in the event of a conversion error.