Skip to main content

ImageFileDirectory

Struct ImageFileDirectory 

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

An ImageFileDirectory representing Image content

Implementations§

Source§

impl ImageFileDirectory

Source

pub fn from_tags( tag_data: HashMap<Tag, TagValue>, endianness: Endianness, ) -> AsyncTiffResult<Self>

Create a new ImageFileDirectory from tag data

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) -> Compression

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<&[ExtraSamples]>

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 model_transformation(&self) -> Option<&[f64]>

Stores a full 4×4 affine transformation matrix that maps pixel/line coordinates directly into model (map) coordinates.

Source

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

Source

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

GDAL Metadata XML information

Non standard metadata items are grouped together into a XML string stored in the non standard TIFFTAG_GDAL_METADATA ASCII tag (code 42112).

Source

pub fn other_tags(&self) -> &HashMap<Tag, TagValue>

Tags for which this crate doesn’t have a hard-coded enum variant.

Source

pub fn lerc_parameters(&self) -> Option<&[u32]>

LERC parameters, used in LERC-compressed TIFFs.

Source

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

A color map for palette color images.

This field defines a Red-Green-Blue color map (often called a lookup table) for palette-color images. In a palette-color image, a pixel value is used to index into an RGB lookup table. For example, a palette-color pixel having a value of 0 would be displayed according to the 0th Red, Green, Blue triplet.

In a TIFF ColorMap, all the Red values come first, followed by the Green values, then the Blue values. The number of values for each color is 2**BitsPerSample. Therefore, the ColorMap field for an 8-bit palette-color image would have 3 * 256 values. The width of each value is 16 bits, as implied by the type of SHORT. 0 represents the minimum intensity, and 65535 represents the maximum intensity. Black is represented by 0,0,0, and white by 65535, 65535, 65535.

ColorMap must be included in all palette-color images.

https://web.archive.org/web/20240329145324/https://www.awaresystems.be/imaging/tiff/tifftags/colormap.html

Source

pub fn tile_byte_range(&self, x: usize, y: usize) -> Option<TileByteRange>

Find the byte range(s) for the tile located at x column and y row.

Source

pub fn tiles_byte_ranges( &self, xy: &[(usize, usize)], ) -> Option<TilesByteRanges>

Find the byte ranges for the tiles located at x column and y row.

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.

For planar configuration TIFFs, this automatically fetches all bands for the tile at position (x, y) and combines them into a single Tile.

Source

pub async fn fetch_tiles( &self, xy: &[(usize, 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 duplicate 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
Source§

impl PartialEq for ImageFileDirectory

Source§

fn eq(&self, other: &ImageFileDirectory) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ImageFileDirectory

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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