dclipca
dclipca

Reputation: 1937

Rust image-tiff library custom Decoder parameters

I am using the image-tiff https://docs.rs/tiff/0.6.1/src/tiff/decoder/mod.rs.html#329-347 and I would like to know to make a custom decoder using the parameters shown at https://docs.rs/tiff/0.6.1/src/tiff/decoder/mod.rs.html#329-347. Here is the function:

pub fn new(r: R) -> TiffResult<Decoder<R>> {
        Decoder {
            reader: SmartReader::wrap(r, ByteOrder::LittleEndian),
            byte_order: ByteOrder::LittleEndian,
            bigtiff: false,
            limits: Default::default(),
            next_ifd: None,
            ifd: None,
            width: 0,
            height: 0,
            bits_per_sample: vec![1],
            samples: 1,
            sample_format: vec![SampleFormat::Uint],
            photometric_interpretation: PhotometricInterpretation::BlackIsZero,
            compression_method: CompressionMethod::None,
            strip_decoder: None,
        }
        .init()
    }

I want to make a new decoder with custom parameters, such as a different byte_order. How can I achieve this?

Upvotes: 0

Views: 300

Answers (1)

HHK
HHK

Reputation: 5320

Those are not public parameters but private state of the Decoder which is only being initialized in the new() function. The byte_order field is set in the read_header() function according the the byte order specified in the TIFF file.

So, no. You cannot change that.

Upvotes: 1

Related Questions