Packages

 

com.aspose.cad.imageoptions

Class TiffOptions



  • public class TiffOptions
    extends ImageOptionsBase

    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.

    <developer_tip> WARNING! never modify tiff options during save since this may cause side effects and hard to find bugs. The following line was specially left commented since it caused incorrect determination of data beginning. The passed options did not contain spp (although the options are not correct in such case but still this scenario causes errors) and the next line caused +spp tag +bpp tag added and when options were written after data completely written they have overwritten the data beginning for uncompressed codec!!! See TiffUncompressedCodec.Encode. this.Options.SamplesPerPixel = 3; </developer_tip>
    • Constructor Detail

      • TiffOptions

        public TiffOptions(int expectedFormat,
                           int byteOrder)

        Initializes a new instance of the TiffOptions class.

        Parameters:
        expectedFormat - The expected tiff file format.
        byteOrder - The tiff file format byte order to use.
      • TiffOptions

        public TiffOptions(int expectedFormat)

        Initializes a new instance of the TiffOptions class. By default little endian convention is used.

        Parameters:
        expectedFormat - The expected tiff file format.
      • TiffOptions

        public TiffOptions(TiffOptions options)

        Initializes a new instance of the TiffOptions class.

        Parameters:
        options - The options to copy from.
      • TiffOptions

        public TiffOptions(TiffDataType[] tags)

        Initializes a new instance of the TiffOptions class.

        Parameters:
        tags - The tags to initialize options with.
    • Method Detail

      • isValid

        public boolean isValid()

        Gets a value indicating whether the TiffOptions have been properly configured. Use Validate method as to find the failure reason.

        Value: true if TiffOptions are properly configured; otherwise, false.
      • getArtist

        public String getArtist()

        Gets or sets the artist.

        Value: The artist.
      • setArtist

        public void setArtist(String value)

        Gets or sets the artist.

        Value: The artist.
      • isTagPresent

        public boolean isTagPresent(int tag)

        Determines whether tag is present in the options or not.

        Parameters:
        tag - The tag id to check.
        Returns:
        true if tag is present; otherwise, false.
      • getByteOrder

        public int getByteOrder()

        Gets or sets a value indicating the tiff byte order.

      • setByteOrder

        public void setByteOrder(int value)

        Gets or sets a value indicating the tiff byte order.

      • getIccProfile

        public byte[] getIccProfile()

        Gets the icc profile stream.

        Value: The icc profile.
      • getIccProfileInternal_internalized

        public com.aspose.ms.System.IO.MemoryStream getIccProfileInternal_internalized()
      • getBitsPerSample

        public int[] getBitsPerSample()

        Gets or sets the bits per sample.

        Value: The bits per sample value.

        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.

      • setBitsPerSample

        public void setBitsPerSample(int[] value)

        Gets or sets the bits per sample.

        Value: The bits per sample value.

        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.

      • getCompression

        public int getCompression()

        Gets or sets the compression.

        Value: The compression.
      • setCompression

        public void setCompression(int value)

        Gets or sets the compression.

        Value: The compression.
      • getCopyright

        public String getCopyright()

        Gets or sets the copyright.

        Value: The copyright.
      • setCopyright

        public void setCopyright(String value)

        Gets or sets the copyright.

        Value: The copyright.
      • getColorMap

        public int[] getColorMap()

        Gets or sets the color map.

        Throws:
        com.aspose.ms.System.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.
        com.aspose.ms.System.ArgumentOutOfRangeException - value;The array length must correspond to the followign formula: 3 * (2**BitsPerSample). Value: The color map.
      • setColorMap

        public void setColorMap(int[] value)

        Gets or sets the color map.

        Throws:
        com.aspose.ms.System.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.
        com.aspose.ms.System.ArgumentOutOfRangeException - value;The array length must correspond to the followign formula: 3 * (2**BitsPerSample). Value: The color map.
      • getDateTime

        public String getDateTime()

        Gets or sets the date and time.

        Value: The date and time.
      • setDateTime

        public void setDateTime(String value)

        Gets or sets the date and time.

        Value: The date and time.
      • getDocumentName

        public String getDocumentName()

        Gets or sets the name of the document.

        Value: The name of the document.
      • setDocumentName

        public void setDocumentName(String value)

        Gets or sets the name of the document.

        Value: The name of the document.
      • getAlphaStorage

        public int getAlphaStorage()

        Gets or sets the alpha storage option. Options other than TiffAlphaStorage.Unspecified are used when there are more than 3 SamplesPerPixel defined.

        Value: The alpha storage option.
      • setAlphaStorage

        public void setAlphaStorage(int value)

        Gets or sets the alpha storage option. Options other than TiffAlphaStorage.Unspecified are used when there are more than 3 SamplesPerPixel defined.

        Value: The alpha storage option.
      • isExtraSamplesPresent

        public boolean isExtraSamplesPresent()

        Gets a value indicating whether the extra samples is present.

        Value: true if the extra samples is present; otherwise, false.
      • getFillOrder

        public int getFillOrder()

        Gets or sets the byte bits fill order.

        Value: The byte bits fill order.
      • setFillOrder

        public void setFillOrder(int value)

        Gets or sets the byte bits fill order.

        Value: The byte bits fill order.
      • getHalfToneHints

        public int[] getHalfToneHints()

        Gets or sets the halftone hints.

        Throws:
        com.aspose.ms.System.ArgumentNullException - value
        com.aspose.ms.System.ArgumentOutOfRangeException - value;Halftone hints array length must be equal to 2. Value: The halftone hints.
      • setHalfToneHints

        public void setHalfToneHints(int[] value)

        Gets or sets the halftone hints.

        Throws:
        com.aspose.ms.System.ArgumentNullException - value
        com.aspose.ms.System.ArgumentOutOfRangeException - value;Halftone hints array length must be equal to 2. Value: The halftone hints.
      • getImageDescription

        public String getImageDescription()

        Gets or sets the image description.

        Value: The image description.
      • setImageDescription

        public void setImageDescription(String value)

        Gets or sets the image description.

        Value: The image description.
      • getInkNames

        public String getInkNames()

        Gets or sets the ink names.

        Value: The ink names.
      • setInkNames

        public void setInkNames(String value)

        Gets or sets the ink names.

        Value: The ink names.
      • getScannerManufacturer

        public String getScannerManufacturer()

        Gets or sets the scanner manufacturer.

        Value: The scanner manufacturer.
      • setScannerManufacturer

        public void setScannerManufacturer(String value)

        Gets or sets the scanner manufacturer.

        Value: The scanner manufacturer.
      • getMaxSampleValue

        public int[] getMaxSampleValue()

        Gets or sets the max sample value.

        Throws:
        com.aspose.ms.System.ArgumentNullException - value
        com.aspose.ms.System.ArgumentOutOfRangeException - value;The array length must correspond to the samples per pixel count. Value: The max sample value.
      • setMaxSampleValue

        public void setMaxSampleValue(int[] value)

        Gets or sets the max sample value.

        Throws:
        com.aspose.ms.System.ArgumentNullException - value
        com.aspose.ms.System.ArgumentOutOfRangeException - value;The array length must correspond to the samples per pixel count. Value: The max sample value.
      • getMinSampleValue

        public int[] getMinSampleValue()

        Gets or sets the min sample value.

        Throws:
        com.aspose.ms.System.ArgumentNullException - value
        com.aspose.ms.System.ArgumentOutOfRangeException - value;The array length must correspond to the samples per pixel count. Value: The min sample value.
      • setMinSampleValue

        public void setMinSampleValue(int[] value)

        Gets or sets the min sample value.

        Throws:
        com.aspose.ms.System.ArgumentNullException - value
        com.aspose.ms.System.ArgumentOutOfRangeException - value;The array length must correspond to the samples per pixel count. Value: The min sample value.
      • getScannerModel

        public String getScannerModel()

        Gets or sets the scanner model.

        Value: The scanner model.
      • setScannerModel

        public void setScannerModel(String value)

        Gets or sets the scanner model.

        Value: The scanner model.
      • getOrientation

        public int getOrientation()

        Gets or sets the orientation.

        Value: The orientation.
      • setOrientation

        public void setOrientation(int value)

        Gets or sets the orientation.

        Value: The orientation.
      • getPageName

        public String getPageName()

        Gets or sets the page name.

        Value: The page name.
      • setPageName

        public void setPageName(String value)

        Gets or sets the page name.

        Value: The page name.
      • getPageNumber

        public int[] getPageNumber()

        Gets or sets the page number tag.

        Throws:
        com.aspose.ms.System.ArgumentNullException - value
        com.aspose.ms.System.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. Value: The page number tag.
      • setPageNumber

        public void setPageNumber(int[] value)

        Gets or sets the page number tag.

        Throws:
        com.aspose.ms.System.ArgumentNullException - value
        com.aspose.ms.System.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. Value: The page number tag.
      • getPhotometric

        public int getPhotometric()

        Gets or sets the photometric.

        Value: The photometric.
      • setPhotometric

        public void setPhotometric(int value)

        Gets or sets the photometric.

        Value: The photometric.
      • getPlanarConfiguration

        public int getPlanarConfiguration()

        Gets or sets the planar configuration.

        Value: The planar configuration.
      • setPlanarConfiguration

        public void setPlanarConfiguration(int value)

        Gets or sets the planar configuration.

        Value: The planar configuration.
      • getResolutionUnit

        public int getResolutionUnit()

        Gets or sets the resolution unit.

        Value: The resolution unit.
      • setResolutionUnit

        public void setResolutionUnit(int value)

        Gets or sets the resolution unit.

        Value: The resolution unit.
      • getRowsPerStrip

        public long getRowsPerStrip()

        Gets or sets the rows per strip.

        Value: The rows per strip.
      • setRowsPerStrip

        public void setRowsPerStrip(long value)

        Gets or sets the rows per strip.

        Value: The rows per strip.
      • getSampleFormat

        public int[] getSampleFormat()

        Gets or sets the sample format.

        Throws:
        com.aspose.ms.System.ArgumentNullException - value
        com.aspose.ms.System.ArgumentOutOfRangeException - value;The array length must correspond to the samples per pixel count. Value: The sample format.
      • setSampleFormat

        public void setSampleFormat(int[] value)

        Gets or sets the sample format.

        Throws:
        com.aspose.ms.System.ArgumentNullException - value
        com.aspose.ms.System.ArgumentOutOfRangeException - value;The array length must correspond to the samples per pixel count. Value: The sample format.
      • getSamplesPerPixel

        public int getSamplesPerPixel()

        Gets the samples per pixel. To change this property value use the BitsPerSample property setter.

        Value: The samples per pixel.
      • getSmaxSampleValue

        public long[] getSmaxSampleValue()

        Gets or sets the max sample value. The value has a field type which best matches the sample data (Byte, Short or Long type).

        Value: The max sample value.
      • setSmaxSampleValue

        public void setSmaxSampleValue(long[] value)

        Gets or sets the max sample value. The value has a field type which best matches the sample data (Byte, Short or Long type).

        Value: The max sample value.
      • getSminSampleValue

        public long[] getSminSampleValue()

        Gets or sets the min sample value. The value has a field type which best matches the sample data (Byte, Short or Long type).

        Value: The min sample value.
      • setSminSampleValue

        public void setSminSampleValue(long[] value)

        Gets or sets the min sample value. The value has a field type which best matches the sample data (Byte, Short or Long type).

        Value: The min sample value.
      • getSoftwareType

        public String getSoftwareType()

        Gets or sets the software type.

        Value: The software type.
      • setSoftwareType

        public void setSoftwareType(String value)

        Gets or sets the software type.

        Value: The software type.
      • getStripByteCounts

        public long[] getStripByteCounts()

        Gets or sets the strip byte counts.

        Value: The strip byte counts.
      • setStripByteCounts

        public void setStripByteCounts(long[] value)

        Gets or sets the strip byte counts.

        Value: The strip byte counts.
      • getStripOffsets

        public long[] getStripOffsets()

        Gets or sets the strip offsets.

        Value: The strip offsets.
      • setStripOffsets

        public void setStripOffsets(long[] value)

        Gets or sets the strip offsets.

        Value: The strip offsets.
      • getSubFileType

        public long getSubFileType()

        Gets or sets a general indication of the kind of data contained in this subfile.

        Value: The general indication of the kind of data contained in this subfile.
      • setSubFileType

        public void setSubFileType(long value)

        Gets or sets a general indication of the kind of data contained in this subfile.

        Value: The general indication of the kind of data contained in this subfile.
      • getTargetPrinter

        public String getTargetPrinter()

        Gets or sets the target printer.

        Value: The target printer.
      • setTargetPrinter

        public void setTargetPrinter(String value)

        Gets or sets the target printer.

        Value: The target printer.
      • getThreshholding

        public int getThreshholding()

        Gets or sets the threshholding.

        Value: The threshholding.
      • setThreshholding

        public void setThreshholding(int value)

        Gets or sets the threshholding.

        Value: The threshholding.
      • getTotalPages

        public int getTotalPages()

        Gets the total pages.

        Value: The total pages.
      • getXposition

        public TiffRational getXposition()

        Gets or sets the x position.

        Value: The x position.
      • setXposition

        public void setXposition(TiffRational value)

        Gets or sets the x position.

        Value: The x position.
      • getXresolution

        public TiffRational getXresolution()

        Gets or sets the x resolution.

        Value: The x resolution.
      • setXresolution

        public void setXresolution(TiffRational value)

        Gets or sets the x resolution.

        Value: The x resolution.
      • getYposition

        public TiffRational getYposition()

        Gets or sets the y position.

        Value: The y position.
      • setYposition

        public void setYposition(TiffRational value)

        Gets or sets the y position.

        Value: The y position.
      • getYresolution

        public TiffRational getYresolution()

        Gets or sets the y resolution.

        Value: The y resolution.
      • setYresolution

        public void setYresolution(TiffRational value)

        Gets or sets the y resolution.

        Value: The y resolution.
      • getFaxT4Options

        public long getFaxT4Options()

        Gets or sets the fax t4 options.

        Value: The fax t4 options.
      • setFaxT4Options

        public void setFaxT4Options(long value)

        Gets or sets the fax t4 options.

        Value: The fax t4 options.
      • getPredictor

        public int getPredictor()

        Gets or sets the predictor for LZW compression.

        Value: The predictor type.
      • setPredictor

        public void setPredictor(int value)

        Gets or sets the predictor for LZW compression.

        Value: The predictor type.
      • getImageLength

        public long getImageLength()

        Gets or sets the image length.

        Value: The image length.
      • setImageLength

        public void setImageLength(long value)

        Gets or sets the image length.

        Value: The image length.
      • getImageWidth

        public long getImageWidth()

        Gets or sets the image width.

        Value: The image width.
      • setImageWidth

        public void setImageWidth(long value)

        Gets or sets the image width.

        Value: The image width.
      • getTags

        public TiffDataType[] getTags()

        Gets or sets the tags.

        Value: The tags.
      • setTags

        public void setTags(TiffDataType[] value)

        Gets or sets the tags.

        Value: The tags.
      • getValidTagCount

        public int getValidTagCount()

        Gets the valid tag count. This is not the total tags count but the number of tags which may be preserved.

        Value: The valid tag count.
      • getBitsPerPixel

        public int getBitsPerPixel()

        Gets the bits per pixel.

        Value: The bits per pixel.
      • getValidTagsCount

        public static int getValidTagsCount(TiffDataType[] tags)

        Gets the valid tags count.

        Parameters:
        tags - The tags to validate.
        Returns:
        The valid tags count.
      • removeTag

        public boolean removeTag(int tag)

        Removes the tag.

        Parameters:
        tag - The tag to remove.
        Returns:
        true if successfully removed
      • validate

        public void validate()

        Validates if options have valid combination of tags

      • addTags

        public void addTags(TiffDataType[] tagsToAdd)

        Adds the tags.

        Parameters:
        tagsToAdd - The tags to add.
      • addTag

        public void addTag(TiffDataType tagToAdd)

        Adds a new tag.

        Parameters:
        tagToAdd - The tag to add.
      • getTagByType

        public TiffDataType getTagByType(int tagKey)

        Gets the instance of the tag by type.

        Parameters:
        tagKey - The tag key.
        Returns:
        Instance of the tag if exists or null otherwise.
      • createOptionsValidator_internalized

        public static com.aspose.cad_internal.imageoptions.validators.tiff.IPhotometricValidator createOptionsValidator_internalized(TiffOptions options)

        Creates the options validator.

        Parameters:
        options - The TIFF options.
        Returns:
        TIFF image options validator.