Table of Contents

Class TiffTag

Namespace
Egami.Formats.Tiff
Assembly
Egami.dll

A TIFF tag Egami does not map, kept as it was read so the TIFF writer can write it back: GeoTIFF, DNG and private tags.

public sealed record TiffTag : IEquatable<TiffTag>
Inheritance
TiffTag
Implements
Inherited Members

Examples

using Raster page = Raster.Load("scan.tif");
TiffDetails tiff = (TiffDetails)page.Metadata.FormatDetails!;
Console.WriteLine($"page {tiff.PageIndex}: {tiff.Photometric}, {tiff.BitsPerSample}-bit, {tiff.Compression}, {tiff.ByteOrder}, {tiff.Layout}");
Console.WriteLine(tiff.TileWidth is int tile ? $"tiles of {tile}" : $"{tiff.RowsPerStrip} rows a strip");

// Tags Egami does not map are kept as they were read.
foreach (TiffTag tag in tiff.OtherTags)
{
    Console.WriteLine($"tag {tag.Id}: {tag.Count} × {tag.Type}");
}

Constructors

TiffTag(int, ExifType, int, ReadOnlyMemory<byte>)

A TIFF tag Egami does not map, kept as it was read so the TIFF writer can write it back: GeoTIFF, DNG and private tags.

public TiffTag(int Id, ExifType Type, int Count, ReadOnlyMemory<byte> Value)

Parameters

Id int

The tag number.

Type ExifType

The field type.

Count int

The number of values.

Value ReadOnlyMemory<byte>

The values, little-endian whatever the file's byte order.

Examples

using Raster page = Raster.Load("scan.tif");
TiffDetails tiff = (TiffDetails)page.Metadata.FormatDetails!;
Console.WriteLine($"page {tiff.PageIndex}: {tiff.Photometric}, {tiff.BitsPerSample}-bit, {tiff.Compression}, {tiff.ByteOrder}, {tiff.Layout}");
Console.WriteLine(tiff.TileWidth is int tile ? $"tiles of {tile}" : $"{tiff.RowsPerStrip} rows a strip");

// Tags Egami does not map are kept as they were read.
foreach (TiffTag tag in tiff.OtherTags)
{
    Console.WriteLine($"tag {tag.Id}: {tag.Count} × {tag.Type}");
}

Properties

Count

The number of values.

public int Count { get; init; }

Property Value

int

Id

The tag number.

public int Id { get; init; }

Property Value

int

Type

The field type.

public ExifType Type { get; init; }

Property Value

ExifType

Value

The values, little-endian whatever the file's byte order.

public ReadOnlyMemory<byte> Value { get; init; }

Property Value

ReadOnlyMemory<byte>