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§
§impl PnmHeader
impl PnmHeader
pub fn subtype(&self) -> PnmSubtype
pub fn subtype(&self) -> PnmSubtype
Retrieve the format subtype from which the header was created.
pub fn maximal_sample(&self) -> u32
pub fn maximal_sample(&self) -> u32
The biggest value a sample can have. In other words, the colour resolution.
pub fn as_bitmap(&self) -> Option<&BitmapHeader>
pub fn as_bitmap(&self) -> Option<&BitmapHeader>
Retrieve the underlying bitmap header if any
pub fn as_graymap(&self) -> Option<&GraymapHeader>
pub fn as_graymap(&self) -> Option<&GraymapHeader>
Retrieve the underlying graymap header if any
pub fn as_pixmap(&self) -> Option<&PixmapHeader>
pub fn as_pixmap(&self) -> Option<&PixmapHeader>
Retrieve the underlying pixmap header if any
pub fn as_arbitrary(&self) -> Option<&ArbitraryHeader>
pub fn as_arbitrary(&self) -> Option<&ArbitraryHeader>
Retrieve the underlying arbitrary header if any
Trait Implementations§
§impl From<ArbitraryHeader> for PnmHeader
impl From<ArbitraryHeader> for PnmHeader
§fn from(header: ArbitraryHeader) -> PnmHeader
fn from(header: ArbitraryHeader) -> PnmHeader
Converts to this type from the input type.
§impl From<BitmapHeader> for PnmHeader
impl From<BitmapHeader> for PnmHeader
§fn from(header: BitmapHeader) -> PnmHeader
fn from(header: BitmapHeader) -> PnmHeader
Converts to this type from the input type.
§impl From<GraymapHeader> for PnmHeader
impl From<GraymapHeader> for PnmHeader
§fn from(header: GraymapHeader) -> PnmHeader
fn from(header: GraymapHeader) -> PnmHeader
Converts to this type from the input type.
§impl From<PixmapHeader> for PnmHeader
impl From<PixmapHeader> for PnmHeader
§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§
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.