pub struct DecodeParms<'a> { /* private fields */ }
Expand description
Writer for an filter decode parameters dictionary.
This struct is created by Stream::decode_parms
.
Implementations§
source§impl DecodeParms<'_>
impl DecodeParms<'_>
Properties for FlateDecode
and LzwDecode
.
sourcepub fn predictor(&mut self, predictor: Predictor) -> &mut Self
pub fn predictor(&mut self, predictor: Predictor) -> &mut Self
Write the /Predictor
attribute for FlateDecode
and LzwDecode
.
No predictor is used by default.
sourcepub fn colors(&mut self, colors: i32) -> &mut Self
pub fn colors(&mut self, colors: i32) -> &mut Self
Write the /Colors
attribute for FlateDecode
and LzwDecode
.
Must be greater than 0. /Predictor
must be set.
Defaults to 1.
sourcepub fn bits_per_component(&mut self, bits: i32) -> &mut Self
pub fn bits_per_component(&mut self, bits: i32) -> &mut Self
Write the /BitsPerComponent
attribute for FlateDecode
and
LzwDecode
.
Must be one of 1, 2, 4, 8, or 16. /Predictor
must
be set. Defaults to 8.
sourcepub fn columns(&mut self, columns: i32) -> &mut Self
pub fn columns(&mut self, columns: i32) -> &mut Self
Write the /Columns
attribute for FlateDecode
and LzwDecode
or
CcittFaxDecode
.
When used with FlateDecode
and LzwDecode
, it indicates the number of
samples in each row. In that case, /Predictor
must
be set and the default is 1.
When used with CcittFaxDecode
it denominates the width of the image in
pixels and defaults to 1728.
sourcepub fn early_change(&mut self, early_change: bool) -> &mut Self
pub fn early_change(&mut self, early_change: bool) -> &mut Self
Write the /EarlyChange
attribute for LzwDecode
.
If true
(1), the code length increases one code earlier, if false
(0), length change is postponed as long as possible.
Defaults to 1.
source§impl DecodeParms<'_>
impl DecodeParms<'_>
Properties for CcittFaxDecode
. Also see Self::columns
.
sourcepub fn k(&mut self, k: i32) -> &mut Self
pub fn k(&mut self, k: i32) -> &mut Self
Write the /K
attribute for CcittFaxDecode
.
Defaults to 0.
sourcepub fn end_of_line(&mut self, eol: bool) -> &mut Self
pub fn end_of_line(&mut self, eol: bool) -> &mut Self
Write the /EndOfLine
attribute for CcittFaxDecode
.
Whether the EOL bit pattern is present in the encoding. Defaults to
false
.
sourcepub fn encoded_byte_align(&mut self, encoded_byte_align: bool) -> &mut Self
pub fn encoded_byte_align(&mut self, encoded_byte_align: bool) -> &mut Self
Write the /EncodedByteAlign
attribute for CcittFaxDecode
.
Whether to expect zero bits before each encoded line. Defaults to
false
.
sourcepub fn rows(&mut self, rows: i32) -> &mut Self
pub fn rows(&mut self, rows: i32) -> &mut Self
Write the /Rows
attribute for CcittFaxDecode
.
The image’s height. Defaults to 0.
sourcepub fn end_of_block(&mut self, end_of_block: bool) -> &mut Self
pub fn end_of_block(&mut self, end_of_block: bool) -> &mut Self
Write the /EndOfBlock
attribute for CcittFaxDecode
.
Whether to expect an EOB code at the end of the data. Defaults to
true
.
sourcepub fn black_is_1(&mut self, black_is_1: bool) -> &mut Self
pub fn black_is_1(&mut self, black_is_1: bool) -> &mut Self
Write the /BlackIs1
attribute for CcittFaxDecode
.
Whether to invert the bits in the image. Defaults to false
.
sourcepub fn damaged_rows_before_error(&mut self, count: i32) -> &mut Self
pub fn damaged_rows_before_error(&mut self, count: i32) -> &mut Self
Write the /DamagedRowsBeforeError
attribute for CcittFaxDecode
.
How many damaged rows are allowed before an error is raised. Defaults to 0.
source§impl DecodeParms<'_>
impl DecodeParms<'_>
Properties for Jbig2Decode
.
sourcepub fn jbig2_globals(&mut self, globals: Ref) -> &mut Self
pub fn jbig2_globals(&mut self, globals: Ref) -> &mut Self
Write the /JBIG2Globals
attribute for Jbig2Decode
.
A reference to a stream containing global segments.
source§impl DecodeParms<'_>
impl DecodeParms<'_>
Properties for JpxDecode
.
sourcepub fn color_transform(&mut self, color_transform: bool) -> &mut Self
pub fn color_transform(&mut self, color_transform: bool) -> &mut Self
Write the /ColorTransform
attribute for JpxDecode
.
How to handle color data. If true
(1), images with three color
channels shall be decoded from the YCbCr space and images with four
color channels are decoded from YCbCrK. If false
(0), no
transformation is applied. The default depends on the APP14
marker in
the data stream.
source§impl DecodeParms<'_>
impl DecodeParms<'_>
Properties for Crypt
.
sourcepub fn crypt_type(&mut self) -> &mut Self
pub fn crypt_type(&mut self) -> &mut Self
Write the /Type
attribute for Crypt
as CryptFilterDecodeParms
.
Methods from Deref<Target = Dict<'a>>§
sourcepub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
pub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
Start writing a pair with an arbitrary value.
sourcepub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
pub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
Write a pair with a primitive value.
This is a shorthand for dict.insert(key).primitive(value)
.
sourcepub fn pairs<'n, T: Primitive>(
&mut self,
pairs: impl IntoIterator<Item = (Name<'n>, T)>,
) -> &mut Self
pub fn pairs<'n, T: Primitive>( &mut self, pairs: impl IntoIterator<Item = (Name<'n>, T)>, ) -> &mut Self
Write a sequence of pairs with primitive values.