| 1 |
use tiffrust-analyzer cargo tiff 0.11.3 crate/::decoderrust-analyzer cargo tiff 0.11.3 decoder/::{Decoderrust-analyzer cargo tiff 0.11.3 decoder/Decoder#, DecodingResultrust-analyzer cargo tiff 0.11.3 decoder/DecodingResult#, Limitsrust-analyzer cargo tiff 0.11.3 decoder/Limits#, TiffCodingUnitrust-analyzer cargo tiff 0.11.3 decoder/TiffCodingUnit#}; |
| 2 |
|
| 3 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#; |
| 4 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#; |
| 5 |
|
| 6 |
const TEST_IMAGE_DIRrust-analyzer cargo tiff 0.11.3 TEST_IMAGE_DIR.: &str = "./tests/images/"; |
| 7 |
|
| 8 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| •9 |
#[ignore = "skipping, missing test data"] |
| 10 |
fn read_all_planesrust-analyzer cargo tiff 0.11.3 read_all_planes().() { |
| 11 |
let path = PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#::fromrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[PathBuf][`From<&T>`]from().(TEST_IMAGE_DIRrust-analyzer cargo tiff 0.11.3 TEST_IMAGE_DIR.).joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("planar-rgb-u8.tif"); |
| 12 |
let file = Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().(path).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 13 |
let io = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(file); |
| 14 |
|
| 15 |
let mut tif = Decoderrust-analyzer cargo tiff 0.11.3 decoder/Decoder#::newrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]new().(io).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 16 |
let layout = tif.image_buffer_layoutrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]image_buffer_layout().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 17 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(layout.planesrust-analyzer cargo tiff 0.11.3 decoder/BufferLayoutPreference#planes., 3); |
| 18 |
let plane_stride = layout.plane_striderust-analyzer cargo tiff 0.11.3 decoder/BufferLayoutPreference#plane_stride..map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(0, |x| x.getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]get().()); |
| 19 |
|
| 20 |
eprintlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/eprintln!!("{:?}", layout); |
| 21 |
let mut buffer = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![0u8; layout.complete_lenrust-analyzer cargo tiff 0.11.3 decoder/BufferLayoutPreference#complete_len.]; |
| 22 |
tif.read_image_bytesrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]read_image_bytes().(&mut buffer).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 23 |
|
| 24 |
// Mainly you can see: these are different and non-zero. Otherwise these magic constants just |
| 25 |
// depend on the file itself that is being used. |
| 26 |
const PLANE_EXCPECTED_SUMSrust-analyzer cargo tiff 0.11.3 PLANE_EXCPECTED_SUMS.: [u32; 3] = [15417630, 13007788, 11103530]; |
| 27 |
|
| 28 |
for (plane, expected) in (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#layout.planesrust-analyzer cargo tiff 0.11.3 decoder/BufferLayoutPreference#planes.).ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(PLANE_EXCPECTED_SUMSrust-analyzer cargo tiff 0.11.3 PLANE_EXCPECTED_SUMS.) { |
| 29 |
let plane_data = &buffer[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().plane_stride rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().plane..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#layout.lenrust-analyzer cargo tiff 0.11.3 decoder/BufferLayoutPreference#len.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`Index<I>`]index().; |
| 30 |
let sum: u32 = plane_data.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().copiedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#copied().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(u32::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u32][`From<u8>`]from().).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().(); |
| 31 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(sum, expected); |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| •36 |
#[ignore = "skipping, missing test data"] |
| 37 |
fn read_first_coding_unitrust-analyzer cargo tiff 0.11.3 read_first_coding_unit().() { |
| 38 |
let path = PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#::fromrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[PathBuf][`From<&T>`]from().(TEST_IMAGE_DIRrust-analyzer cargo tiff 0.11.3 TEST_IMAGE_DIR.).joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("planar-rgb-u8.tif"); |
| 39 |
let file = Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().(path).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 40 |
let io = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(file); |
| 41 |
|
| 42 |
let mut tif = Decoderrust-analyzer cargo tiff 0.11.3 decoder/Decoder#::newrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]new().(io).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 43 |
let layout = tif.image_coding_unit_layoutrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]image_coding_unit_layout().(TiffCodingUnitrust-analyzer cargo tiff 0.11.3 decoder/TiffCodingUnit#(0)).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 44 |
|
| 45 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(layout.planesrust-analyzer cargo tiff 0.11.3 decoder/BufferLayoutPreference#planes., 3); |
| 46 |
let plane_stride = layout.plane_striderust-analyzer cargo tiff 0.11.3 decoder/BufferLayoutPreference#plane_stride..map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map_or().(0, |x| x.getrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/nonzero/impl#[`NonZero<T>`]get().()); |
| 47 |
eprintlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/eprintln!!("{:?}", layout); |
| 48 |
let mut buffer = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![0u8; layout.complete_lenrust-analyzer cargo tiff 0.11.3 decoder/BufferLayoutPreference#complete_len.]; |
| 49 |
|
| 50 |
struct Expectedrust-analyzer cargo tiff 0.11.3 Expected# { |
| 51 |
plane_sumsrust-analyzer cargo tiff 0.11.3 Expected#plane_sums.: [u32; 3], |
| 52 |
unitrust-analyzer cargo tiff 0.11.3 Expected#unit.: TiffCodingUnitrust-analyzer cargo tiff 0.11.3 decoder/TiffCodingUnit#, |
| 53 |
} |
| 54 |
|
| 55 |
// Mainly you can see: these are different and non-zero. Otherwise these magic constants just |
| 56 |
// depend on the file itself that is being used. Also this varies by what unit we are reading. |
| 57 |
const PLANE_EXCPECTED_SUMSrust-analyzer cargo tiff 0.11.3 PLANE_EXCPECTED_SUMS.: [Expectedrust-analyzer cargo tiff 0.11.3 Expected#; 2] = [ |
| 58 |
Expectedrust-analyzer cargo tiff 0.11.3 Expected# { |
| 59 |
plane_sumsrust-analyzer cargo tiff 0.11.3 Expected#plane_sums.: [856853, 767686, 688532], |
| 60 |
unitrust-analyzer cargo tiff 0.11.3 Expected#unit.: TiffCodingUnitrust-analyzer cargo tiff 0.11.3 decoder/TiffCodingUnit#(0), |
| 61 |
}, |
| 62 |
Expectedrust-analyzer cargo tiff 0.11.3 Expected# { |
| 63 |
plane_sumsrust-analyzer cargo tiff 0.11.3 Expected#plane_sums.: [883679, 797329, 711086], |
| 64 |
unitrust-analyzer cargo tiff 0.11.3 Expected#unit.: TiffCodingUnitrust-analyzer cargo tiff 0.11.3 decoder/TiffCodingUnit#(1), |
| 65 |
}, |
| 66 |
]; |
| 67 |
|
| 68 |
for expected in PLANE_EXCPECTED_SUMSrust-analyzer cargo tiff 0.11.3 PLANE_EXCPECTED_SUMS. { |
| 69 |
tif.read_coding_unit_bytesrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]read_coding_unit_bytes().(expected.unitrust-analyzer cargo tiff 0.11.3 Expected#unit., &mut buffer) |
| 70 |
.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 71 |
|
| 72 |
for (plane, expected) in (0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#layout.planesrust-analyzer cargo tiff 0.11.3 decoder/BufferLayoutPreference#planes.).ziprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#zip().(expected.plane_sumsrust-analyzer cargo tiff 0.11.3 Expected#plane_sums.) { |
| 73 |
let plane_data = &buffer[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().plane_stride rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().plane..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#layout.lenrust-analyzer cargo tiff 0.11.3 decoder/BufferLayoutPreference#len.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/index/impl#[`[T]`][`Index<I>`]index().; |
| 74 |
let sum: u32 = plane_data.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().copiedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#copied().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(u32::fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/num/impl#[u32][`From<u8>`]from().).sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#sum().(); |
| 75 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(sum, expected); |
| 76 |
} |
| 77 |
} |
| 78 |
} |
| 79 |
|
| 80 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| •81 |
#[ignore = "skipping, missing test data"] |
| 82 |
fn read_planes_by_limitsrust-analyzer cargo tiff 0.11.3 read_planes_by_limits().() { |
| 83 |
let path = PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#::fromrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[PathBuf][`From<&T>`]from().(TEST_IMAGE_DIRrust-analyzer cargo tiff 0.11.3 TEST_IMAGE_DIR.).joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("planar-rgb-u8.tif"); |
| 84 |
let file = Filerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/File#::openrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/impl#[File]open().(path).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 85 |
let io = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(file); |
| 86 |
|
| 87 |
let mut limits = Limitsrust-analyzer cargo tiff 0.11.3 decoder/Limits#::defaultrust-analyzer cargo tiff 0.11.3 decoder/impl#[Limits][Default]default().(); |
| 88 |
let mut buffer = DecodingResultrust-analyzer cargo tiff 0.11.3 decoder/DecodingResult#::U8rust-analyzer cargo tiff 0.11.3 decoder/DecodingResult#U8#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![]); |
| 89 |
|
| 90 |
// Make room for 1 plane. |
| 91 |
let mut tif = Decoderrust-analyzer cargo tiff 0.11.3 decoder/Decoder#::newrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]new().(io).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 92 |
tif = tif.with_limitsrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]with_limits().({ |
| 93 |
limits.decoding_buffer_sizerust-analyzer cargo tiff 0.11.3 decoder/Limits#decoding_buffer_size. = 374 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().499; |
| 94 |
limits.clonerust-analyzer cargo tiff 0.11.3 decoder/impl#[Limits][Clone]clone().() |
| 95 |
}); |
| 96 |
|
| 97 |
tif.read_image_to_bufferrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]read_image_to_buffer().(&mut buffer).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 98 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buffer.as_bufferrust-analyzer cargo tiff 0.11.3 decoder/impl#[DecodingResult]as_buffer().(0).byte_lenrust-analyzer cargo tiff 0.11.3 decoder/impl#[`DecodingBuffer<'a>`]byte_len().(), 374 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). 499); |
| 99 |
|
| 100 |
// Make room for 2 planes. |
| 101 |
tif = tif.with_limitsrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]with_limits().({ |
| 102 |
limits.decoding_buffer_sizerust-analyzer cargo tiff 0.11.3 decoder/Limits#decoding_buffer_size. = 374 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().499 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().2; |
| 103 |
limits.clonerust-analyzer cargo tiff 0.11.3 decoder/impl#[Limits][Clone]clone().() |
| 104 |
}); |
| 105 |
|
| 106 |
tif.read_image_to_bufferrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]read_image_to_buffer().(&mut buffer).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 107 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buffer.as_bufferrust-analyzer cargo tiff 0.11.3 decoder/impl#[DecodingResult]as_buffer().(0).byte_lenrust-analyzer cargo tiff 0.11.3 decoder/impl#[`DecodingBuffer<'a>`]byte_len().(), 374 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). 499); |
| 108 |
|
| 109 |
// Make room for 3 planes. |
| 110 |
tif = tif.with_limitsrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]with_limits().({ |
| 111 |
limits.decoding_buffer_sizerust-analyzer cargo tiff 0.11.3 decoder/Limits#decoding_buffer_size. = 374 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().499 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().3; |
| 112 |
limits.clonerust-analyzer cargo tiff 0.11.3 decoder/impl#[Limits][Clone]clone().() |
| 113 |
}); |
| 114 |
|
| 115 |
tif.read_image_to_bufferrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]read_image_to_buffer().(&mut buffer).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 116 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buffer.as_bufferrust-analyzer cargo tiff 0.11.3 decoder/impl#[DecodingResult]as_buffer().(0).byte_lenrust-analyzer cargo tiff 0.11.3 decoder/impl#[`DecodingBuffer<'a>`]byte_len().(), 374 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). 499 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). 3); |
| 117 |
|
| 118 |
// Make room for 4 planes? |
| 119 |
tif = tif.with_limitsrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]with_limits().({ |
| 120 |
limits.decoding_buffer_sizerust-analyzer cargo tiff 0.11.3 decoder/Limits#decoding_buffer_size. = 374 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().499 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().4; |
| 121 |
limits.clonerust-analyzer cargo tiff 0.11.3 decoder/impl#[Limits][Clone]clone().() |
| 122 |
}); |
| 123 |
|
| 124 |
tif.read_image_to_bufferrust-analyzer cargo tiff 0.11.3 decoder/impl#[`Decoder<R>`]read_image_to_buffer().(&mut buffer).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 125 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buffer.as_bufferrust-analyzer cargo tiff 0.11.3 decoder/impl#[DecodingResult]as_buffer().(0).byte_lenrust-analyzer cargo tiff 0.11.3 decoder/impl#[`DecodingBuffer<'a>`]byte_len().(), 374 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). 499 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). 3); |
| 126 |
} |