Struct pwgraster::PageHeader [] [src]

pub struct PageHeader<'a>(_);

Accessors into a slice containing a PWG page header

Methods

impl<'a> PageHeader<'a>
[src]

Attempt to unpack all values, calling a function to handle any errors as they are encountered.

An error handler may choose to map the errors to a custom type or discard some types of errors.

impl<'a> PageHeader<'a>
[src]

Construct over a borrowed buffer that starts at the beginning of the PWG header (after the sync word or a previous page).

Does not copy the input or allocate.

Returns None if the buffer is not at least PWG_HEADER_SIZE bytes. No input validation is performed at this step.

Attempt to unpack all values, calling a function to handle any errors as they are encountered.

This ignores reserved fields but returns the first error encountered in other fields.

Attempt to unpack all values, calling a function to handle any errors as they are encountered.

Warning! This validates that reserved fields are set to 0 so code using this may not be future-proof.

The size of an unpacked line.

1 bpp data will remain packed 8 pixel in a byte. Pixels are packed into a stream of bytes, i.e. 2 24bpp pixels are represented as 6 contiguous bytes.

The size of the unpacked image data in bytes. bytes_per_line * height.

1 bpp data will remain packed 8 pixel in a byte. Pixels are packed into a stream of bytes, i.e. 2 24bpp pixels are represented as 6 contiguous bytes.