Struct pwgraster::PageHeader
[−]
[src]
pub struct PageHeader<'a>(_);
Accessors into a slice containing a PWG page header
Methods
impl<'a> PageHeader<'a>
[src]
fn PwgRaster(&self) -> Result<PwgRaster, Error>
fn MediaColor(&self) -> Result<CString, Error>
fn MediaType(&self) -> Result<CString, Error>
fn PrintContentOptimize(&self) -> Result<CString, Error>
fn Reserved1(&self) -> Result<Reserved, Error>
fn CutMedia(&self) -> Result<When, Error>
fn Duplex(&self) -> Result<Boolean, Error>
fn HWResolution(&self) -> Result<HwResolution, Error>
fn Reserved2(&self) -> Result<Reserved, Error>
fn InsertSheet(&self) -> Result<Boolean, Error>
fn Jog(&self) -> Result<When, Error>
fn LeadingEdge(&self) -> Result<Edge, Error>
fn Reserved3(&self) -> Result<Reserved, Error>
fn MediaPosition(&self) -> Result<MediaPosition, Error>
fn MediaWeight(&self) -> Result<UnsignedInteger, Error>
fn Reserved4(&self) -> Result<Reserved, Error>
fn NumCopies(&self) -> Result<UnsignedInteger, Error>
fn Orientation(&self) -> Result<Orientation, Error>
fn Reserved5(&self) -> Result<Reserved, Error>
fn PageSize(&self) -> Result<PageSize, Error>
fn Reserved6(&self) -> Result<Reserved, Error>
fn Tumble(&self) -> Result<Boolean, Error>
fn Width(&self) -> Result<UnsignedInteger, Error>
fn Height(&self) -> Result<UnsignedInteger, Error>
fn Reserved7(&self) -> Result<Reserved, Error>
fn BitsPerColor(&self) -> Result<UnsignedInteger, Error>
fn BitsPerPixel(&self) -> Result<UnsignedInteger, Error>
fn BytesPerLine(&self) -> Result<UnsignedInteger, Error>
fn ColorOrder(&self) -> Result<ColorOrder, Error>
fn ColorSpace(&self) -> Result<ColorSpace, Error>
fn Reserved8(&self) -> Result<Reserved, Error>
fn NumColors(&self) -> Result<UnsignedInteger, Error>
fn Reserved9(&self) -> Result<Reserved, Error>
fn TotalPageCount(&self) -> Result<UnsignedInteger, Error>
fn CrossFeedTransform(&self) -> Result<Integer, Error>
fn FeedTransform(&self) -> Result<Integer, Error>
fn ImageBoxLeft(&self) -> Result<UnsignedInteger, Error>
fn ImageBoxTop(&self) -> Result<UnsignedInteger, Error>
fn ImageBoxRight(&self) -> Result<UnsignedInteger, Error>
fn ImageBoxBottom(&self) -> Result<UnsignedInteger, Error>
fn AlternatePrimary(&self) -> Result<SrgbColor, Error>
fn PrintQuality(&self) -> Result<PrintQuality, Error>
fn Reserved10(&self) -> Result<Reserved, Error>
fn VendorIdentifier(&self) -> Result<UnsignedInteger, Error>
fn VendorLength(&self) -> Result<UnsignedInteger, Error>
fn VendorData(&self) -> Result<VendorData, Error>
fn Reserved11(&self) -> Result<Reserved, Error>
fn RenderingIntent(&self) -> Result<CString, Error>
fn PageSizeName(&self) -> Result<CString, Error>
fn validate_filter<E, F: Fn(Error) -> Result<(), E>>(
&self,
err_handler: F
) -> Result<(), E>
&self,
err_handler: F
) -> Result<(), E>
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]
fn from_buf(buf: &'a [u8]) -> Option<Self>
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.
fn validate(&self) -> Result<(), Error>
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.
fn validate_withreserved(&self) -> Result<(), Error>
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.
fn bytes_per_line(&self) -> Result<usize, Error>
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.
fn image_size_bytes(&self) -> Result<usize, Error>
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.
fn unpack_page<R: Read, W: Write>(
&self,
reader: &mut R,
writer: &mut W
) -> Result<(), StreamError>
&self,
reader: &mut R,
writer: &mut W
) -> Result<(), StreamError>