pub struct ChunkOpts {Show 14 fields
pub byte_order: ByteOrder,
pub image_width: u32,
pub image_height: u32,
pub bits_per_sample: u8,
pub samples: u16,
pub sample_format: SampleFormat,
pub photometric_interpretation: PhotometricInterpretation,
pub compression_method: CompressionMethod,
pub predictor: Predictor,
pub jpeg_tables: Option<Arc<Vec<u8>>>,
pub planar_config: PlanarConfiguration,
pub chunk_type: ChunkType,
pub strip_decoder: Option<StripDecodeState>,
pub tile_attributes: Option<TileAttributes>,
}Expand description
Struct that holds all relevant metadata that is needed to decode a chunk (strip or tile). this does not include chunkoffsets or -bytes, since those may be partial and then mutated. once we implement partial tags
Fields§
§byte_order: ByteOrdertiff byte order
image_width: u32width of the image in pixels
image_height: u32height of the image in pixels
bits_per_sample: u8bits per sample
samples: u16samples per pixel
sample_format: SampleFormatdatatype of samples
photometric_interpretation: PhotometricInterpretationphotometric interpretation
compression_method: CompressionMethodcompression method
supported decoding:
LZWModernJPEGDeflate- `PackBits``
predictor: Predictorhorizontal predictor type
Allows for more efficient compression
jpeg_tables: Option<Arc<Vec<u8>>>Jpeg tables
In case of ModernJPEG compression, the compression infomation can be in this tag, where it is prepended to chunks before decoding. still an Arc, because we want to do error sharing.
planar_config: PlanarConfigurationPlanar configuration:
example: RGB
- Chunky: [RGBRGBRGB]
- Planar: [RRR] [GGG] [BBB]
chunk_type: ChunkTypeChunk type
Either Strip or Tile Strip => Some(StripDecoder) && None Tile => None && Some(TileAttributes)
strip_decoder: Option<StripDecodeState>§tile_attributes: Option<TileAttributes>Implementations§
Source§impl ChunkOpts
impl ChunkOpts
Sourcepub fn samples_per_pixel(&self) -> usize
pub fn samples_per_pixel(&self) -> usize
Samples per pixel within chunk.
In planar config, samples are stored in separate strips/chunks, also called bands.
Example with bits_per_sample = [8, 8, 8] and PhotometricInterpretation::RGB:
PlanarConfiguration::Chunky-> 3 (RGBRGBRGB…)PlanarConfiguration::Planar-> 1 (RRR…) (GGG…) (BBB…)
Sourcepub fn output_row_stride(&self, chunk_index: u32) -> TiffResult<usize>
pub fn output_row_stride(&self, chunk_index: u32) -> TiffResult<usize>
The length of a chunk row in bytes, taking padding into account.
Sourcepub fn chunk_dimensions(&self) -> TiffResult<(u32, u32)>
pub fn chunk_dimensions(&self) -> TiffResult<(u32, u32)>
dimensions of a chunk, not taking padding into account.
Can be directly deduced from ChunkType and corresponding data
Sourcepub fn chunk_data_dimensions(&self, chunk_index: u32) -> TiffResult<(u32, u32)>
pub fn chunk_data_dimensions(&self, chunk_index: u32) -> TiffResult<(u32, u32)>
return the dimensions of an expanded chunk, taking into account padding at the bottom and right side of the file.
Trait Implementations§
impl StructuralPartialEq for ChunkOpts
Auto Trait Implementations§
impl Freeze for ChunkOpts
impl RefUnwindSafe for ChunkOpts
impl Send for ChunkOpts
impl Sync for ChunkOpts
impl Unpin for ChunkOpts
impl UnwindSafe for ChunkOpts
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)