pub struct PnmHeader { /* private fields */ }
Expand description
Stores the complete header data of a file.
Internally, provides mechanisms for lossless reencoding. After reading a file with the decoder it is possible to recover the header and construct an encoder. Using the encoder on the just loaded image should result in a byte copy of the original file (for single image pnms without additional trailing data).
Implementations
sourceimpl PnmHeader
impl PnmHeader
sourcepub fn subtype(&self) -> PNMSubtype
pub fn subtype(&self) -> PNMSubtype
Retrieve the format subtype from which the header was created.
sourcepub fn maximal_sample(&self) -> u32
pub fn maximal_sample(&self) -> u32
The biggest value a sample can have. In other words, the colour resolution.
sourcepub fn as_bitmap(&self) -> Option<&BitmapHeader>
pub fn as_bitmap(&self) -> Option<&BitmapHeader>
Retrieve the underlying bitmap header if any
sourcepub fn as_graymap(&self) -> Option<&GraymapHeader>
pub fn as_graymap(&self) -> Option<&GraymapHeader>
Retrieve the underlying graymap header if any
sourcepub fn as_pixmap(&self) -> Option<&PixmapHeader>
pub fn as_pixmap(&self) -> Option<&PixmapHeader>
Retrieve the underlying pixmap header if any
sourcepub fn as_arbitrary(&self) -> Option<&ArbitraryHeader>
pub fn as_arbitrary(&self) -> Option<&ArbitraryHeader>
Retrieve the underlying arbitrary header if any
Trait Implementations
sourceimpl From<ArbitraryHeader> for PnmHeader
impl From<ArbitraryHeader> for PnmHeader
sourcefn from(header: ArbitraryHeader) -> Self
fn from(header: ArbitraryHeader) -> Self
Performs the conversion.
sourceimpl From<BitmapHeader> for PnmHeader
impl From<BitmapHeader> for PnmHeader
sourcefn from(header: BitmapHeader) -> Self
fn from(header: BitmapHeader) -> Self
Performs the conversion.
sourceimpl From<GraymapHeader> for PnmHeader
impl From<GraymapHeader> for PnmHeader
sourcefn from(header: GraymapHeader) -> Self
fn from(header: GraymapHeader) -> Self
Performs the conversion.
sourceimpl From<PixmapHeader> for PnmHeader
impl From<PixmapHeader> for PnmHeader
sourcefn from(header: PixmapHeader) -> Self
fn from(header: PixmapHeader) -> Self
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for PnmHeader
impl Send for PnmHeader
impl Sync for PnmHeader
impl Unpin for PnmHeader
impl UnwindSafe for PnmHeader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more