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§
source§impl 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§
source§impl From<ArbitraryHeader> for PnmHeader
impl From<ArbitraryHeader> for PnmHeader
source§fn from(header: ArbitraryHeader) -> PnmHeader
fn from(header: ArbitraryHeader) -> PnmHeader
Converts to this type from the input type.
source§impl From<BitmapHeader> for PnmHeader
impl From<BitmapHeader> for PnmHeader
source§fn from(header: BitmapHeader) -> PnmHeader
fn from(header: BitmapHeader) -> PnmHeader
Converts to this type from the input type.
source§impl From<GraymapHeader> for PnmHeader
impl From<GraymapHeader> for PnmHeader
source§fn from(header: GraymapHeader) -> PnmHeader
fn from(header: GraymapHeader) -> PnmHeader
Converts to this type from the input type.
source§impl From<PixmapHeader> for PnmHeader
impl From<PixmapHeader> for PnmHeader
source§fn from(header: PixmapHeader) -> PnmHeader
fn from(header: PixmapHeader) -> PnmHeader
Converts to this type from the input type.
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§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
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
source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
source§fn convert_into(self) -> U
fn convert_into(self) -> U
Convert into T with values clamped to the color defined bounds Read more
source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined range,
otherwise an
OutOfBounds
error is returned which contains the unclamped color. Read more