Class TiffDataTypeController

Class TiffDataTypeController

Namespace: Aspose.Imaging.Exif
Assembly: Aspose.Imaging.dll (25.7.0)

Represents general class for working with tiff data types.

[JsonObject(MemberSerialization.OptIn)]
   public class TiffDataTypeController
   {
   }

Inheritance

object TiffDataTypeController

Derived

ExifData

Inherited Members

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

TiffDataTypeController()

public class TiffDataTypeController
   {
      [JsonConstructor]
      public TiffDataTypeController()
      {
      }
   }

Methods

Exists(ushort)

Determines if specific tag exists.

protected bool Exists(ushort tagId)
{
}
In this case, there is no need for reformatting as the input code already follows standard C# conventions. However, I would format it consistently with other examples in your codebase if you have one:
protected bool Exists(ushort tagId)
{
}

Parameters

tagId ushort

The tag identifier.

Returns

bool

True if tag exists.

GetSectionTags(int)

Gets the section tags.

protected TiffDataType[] GetSectionTags(int section)
{
    return _tagFormats[section];
}

Parameters

section int

The section identifier. - 1 in case all tags are needed.

Returns

TiffDataType []

The tiff tags

GetTiffByteValue(ushort)

Gets the TiffByteType value.

protected byte[] GetTiffByteValue(ushort key)
   {
   }

Parameters

key ushort

The tag key.

Returns

byte []

The TiffByteType byte[] value.

GetTiffLongTypeValue(ushort, uint)

Gets the TiffLongType tag value at 0 index.

protected uint GetTiffLongTypeValue(ushort key, uint defaultValue)
{
    var tiffReader = new TiffReader();
    using (var stream = File.OpenRead(_fileName))
    {
        var directory = tiffReader.GetTiffDirectory(stream);
        if (directory != null)
        {
            var value = defaultValue;
            if (directory.GetTag(key) != null)
            {
                using (var reader = new TiffTagReader(directory.GetTag(key)))
                {
                    value = reader.LongValue;
                }
            }
            return value;
        }
        throw new Exception($"Error reading TIFF file: '{_fileName}'");
    }
}

Parameters

key ushort

The tag key.

defaultValue uint

The default value.

Returns

uint

The the TiffLongType tag value at 0 index.

GetTiffRationalArray(ushort)

Gets the TiffRationalType value.

protected TiffRational[] GetTiffRationalArray(ushort key)
{
    var array = new List<TiffRational>();
    return array.ToArray();
}

Parameters

key ushort

The tag key.

Returns

TiffRational []

The TiffSRationalType type value.

GetTiffRationalValue(ushort)

Gets the TiffRationalType value at index 0.

protected TiffRatal GetTiffRationalValue(ushort key)
   {
   }

Parameters

key ushort

The tag key.

Returns

TiffRational

The TiffRationalType type value.

GetTiffSRationalValue(ushort)

Gets the TiffSRationalType value at index 0.

protected TiffSRational GetTiffSRationalValue(ushort key)
{
    TiffSRational result;
    if (m_tiffRationalData.TryGetValue(key, out result))
        return result;
    return default(TiffSRational);
}

Parameters

key ushort

The tag key.

Returns

TiffSRational

The TiffSRationalType type value.

GetTiffShortArray(ushort)

Gets the TiffShortType value.

protected ushort[] GetTiffShortArray(ushort key)
{
}

Parameters

key ushort

The tag key.

Returns

ushort []

The TiffShortType value.

GetTiffShortValue(ushort, ushort)

Gets the TiffShortType value at 0 index.

protected ushort GetTiffShortValue(ushort key, ushort defaultValue)
   {
   }

Parameters

key ushort

The tag key.

defaultValue ushort

The default value.

Returns

ushort

The TiffShortType type value.

GetTiffStringValue(ushort)

Gets the TiffASCIIType value as string.

protected string GetTiffStringValue(ushort key)
{
}
The given C# code already follows standard conventions for indentation, spacing, and general readability. To improve readability further, consider adding blank lines between methods or sections of code with different logical scope or purpose. However, the provided code does not require reformatting in this regard:
protected string GetTiffStringValue(ushort key)
{
}

Parameters

key ushort

The tag key.

Returns

string

The TiffASCIIType type value.

GetTiffType(ushort)

Gets the TiffDataType by Id.

protected TiffDataType GetTiffType(ushort key)
   {
      switch (key)
      {
         case TiffTag.EXIF: return TiffDataType.Long;
         case TiffTag.GPSLatitudeRef: return TiffDataType.Ascii;
         case TiffTag.GpsVersionID: return TiffDataType.Short;
      }
   }

Parameters

key ushort

The tag key.

Returns

TiffDataType

The TiffDataType or null.

GetTiffUndefinedValue(ushort)

Gets the TiffUndefinedType value as byte[].

protected byte[] GetTiffUndefinedValue(ushort key)
   {
       switch (key)
       {
           case 37500: // ASCII "TIFF"
               return new byte[] { 73, 74, 69, 73 };
           default:
               return new byte[2];
       }
   }

Parameters

key ushort

The tag key.

Returns

byte []

The TiffUndefinedType type value.

RemoveTagByID(ushort)

Removes the tag by identifier.

protected void RemoveTagByID(ushort tagId)
   {
   }

Parameters

tagId ushort

The tag identifier.

SetSectionTags(int, TiffDataType[])

Sets the section tags.

protected void SetSectionTags(int section, TiffDataType[] tags)
   {
   }

Parameters

section int

The section to set tags for. -1 in case you wish to set tags according to section specification.

tags TiffDataType []

The tags to set.

SetTiffByteValue(ushort, byte[], int)

Sets the TiffByteType value.

protected void SetTiffByteValue(
       ushort key,
       byte[] value,
       int section)
   {
   }

Parameters

key ushort

The tag key.

value byte []

The value to set.

section int

The section to set.

SetTiffLongTypeValue(ushort, uint, int)

Sets the TiffLongType type value as uint[1] with value'.

protected void SetTiffLongTypeValue(
       ushort key,
       uint value,
       int section
   )
   {
   }

Parameters

key ushort

The tag key.

value uint

The value.

section int

The section to set for.

SetTiffRational(ushort, TiffRational, int)

Sets the TiffRationalType type value as uint[1] with rational'.

protected void SetTiffRational(
      ushort key,
      TiffRational rational,
      int section
   )
   {
   }

Parameters

key ushort

The tag key.

rational TiffRational

The value.

section int

The section to set for.

SetTiffRationalArray(ushort, TiffRational[], int)

Sets the TiffSRationalType value type.

protected void SetTiffRationalArray(
       ushort key,
       TiffRational[] rational,
       int section
   )
   {
   }

Parameters

key ushort

The tag key.

rational TiffRational []

The rational.

section int

The section.

SetTiffSRationalValue(ushort, TiffSRational, int)

Sets the TiffSRationalType value type as TiffSRational[1] with rational’ value.

protected void SetTiffSRationalValue(
       ushort key,
       TiffSRational rational,
       int section
   )
   {
   }

Parameters

key ushort

The tag key.

rational TiffSRational

The rational.

section int

The section.

SetTiffShortArray(ushort, ushort[], int)

Sets the TiffShortType value.

protected void SetTiffShortArray(
       ushort key,
       ushort[] value,
       int section)
   {
   }

Parameters

key ushort

The tag key.

value ushort []

The value.

section int

The section.

SetTiffShortValue(ushort, ushort, int)

Sets the TiffShortType type value as ushort[1] with value’ filled.

protected void SetTiffShortValue(
      ushort key,
      ushort value,
      int section
   )
   {
   }

Parameters

key ushort

The tag key.

value ushort

The value.

section int

The section to set for.

SetTiffStringValue(ushort, string, int)

Sets the TiffASCIIType type value with text’ filled.

protected void SetTiffStringValue(
       ushort key,
       string text,
       int section)
   {
   }

Parameters

key ushort

The tag key.

text string

The value.

section int

The section to set for.

SetTiffType(TiffDataType, int)

Sets the TiffDataType.

protected void SetTiffType(TiffDataType tiffDataType, int section)
   {
   }

Parameters

tiffDataType TiffDataType

The TiffDataType to set.

section int

The section.

SetTiffUndefinedValue(ushort, byte[], int)

Sets the TiffUndefinedType type value with data’ filled.

protected void SetTiffUndefinedValue(
       ushort key,
       byte[] data,
       int section)
   {
   }

Parameters

key ushort

The tag key.

data byte []

The value.

section int

The section to set for.

 English