Struct ImageFileDirectory

Source
pub struct ImageFileDirectory { /* private fields */ }
Expand description

An ImageFileDirectory representing Image content

Implementations§

Source§

impl ImageFileDirectory

Source

pub fn new_subfile_type(&self) -> Option<u32>

Source

pub fn image_width(&self) -> u32

The number of columns in the image, i.e., the number of pixels per row. https://web.archive.org/web/20240329145250/https://www.awaresystems.be/imaging/tiff/tifftags/imagewidth.html

Source

pub fn image_height(&self) -> u32

Source

pub fn bits_per_sample(&self) -> &[u16]

Source

pub fn compression(&self) -> CompressionMethod

Source

pub fn photometric_interpretation(&self) -> PhotometricInterpretation

Source

pub fn document_name(&self) -> Option<&str>

Document name.

Source

pub fn image_description(&self) -> Option<&str>

Source

pub fn strip_offsets(&self) -> Option<&[u64]>

Source

pub fn orientation(&self) -> Option<u16>

Source

pub fn samples_per_pixel(&self) -> u16

The number of components per pixel.

SamplesPerPixel is usually 1 for bilevel, grayscale, and palette-color images. SamplesPerPixel is usually 3 for RGB images. If this value is higher, ExtraSamples should give an indication of the meaning of the additional channels.

Source

pub fn rows_per_strip(&self) -> Option<u32>

Source

pub fn strip_byte_counts(&self) -> Option<&[u64]>

Source

pub fn min_sample_value(&self) -> Option<&[u16]>

Source

pub fn max_sample_value(&self) -> Option<&[u16]>

Source

pub fn x_resolution(&self) -> Option<f64>

Source

pub fn y_resolution(&self) -> Option<f64>

Source

pub fn planar_configuration(&self) -> PlanarConfiguration

How the components of each pixel are stored.

The specification defines these values:

  • Chunky format. The component values for each pixel are stored contiguously. For example, for RGB data, the data is stored as RGBRGBRGB
  • Planar format. The components are stored in separate component planes. For example, RGB data is stored with the Red components in one component plane, the Green in another, and the Blue in another.

The specification adds a warning that PlanarConfiguration=2 is not in widespread use and that Baseline TIFF readers are not required to support it.

If SamplesPerPixel is 1, PlanarConfiguration is irrelevant, and need not be included.

https://web.archive.org/web/20240329145250/https://www.awaresystems.be/imaging/tiff/tifftags/planarconfiguration.html

Source

pub fn resolution_unit(&self) -> Option<ResolutionUnit>

Source

pub fn software(&self) -> Option<&str>

Name and version number of the software package(s) used to create the image. https://web.archive.org/web/20240329145250/https://www.awaresystems.be/imaging/tiff/tifftags/software.html

Source

pub fn date_time(&self) -> Option<&str>

Date and time of image creation.

The format is: “YYYY:MM:DD HH:MM:SS”, with hours like those on a 24-hour clock, and one space character between the date and the time. The length of the string, including the terminating NUL, is 20 bytes.

https://web.archive.org/web/20240329145250/https://www.awaresystems.be/imaging/tiff/tifftags/datetime.html

Source

pub fn artist(&self) -> Option<&str>

Source

pub fn host_computer(&self) -> Option<&str>

The computer and/or operating system in use at the time of image creation. https://web.archive.org/web/20240329145250/https://www.awaresystems.be/imaging/tiff/tifftags/hostcomputer.html

Source

pub fn predictor(&self) -> Option<Predictor>

A mathematical operator that is applied to the image data before an encoding scheme is applied. https://web.archive.org/web/20240329145250/https://www.awaresystems.be/imaging/tiff/tifftags/predictor.html

Source

pub fn tile_width(&self) -> Option<u32>

Source

pub fn tile_height(&self) -> Option<u32>

The tile length (height) in pixels. This is the number of rows in each tile. https://web.archive.org/web/20240329145250/https://www.awaresystems.be/imaging/tiff/tifftags/tilelength.html

Source

pub fn tile_offsets(&self) -> Option<&[u64]>

For each tile, the byte offset of that tile, as compressed and stored on disk. https://web.archive.org/web/20240329145250/https://www.awaresystems.be/imaging/tiff/tifftags/tileoffsets.html

Source

pub fn tile_byte_counts(&self) -> Option<&[u64]>

Source

pub fn extra_samples(&self) -> Option<&[u16]>

Source

pub fn sample_format(&self) -> &[SampleFormat]

Source

pub fn jpeg_tables(&self) -> Option<&[u8]>

Source

pub fn copyright(&self) -> Option<&str>

Source

pub fn geo_key_directory(&self) -> Option<&GeoKeyDirectory>

Source

pub fn model_pixel_scale(&self) -> Option<&[f64]>

Source

pub fn model_tiepoint(&self) -> Option<&[f64]>

Source

pub fn colormap(&self) -> Option<HashMap<usize, [u8; 3]>>

Construct colormap from colormap tag

Source

pub async fn fetch_tile( &self, x: usize, y: usize, reader: &dyn AsyncFileReader, ) -> AsyncTiffResult<Tile>

Fetch the tile located at x column and y row using the provided reader.

Source

pub async fn fetch_tiles( &self, x: &[usize], y: &[usize], reader: &dyn AsyncFileReader, ) -> AsyncTiffResult<Vec<Tile>>

Fetch the tiles located at x column and y row using the provided reader.

Source

pub fn tile_count(&self) -> Option<(usize, usize)>

Return the number of x/y tiles in the IFD Returns None if this is not a tiled TIFF

Trait Implementations§

Source§

impl Clone for ImageFileDirectory

Source§

fn clone(&self) -> ImageFileDirectory

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ImageFileDirectory

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T