Class TiffDataType
- Namespace
- Aspose.Imaging.FileFormats.Tiff
- Assembly
- Aspose.Imaging.dll
The TIFF data type.
public abstract class TiffDataType : IComparable
- Inheritance
-
TiffDataType
- Implements
- Derived
- Inherited Members
Constructors
TiffDataType(ushort)
Initializes a new instance of the TiffDataType class.
protected TiffDataType(ushort tagId)
Parameters
tagId
ushortThe tag id.
Properties
Count
Gets the count of elements.
public abstract ulong Count { get; }
Property Value
- ulong
The count of elements.
DataSize
Gets the tag value size.
public virtual ulong DataSize { get; }
Property Value
ElementSize
Gets the element size in bytes.
public virtual byte ElementSize { get; }
Property Value
Id
Gets tag id as number.
public ushort Id { get; }
Property Value
IsValid
Gets a value indicating whether tag data is valid. The valid tag contains data which may be preserved. The invalid tag cannot be stored.
public bool IsValid { get; }
Property Value
- bool
true
if tag data is valid; otherwise,false
.
TagId
Gets the tag id.
public TiffTags TagId { get; }
Property Value
- TiffTags
The tag id.
TagType
Gets the tag type.
public abstract TiffDataTypes TagType { get; }
Property Value
- TiffDataTypes
The tag type.
Value
Gets or sets the value this data type contains.
public abstract object Value { get; set; }
Property Value
- object
The value.
Methods
CompareTo(object)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(object obj)
Parameters
obj
objectAn object to compare with this instance.
Returns
- int
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than
obj
. Zero This instance is equal toobj
. Greater than zero This instance is greater thanobj
.
Exceptions
- TiffImageException
Expected TiffDataType type.
CopyInstanceData(TiffDataType)
Copies the instance data into the cloned type.
protected virtual void CopyInstanceData(TiffDataType clonedType)
Parameters
clonedType
TiffDataTypeThe cloned type.
CreateInstance()
Creates a new instance.
protected abstract TiffDataType CreateInstance()
Returns
- TiffDataType
A new TiffDataType instance.
DeepClone()
Performs a deep clone of this instance.
public virtual TiffDataType DeepClone()
Returns
- TiffDataType
A deep clone of the current instance.
GetAdditionalDataSize(byte)
Gets the additional tag value size in bytes (in case the tag can not fit the whole tag value).
public virtual ulong GetAdditionalDataSize(byte sizeOfTagValue)
Parameters
sizeOfTagValue
byteSize of tag value: 4 or 8 for BigTiff.
Returns
- ulong
The additional data size in bytes.
GetAlignedDataSize(byte)
Gets the data size aligned in 4-byte (int) or 8-byte (long) boundary.
public ulong GetAlignedDataSize(byte sizeOfTagValue)
Parameters
sizeOfTagValue
byteSize of tag value.
Returns
- ulong
The aligned data size in bytes.
ReadData(TiffStreamReader, long, long)
Reads the additional data.
protected abstract void ReadData(TiffStreamReader dataStream, long position, long count)
Parameters
dataStream
TiffStreamReaderThe data stream.
position
longThe position to read from.
count
longThe count of elements.
ReadTag(TiffStreamReader, long)
Reads the tag data.
public static TiffDataType ReadTag(TiffStreamReader dataStream, long position)
Parameters
dataStream
TiffStreamReaderThe data stream.
position
longThe tag position.
Returns
- TiffDataType
The read tag.
Exceptions
- ArgumentNullException
dataStream
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
WriteAdditionalData(TiffStreamWriter)
Writes the additional tag data.
public abstract long WriteAdditionalData(TiffStreamWriter dataStream)
Parameters
dataStream
TiffStreamWriterThe data stream.
Returns
- long
The actual bytes written.
WriteTag(TiffStreamWriter, long)
Writes the tag data.
public void WriteTag(TiffStreamWriter dataStream, long additionalDataOffset)
Parameters
dataStream
TiffStreamWriterThe data stream.
additionalDataOffset
longThe offset to write additional data to.
Exceptions
- ImageSaveException
Unable to Write values for + this.TagType + Message : + exception.Message
WriteTagValueOrOffset(TiffStreamWriter, long)
Writes the tag value or additional offset.
protected abstract void WriteTagValueOrOffset(TiffStreamWriter dataStream, long additionalDataOffset)
Parameters
dataStream
TiffStreamWriterThe data stream.
additionalDataOffset
longThe additional data offset.