Struct PnmHeader
struct PnmHeader { ... }
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: &Self) -> PnmSubtypeRetrieve the format subtype from which the header was created.
fn width(self: &Self) -> u32The width of the image this header is for.
fn height(self: &Self) -> u32The height of the image this header is for.
fn maximal_sample(self: &Self) -> u32The biggest value a sample can have. In other words, the colour resolution.
fn as_bitmap(self: &Self) -> Option<&BitmapHeader>Retrieve the underlying bitmap header if any
fn as_graymap(self: &Self) -> Option<&GraymapHeader>Retrieve the underlying graymap header if any
fn as_pixmap(self: &Self) -> Option<&PixmapHeader>Retrieve the underlying pixmap header if any
fn as_arbitrary(self: &Self) -> Option<&ArbitraryHeader>Retrieve the underlying arbitrary header if any
fn write(self: &Self, writer: &mut dyn Write) -> Result<()>Write the header back into a binary stream
impl Freeze for PnmHeader
impl From for PnmHeader
fn from(header: PixmapHeader) -> Self
impl From for PnmHeader
fn from(header: ArbitraryHeader) -> Self
impl From for PnmHeader
fn from(header: BitmapHeader) -> Self
impl From for PnmHeader
fn from(header: GraymapHeader) -> Self
impl RefUnwindSafe for PnmHeader
impl Send for PnmHeader
impl Sync for PnmHeader
impl Unpin for PnmHeader
impl UnsafeUnpin for PnmHeader
impl UnwindSafe for PnmHeader
impl<T> Any for PnmHeader
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for PnmHeader
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for PnmHeader
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for PnmHeader
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Pointable for PnmHeader
unsafe fn init(init: <T as Pointable>::Init) -> usizeunsafe fn deref<'a>(ptr: usize) -> &'a Tunsafe fn deref_mut<'a>(ptr: usize) -> &'a mut Tunsafe fn drop(ptr: usize)
impl<T, U> Into for PnmHeader
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for PnmHeader
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for PnmHeader
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>