gpt4 book ai didi

Rust image-tiff 库自定义解码器参数

转载 作者:行者123 更新时间:2023-12-03 11:43:57 26 4
gpt4 key购买 nike

我正在使用 image-tiff https://docs.rs/tiff/0.6.1/src/tiff/decoder/mod.rs.html#329-347我想知道使用 https://docs.rs/tiff/0.6.1/src/tiff/decoder/mod.rs.html#329-347 中显示的参数制作自定义解码器.这是功能:

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()
}
我想用自定义参数制作一个新的解码器,例如不同的 byte_order .我怎样才能做到这一点?

最佳答案

这些不是公共(public)参数,而是解码器的私有(private)状态,仅在 new() 中初始化。功能。 byte_order字段设置在 read_header() 根据 TIFF 文件中指定的字节顺序运行。
所以不行。你无法改变这一点。

关于Rust image-tiff 库自定义解码器参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66045180/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com