Class TiffOptions
- Namespace
- Aspose.Imaging.ImageOptions
- Assembly
- Aspose.Imaging.dll
The tiff file format options. Note that width and height tags will get overwritten on image creation by width and height parameters so there is no need to specify them directly. Note that many options return a default value but that does not mean that this option is set explicitly as a tag value. To verify the tag is present use Tags property or the corresponding IsTagPresent method.
public class TiffOptions : ImageOptionsBase, IDisposable, IHasExifData, IHasXmpData, IHasMetadata
- Inheritance
-
TiffOptions
- Implements
- Derived
- Inherited Members
Constructors
TiffOptions(TiffExpectedFormat)
Initializes a new instance of the TiffOptions class. By default little endian convention is used.
public TiffOptions(TiffExpectedFormat expectedFormat)
Parameters
expectedFormat
TiffExpectedFormatThe expected tiff file format.
TiffOptions(TiffExpectedFormat, TiffByteOrder)
Initializes a new instance of the TiffOptions class.
public TiffOptions(TiffExpectedFormat expectedFormat, TiffByteOrder byteOrder)
Parameters
expectedFormat
TiffExpectedFormatThe expected tiff file format.
byteOrder
TiffByteOrderThe tiff file format byte order to use.
TiffOptions(TiffDataType[])
Initializes a new instance of the TiffOptions class.
public TiffOptions(TiffDataType[] tags)
Parameters
tags
TiffDataType[]The tags to initialize options with.
TiffOptions(TiffOptions)
Initializes a new instance of the TiffOptions class.
public TiffOptions(TiffOptions options)
Parameters
options
TiffOptionsThe options to copy from.
Properties
AlphaStorage
Gets or sets the alpha storage option. Options other than Unspecified are used when there are more than 3 SamplesPerPixel defined.
public TiffAlphaStorage AlphaStorage { get; set; }
Property Value
- TiffAlphaStorage
The alpha storage option.
Artist
Gets or sets the artist.
public string Artist { get; set; }
Property Value
- string
The artist.
BitsPerPixel
Gets the bits per pixel.
public int BitsPerPixel { get; }
Property Value
- int
The bits per pixel.
BitsPerSample
Gets or sets the bits per sample.
public ushort[] BitsPerSample { get; set; }
Property Value
- ushort[]
The bits per sample value.
Remarks
When setting this value keep in mind that it will also set SamplesPerPixel value to array length. These 2 properties are very tightly coupled so may be set alltogether only.
ByteOrder
Gets or sets a value indicating the tiff byte order.
public TiffByteOrder ByteOrder { get; set; }
Property Value
ColorMap
Gets or sets the color map.
public ushort[] ColorMap { get; set; }
Property Value
- ushort[]
The color map.
Exceptions
- ArgumentNullException
value
- TiffImageException
The color map may be defined for samples per pixel equal to 1 only. or The bits per sample are not defined.
- ArgumentOutOfRangeException
value;The array length must correspond to the followign formula: 3 * (2**BitsPerSample).
CompressedQuality
Gets or sets compressed image quality. Used with the Jpeg compression.
public int CompressedQuality { get; set; }
Property Value
Compression
Gets or sets the compression.
public TiffCompressions Compression { get; set; }
Property Value
- TiffCompressions
The compression.
Copyright
Gets or sets the copyright.
public string Copyright { get; set; }
Property Value
- string
The copyright.
DateTime
Gets or sets the date and time.
public string DateTime { get; set; }
Property Value
- string
The date and time.
DefaultMemoryAllocationLimit
Gets or sets the default memory allocation limit.
[Obsolete("Use Aspose.Imaging.Image.BufferSizeHint, Aspose.Imaging.ImageOptionsBase.BufferSizeHint or Aspose.Imaging.LoadOptions.BufferSizeHint instead.")]
public int DefaultMemoryAllocationLimit { get; set; }
Property Value
- int
The default memory allocation limit.
DisableIccExport
Gets or sets a value indicating whether ICC profile export is disabled (ICC profile is applied to the source pixels beforehand).
public bool DisableIccExport { get; set; }
Property Value
DocumentName
Gets or sets the name of the document.
public string DocumentName { get; set; }
Property Value
- string
The name of the document.
ExifData
Gets or sets Exif data.
public ExifData ExifData { get; set; }
Property Value
ExifIfd
Gets or sets the pointer to EXIF IFD.
public TiffExifIfd ExifIfd { get; }
Property Value
- TiffExifIfd
The pointer to EXIF IFD.
ExtraSamples
Gets the extra samples values.
public ushort[] ExtraSamples { get; }
Property Value
- ushort[]
The extra samples value.
FaxT4Options
Gets or sets the fax t4 options.
public Group3Options FaxT4Options { get; set; }
Property Value
- Group3Options
The fax t4 options.
FileStandard
Gets or sets the TIFF file standard.
public TiffFileStandards FileStandard { get; set; }
Property Value
- TiffFileStandards
The TIFF file standard.
FillOrder
Gets or sets the byte bits fill order.
public TiffFillOrders FillOrder { get; set; }
Property Value
- TiffFillOrders
The byte bits fill order.
HalfToneHints
Gets or sets the halftone hints.
public ushort[] HalfToneHints { get; set; }
Property Value
- ushort[]
The halftone hints.
Exceptions
- ArgumentNullException
value
- ArgumentOutOfRangeException
value;Halftone hints array length must be equal to 2.
IccProfile
Gets or sets the Icc profile stream.
public MemoryStream IccProfile { get; set; }
Property Value
- MemoryStream
The icc profile.
ImageDescription
Gets or sets the image description.
public string ImageDescription { get; set; }
Property Value
- string
The image description.
ImageLength
Gets or sets the image length.
public uint ImageLength { get; set; }
Property Value
- uint
The image length.
ImageWidth
Gets or sets the image width.
public uint ImageWidth { get; set; }
Property Value
- uint
The image width.
InkNames
Gets or sets the ink names.
public string InkNames { get; set; }
Property Value
- string
The ink names.
IsExtraSamplesPresent
Gets a value indicating whether the extra samples is present.
public bool IsExtraSamplesPresent { get; }
Property Value
- bool
true
if the extra samples is present; otherwise,false
.
IsTiled
Gets a value indicating whether image is tiled.
public bool IsTiled { get; }
Property Value
- bool
true
if image is tiled; otherwise,false
.
IsValid
Gets a value indicating whether the TiffOptions have been properly configured. Use Validate method as to find the failure reason.
public bool IsValid { get; }
Property Value
- bool
true
if TiffOptions are properly configured; otherwise,false
.
MaxSampleValue
Gets or sets the max sample value.
public ushort[] MaxSampleValue { get; set; }
Property Value
- ushort[]
The max sample value.
Exceptions
- ArgumentNullException
value
- ArgumentOutOfRangeException
value;The array length must correspond to the samples per pixel count.
MinSampleValue
Gets or sets the min sample value.
public ushort[] MinSampleValue { get; set; }
Property Value
- ushort[]
The min sample value.
Exceptions
- ArgumentNullException
value
- ArgumentOutOfRangeException
value;The array length must correspond to the samples per pixel count.
Orientation
Gets or sets the orientation.
public TiffOrientations Orientation { get; set; }
Property Value
- TiffOrientations
The orientation.
PageName
Gets or sets the page name.
public string PageName { get; set; }
Property Value
- string
The page name.
PageNumber
Gets or sets the page number tag.
public ushort[] PageNumber { get; set; }
Property Value
- ushort[]
The page number tag.
Exceptions
- ArgumentNullException
value
- ArgumentOutOfRangeException
value;Expected 2 values in the array: PageNumber[0] is the page number and PageNumber[1] is the total number of pages in the document.
Palette
Gets or sets the color palette.
public override IColorPalette Palette { get; set; }
Property Value
- IColorPalette
The color palette.
Photometric
Gets or sets the photometric.
public TiffPhotometrics Photometric { get; set; }
Property Value
- TiffPhotometrics
The photometric.
PlanarConfiguration
Gets or sets the planar configuration.
public TiffPlanarConfigs PlanarConfiguration { get; set; }
Property Value
- TiffPlanarConfigs
The planar configuration.
Predictor
Gets or sets the predictor for LZW compression.
public TiffPredictor Predictor { get; set; }
Property Value
- TiffPredictor
The predictor type.
PremultiplyComponents
Gets or sets a value indicating whether components must be premultiplied.
public bool PremultiplyComponents { get; set; }
Property Value
- bool
true
if components must be premultiplied; otherwise,false
.
ResolutionSettings
Gets or sets the resolution settings.
public override ResolutionSetting ResolutionSettings { get; set; }
Property Value
ResolutionUnit
Gets or sets the resolution unit.
public TiffResolutionUnits ResolutionUnit { get; set; }
Property Value
- TiffResolutionUnits
The resolution unit.
RowsPerStrip
Gets or sets the rows per strip.
public uint RowsPerStrip { get; set; }
Property Value
- uint
The rows per strip.
SampleFormat
Gets or sets the sample format.
public TiffSampleFormats[] SampleFormat { get; set; }
Property Value
- TiffSampleFormats[]
The sample format.
Exceptions
- ArgumentNullException
value
- ArgumentOutOfRangeException
value;The array length must correspond to the samples per pixel count.
SamplesPerPixel
Gets the samples per pixel. To change this property value use the BitsPerSample property setter.
public ushort SamplesPerPixel { get; }
Property Value
- ushort
The samples per pixel.
ScannerManufacturer
Gets or sets the scanner manufacturer.
public string ScannerManufacturer { get; set; }
Property Value
- string
The scanner manufacturer.
ScannerModel
Gets or sets the scanner model.
public string ScannerModel { get; set; }
Property Value
- string
The scanner model.
SmaxSampleValue
Gets or sets the max sample value. The value has a field type which best matches the sample data (Byte, Short or Long type).
public uint[] SmaxSampleValue { get; set; }
Property Value
- uint[]
The max sample value.
SminSampleValue
Gets or sets the min sample value. The value has a field type which best matches the sample data (Byte, Short or Long type).
public uint[] SminSampleValue { get; set; }
Property Value
- uint[]
The min sample value.
SoftwareType
Gets or sets the software type.
public string SoftwareType { get; set; }
Property Value
- string
The software type.
StripByteCounts
Gets or sets the strip byte counts.
public ulong[] StripByteCounts { get; set; }
Property Value
- ulong[]
The strip byte counts.
StripOffsets
Gets or sets the strip offsets.
public ulong[] StripOffsets { get; set; }
Property Value
- ulong[]
The strip offsets.
SubFileType
Gets or sets a general indication of the kind of data contained in this subfile.
public TiffNewSubFileTypes SubFileType { get; set; }
Property Value
- TiffNewSubFileTypes
The general indication of the kind of data contained in this subfile.
TagCount
Gets the tag count.
public int TagCount { get; }
Property Value
Tags
Gets or sets the tags.
public TiffDataType[] Tags { get; set; }
Property Value
- TiffDataType[]
The tags.
TargetPrinter
Gets or sets the target printer.
public string TargetPrinter { get; set; }
Property Value
- string
The target printer.
Threshholding
Gets or sets the threshholding.
public TiffThresholds Threshholding { get; set; }
Property Value
- TiffThresholds
The threshholding.
TileByteCounts
Gets or sets the tile byte counts.
public ulong[] TileByteCounts { get; set; }
Property Value
- ulong[]
TileLength
Gets ot sets tile length.
public uint TileLength { get; set; }
Property Value
TileOffsets
Gets or sets the tile offsets.
public ulong[] TileOffsets { get; set; }
Property Value
- ulong[]
TileWidth
Gets ot sets tile width.
public uint TileWidth { get; set; }
Property Value
TotalPages
Gets the total pages.
public ushort TotalPages { get; }
Property Value
- ushort
The total pages.
ValidTagCount
Gets the valid tag count. This is not the total tags count but the number of tags which may be preserved.
public int ValidTagCount { get; }
Property Value
- int
The valid tag count.
XPAuthor
Gets or sets image author, which used by Windows Explorer.
public string XPAuthor { get; set; }
Property Value
- string
Image Author, used by Windows Explorer. The XPAuthor is ignored by Windows Explorer if the Artist tag exists.
XPComment
Gets or sets comment on image, which used by Windows Explorer.
public string XPComment { get; set; }
Property Value
- string
Comment on image, used by Windows Explorer.
XPKeywords
Gets or sets subject image, which used by Windows Explorer.
public string XPKeywords { get; set; }
Property Value
- string
Subject image, used by Windows Explorer.
XPSubject
Gets or sets information about image, which used by Windows Explorer.
public string XPSubject { get; set; }
Property Value
- string
Information about image, used by Windows Explorer.
XPTitle
Gets or sets information about image, which used by Windows Explorer.
public string XPTitle { get; set; }
Property Value
- string
Information about image, used by Windows Explorer. The XPTitle is ignored by Windows Explorer if the ImageDescription tag exists.
Xposition
Gets or sets the x position.
public TiffRational Xposition { get; set; }
Property Value
- TiffRational
The x position.
Xresolution
Gets or sets the x resolution.
public TiffRational Xresolution { get; set; }
Property Value
- TiffRational
The x resolution.
YCbCrCoefficients
Gets or sets the YCbCrCoefficients.
public TiffRational[] YCbCrCoefficients { get; set; }
Property Value
- TiffRational[]
The YCbCrCoefficients.
Exceptions
- TiffImageException
Invalid count of rational coefficient values. Must be equal to 3.
- ArgumentNullException
value
YCbCrSubsampling
Gets or sets the subsampling factors for YCbCr photometric.
public ushort[] YCbCrSubsampling { get; set; }
Property Value
- ushort[]
The subsampling factors for YCbCr photometric.
Exceptions
- TiffImageException
Invalid field length. YCbCrSubsampling field must contain two values.
- ArgumentNullException
value
Yposition
Gets or sets the y position.
public TiffRational Yposition { get; set; }
Property Value
- TiffRational
The y position.
Yresolution
Gets or sets the y resolution.
public TiffRational Yresolution { get; set; }
Property Value
- TiffRational
The y resolution.
Methods
AddTag(TiffDataType)
Adds a new tag.
public void AddTag(TiffDataType tagToAdd)
Parameters
tagToAdd
TiffDataTypeThe tag to add.
AddTags(TiffDataType[])
Adds the tags.
public void AddTags(TiffDataType[] tagsToAdd)
Parameters
tagsToAdd
TiffDataType[]The tags to add.
Clone()
Clones this instance.
public override ImageOptionsBase Clone()
Returns
- ImageOptionsBase
Returns a deep clone.
GetTagByType(TiffTags)
Gets the instance of the tag by type.
public TiffDataType GetTagByType(TiffTags tagKey)
Parameters
tagKey
TiffTagsThe tag key.
Returns
- TiffDataType
Instance of the tag if exists or null otherwise.
GetValidTagsCount(TiffDataType[])
Gets the valid tags count.
public static int GetValidTagsCount(TiffDataType[] tags)
Parameters
tags
TiffDataType[]The tags to validate.
Returns
- int
The valid tags count.
IsTagPresent(TiffTags)
Determines whether tag is present in the options or not.
public bool IsTagPresent(TiffTags tag)
Parameters
tag
TiffTagsThe tag id to check.
Returns
- bool
true
if tag is present; otherwise,false
.
RemoveTag(TiffTags)
Removes the tag.
public bool RemoveTag(TiffTags tag)
Parameters
tag
TiffTagsThe tag to remove.
Returns
- bool
true if successfully removed
RemoveTags(params TiffTags[])
Removes the tags.
public bool RemoveTags(params TiffTags[] tags)
Parameters
tags
TiffTags[]The tags to remove.
Returns
Validate()
Validates if options have valid combination of tags
public void Validate()