#[non_exhaustive]pub struct ImageDescriptor {
pub width: u32,
pub height: u32,
pub pixel: PixelFormat,
pub color: ColorModel,
}Expand description
The shape of an image at a point in the graph.
Descriptors flow forward at graph-build time: every node computes its
output descriptor from its inputs’ descriptors when it is constructed. That
is what makes metadata() free — no pixels are touched to answer it
(ARCHITECTURE §Layer 3).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.width: u32Width in pixels; always non-zero.
height: u32Height in pixels; always non-zero.
pixel: PixelFormatInterleaved pixel format of the samples.
color: ColorModelColor model the samples are interpreted in (sRGB-assumed in v1).
Implementations§
Source§impl ImageDescriptor
impl ImageDescriptor
Sourcepub fn new(
width: u32,
height: u32,
pixel: PixelFormat,
) -> Result<ImageDescriptor, PixelsError>
pub fn new( width: u32, height: u32, pixel: PixelFormat, ) -> Result<ImageDescriptor, PixelsError>
Sourcepub fn with_limits(
width: u32,
height: u32,
pixel: PixelFormat,
limits: &Limits,
) -> Result<ImageDescriptor, PixelsError>
pub fn with_limits( width: u32, height: u32, pixel: PixelFormat, limits: &Limits, ) -> Result<ImageDescriptor, PixelsError>
Sourcepub fn resized(
&self,
width: u32,
height: u32,
) -> Result<ImageDescriptor, PixelsError>
pub fn resized( &self, width: u32, height: u32, ) -> Result<ImageDescriptor, PixelsError>
Trait Implementations§
Source§impl Clone for ImageDescriptor
impl Clone for ImageDescriptor
Source§fn clone(&self) -> ImageDescriptor
fn clone(&self) -> ImageDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ImageDescriptor
Source§impl Debug for ImageDescriptor
impl Debug for ImageDescriptor
Source§impl Display for ImageDescriptor
impl Display for ImageDescriptor
impl Eq for ImageDescriptor
Source§impl Hash for ImageDescriptor
impl Hash for ImageDescriptor
Source§impl PartialEq for ImageDescriptor
impl PartialEq for ImageDescriptor
impl StructuralPartialEq for ImageDescriptor
Auto Trait Implementations§
impl Freeze for ImageDescriptor
impl RefUnwindSafe for ImageDescriptor
impl Send for ImageDescriptor
impl Sync for ImageDescriptor
impl Unpin for ImageDescriptor
impl UnsafeUnpin for ImageDescriptor
impl UnwindSafe for ImageDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more