Struct PnmHeader
pub struct PnmHeader { /* private fields */ }
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
fn subtype(&self) -> PnmSubtypeRetrieve the format subtype from which the header was created.
fn width(&self) -> u32The width of the image this header is for.
fn height(&self) -> u32The height of the image this header is for.
fn maximal_sample(&self) -> u32The biggest value a sample can have. In other words, the colour resolution.
fn as_bitmap(&self) -> Option<&BitmapHeader>Retrieve the underlying bitmap header if any
fn as_graymap(&self) -> Option<&GraymapHeader>Retrieve the underlying graymap header if any
fn as_pixmap(&self) -> Option<&PixmapHeader>Retrieve the underlying pixmap header if any
fn as_arbitrary(&self) -> Option<&ArbitraryHeader>Retrieve the underlying arbitrary header if any
fn write(&self, writer: &mut dyn Write) -> Result<()>Write the header back into a binary stream
Trait Implementations
impl Clone for PnmHeader
fn clone(&self) -> Self
impl From<ArbitraryHeader> for PnmHeader
fn from(header: ArbitraryHeader) -> Self
impl From<BitmapHeader> for PnmHeader
fn from(header: BitmapHeader) -> Self
impl From<GraymapHeader> for PnmHeader
fn from(header: GraymapHeader) -> Self
impl From<PixmapHeader> for PnmHeader
fn from(header: PixmapHeader) -> Self