Skip to content

Commit 67eca9c

Browse files
committed
Change to pub(crate) fields
1 parent b3640c0 commit 67eca9c

File tree

3 files changed

+12
-31
lines changed

3 files changed

+12
-31
lines changed

src/ifd.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ impl ImageFileDirectory {
700700
},
701701
bits_per_sample: &self.bits_per_sample,
702702
samples_per_pixel: self.samples_per_pixel,
703-
sample_format: &self.sample_format,
704703
planar_configuration: self.planar_configuration,
705704
}
706705
}

src/predictor.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,7 @@ mod test {
285285
use bytes::Bytes;
286286

287287
use crate::{
288-
predictor::FloatingPointPredictor,
289-
reader::Endianness,
290-
tiff::tags::{PlanarConfiguration, SampleFormat},
288+
predictor::FloatingPointPredictor, reader::Endianness, tiff::tags::PlanarConfiguration,
291289
tile::PredictorInfo,
292290
};
293291

@@ -301,7 +299,6 @@ mod test {
301299
chunk_height: 4,
302300
bits_per_sample: &[8],
303301
samples_per_pixel: 1,
304-
sample_format: &[SampleFormat::Uint],
305302
planar_configuration: crate::tiff::tags::PlanarConfiguration::Chunky,
306303
};
307304
#[rustfmt::skip]
@@ -382,7 +379,6 @@ mod test {
382379
for (x,y, input, expected) in cases {
383380
println!("uints littleendian");
384381
predictor_info.endianness = Endianness::LittleEndian;
385-
predictor_info.sample_format = &[SampleFormat::Uint];
386382
predictor_info.bits_per_sample = &[8];
387383
assert_eq!(-1i32 as u8, 255);
388384
println!("testing u8");
@@ -409,7 +405,6 @@ mod test {
409405
assert_eq!(p.fix_endianness_and_unpredict(buffer, &predictor_info, x, y).unwrap(), res);
410406

411407
println!("ints littleendian");
412-
predictor_info.sample_format = &[SampleFormat::Int];
413408
predictor_info.bits_per_sample = &[8];
414409
println!("testing i8");
415410
let buffer = Bytes::from(input.iter().flat_map(|v| (*v as i8).to_le_bytes()).collect::<Vec<_>>());
@@ -434,7 +429,6 @@ mod test {
434429

435430
println!("uints bigendian");
436431
predictor_info.endianness = Endianness::BigEndian;
437-
predictor_info.sample_format = &[SampleFormat::Uint];
438432
predictor_info.bits_per_sample = &[8];
439433
assert_eq!(-1i32 as u8, 255);
440434
println!("testing u8");
@@ -509,7 +503,6 @@ mod test {
509503
chunk_height: 4,
510504
bits_per_sample: &[16],
511505
samples_per_pixel: 1,
512-
sample_format: &[SampleFormat::IEEEFP],
513506
planar_configuration: PlanarConfiguration::Chunky,
514507
};
515508
let input = Bytes::from_owner(diffed);
@@ -539,7 +532,6 @@ mod test {
539532
chunk_height: 4,
540533
bits_per_sample: &[16],
541534
samples_per_pixel: 1,
542-
sample_format: &[SampleFormat::IEEEFP],
543535
planar_configuration: PlanarConfiguration::Chunky,
544536
};
545537
let input = Bytes::from_owner(diffed);
@@ -568,7 +560,6 @@ mod test {
568560
chunk_height: 2,
569561
bits_per_sample: &[32],
570562
samples_per_pixel: 1,
571-
sample_format: &[SampleFormat::IEEEFP],
572563
planar_configuration: PlanarConfiguration::Chunky,
573564
};
574565
let input = Bytes::from_owner(diffed);
@@ -603,7 +594,6 @@ mod test {
603594
chunk_height: 2,
604595
bits_per_sample: &[64],
605596
samples_per_pixel: 1,
606-
sample_format: &[SampleFormat::IEEEFP],
607597
planar_configuration: PlanarConfiguration::Chunky,
608598
};
609599
let input = Bytes::from_owner(diffed);

src/tile.rs

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::error::AsyncTiffResult;
55
use crate::predictor::{FloatingPointPredictor, HorizontalPredictor, NoPredictor, Unpredict};
66
use crate::reader::Endianness;
77
use crate::tiff::tags::{
8-
CompressionMethod, PhotometricInterpretation, PlanarConfiguration, Predictor, SampleFormat,
8+
CompressionMethod, PhotometricInterpretation, PlanarConfiguration, Predictor,
99
};
1010
use crate::tiff::{TiffError, TiffUnsupportedError};
1111

@@ -17,33 +17,29 @@ use crate::tiff::{TiffError, TiffUnsupportedError};
1717
/// Also provides convenience functions
1818
///
1919
#[derive(Debug, Clone, Copy)]
20-
pub struct PredictorInfo<'a> {
20+
pub(crate) struct PredictorInfo<'a> {
2121
/// endianness
22-
pub endianness: Endianness,
22+
pub(crate) endianness: Endianness,
2323
/// width of the image in pixels
24-
pub image_width: u32,
24+
pub(crate) image_width: u32,
2525
/// height of the image in pixels
26-
pub image_height: u32,
26+
pub(crate) image_height: u32,
2727
/// chunk width in pixels
2828
///
2929
/// If this is a stripped tiff, `chunk_width=image_width`
30-
pub chunk_width: u32,
30+
pub(crate) chunk_width: u32,
3131
/// chunk height in pixels
32-
pub chunk_height: u32,
32+
pub(crate) chunk_height: u32,
3333
/// bits per sample, as an array
3434
///
3535
/// Can also be a single value, in which case it applies to all samples
36-
pub bits_per_sample: &'a [u16], // maybe say that we only support a single bits_per_sample?
36+
pub(crate) bits_per_sample: &'a [u16], // maybe say that we only support a single bits_per_sample?
3737
/// number of samples per pixel
38-
pub samples_per_pixel: u16,
39-
/// sample format for each sample
40-
///
41-
/// There is no decoding implementation in this crate (or libtiff) for mixed sample formats
42-
pub sample_format: &'a [SampleFormat], // and a single sample_format?
38+
pub(crate) samples_per_pixel: u16,
4339
/// planar configuration
4440
///
4541
/// determines the bits per pixel
46-
pub planar_configuration: PlanarConfiguration,
42+
pub(crate) planar_configuration: PlanarConfiguration,
4743
}
4844

4945
impl PredictorInfo<'_> {
@@ -260,10 +256,7 @@ impl Tile<'_> {
260256

261257
#[cfg(test)]
262258
mod test {
263-
use crate::{
264-
reader::Endianness,
265-
tiff::tags::{PlanarConfiguration, SampleFormat},
266-
};
259+
use crate::{reader::Endianness, tiff::tags::PlanarConfiguration};
267260

268261
use super::PredictorInfo;
269262

@@ -277,7 +270,6 @@ mod test {
277270
chunk_height: 8,
278271
bits_per_sample: &[8],
279272
samples_per_pixel: 1,
280-
sample_format: &[SampleFormat::Uint],
281273
planar_configuration: PlanarConfiguration::Chunky,
282274
};
283275
assert_eq!(info.bits_per_pixel(), 8);

0 commit comments

Comments
 (0)