Class ImageIOTIFFImageWriter

  • All Implemented Interfaces:
    java.util.EventListener, javax.imageio.event.IIOWriteWarningListener, ImageWriter

    public class ImageIOTIFFImageWriter
    extends ImageIOImageWriter
    ImageWriter that encodes TIFF images using Image I/O.
    Version:
    $Id$
    • Field Detail

      • SUN_TIFF_NATIVE_FORMAT

        private static final java.lang.String SUN_TIFF_NATIVE_FORMAT
        See Also:
        Constant Field Values
      • JAVA_TIFF_NATIVE_FORMAT

        private static final java.lang.String JAVA_TIFF_NATIVE_FORMAT
        See Also:
        Constant Field Values
      • SUN_TIFF_NATIVE_STREAM_FORMAT

        private static final java.lang.String SUN_TIFF_NATIVE_STREAM_FORMAT
        See Also:
        Constant Field Values
      • JAVA_TIFF_NATIVE_STREAM_FORMAT

        private static final java.lang.String JAVA_TIFF_NATIVE_STREAM_FORMAT
        See Also:
        Constant Field Values
      • DENOMINATOR_CENTIMETER

        private static final java.lang.String DENOMINATOR_CENTIMETER
        See Also:
        Constant Field Values
      • DENOMINATOR_INCH

        private static final java.lang.String DENOMINATOR_INCH
        See Also:
        Constant Field Values
    • Constructor Detail

      • ImageIOTIFFImageWriter

        public ImageIOTIFFImageWriter()
        Main constructor.
    • Method Detail

      • updateMetadata

        protected javax.imageio.metadata.IIOMetadata updateMetadata​(java.awt.image.RenderedImage image,
                                                                    javax.imageio.metadata.IIOMetadata meta,
                                                                    ImageWriterParams params)
        Updates the metadata information based on the parameters to this writer.
        Overrides:
        updateMetadata in class ImageIOImageWriter
        Parameters:
        image - the current image being rendered
        meta - the metadata
        params - the parameters
        Returns:
        the updated metadata
      • createResolutionField

        private javax.imageio.metadata.IIOMetadataNode createResolutionField​(int number,
                                                                             java.lang.String name,
                                                                             java.lang.Integer resolution,
                                                                             ResolutionUnit unit)
      • createResolutionUnitField

        private javax.imageio.metadata.IIOMetadataNode createResolutionUnitField​(ImageWriterParams params)
        Generate a TIFFField for resolution unit based on the parameters.
        Parameters:
        params -
        Returns:
        the new metadata node
      • createShortMetadataNode

        public static final javax.imageio.metadata.IIOMetadataNode createShortMetadataNode​(int number,
                                                                                           java.lang.String name,
                                                                                           java.lang.String value)
        Utility to create a TIFFShort metadata child node of a TIFFShorts node for TIFF metadata.
        Parameters:
        number - value of the number attribute of the TIFField
        name - value of the name attribute of the TIFFField
        value - value of the value attribute of the TIFFShort
        Returns:
        the new metadata node
      • createShortMetadataNode

        public static final javax.imageio.metadata.IIOMetadataNode createShortMetadataNode​(int number,
                                                                                           java.lang.String name,
                                                                                           java.lang.String value,
                                                                                           java.lang.String description)
        Utility to create a TIFFShort metadata child node of a TIFFShorts node for TIFF metadata.
        Parameters:
        number - value of the number attribute of the TIFField
        name - value of the name attribute of the TIFFField
        value - value of the value attribute of the TIFFShort
        description - value of the description attribute of the TIFFShort, ignored if null
        Returns:
        the new metadata node
      • createRationalMetadataNode

        public static final javax.imageio.metadata.IIOMetadataNode createRationalMetadataNode​(int number,
                                                                                              java.lang.String name,
                                                                                              java.lang.String value)
        Utility to create a TIFFRational metadata child node of a TIFFRationals node for TIFF metadata.
        Parameters:
        number - value of the number attribute of the TIFField
        name - value of the name attribute of the TIFFField
        value - value of the value attribute of the TIFFRational
        Returns:
        the new metadata node
      • createMetadataField

        public static final javax.imageio.metadata.IIOMetadataNode createMetadataField​(int number,
                                                                                       java.lang.String name)
        Utility function to create a base TIFFField node for TIFF metadata.
        Parameters:
        number - value of the number attribute of the TIFField
        name - value of the name attribute of the TIFFField
        Returns:
        the new metadata node
      • createStreamMetadata

        protected javax.imageio.metadata.IIOMetadata createStreamMetadata​(javax.imageio.ImageWriter writer,
                                                                          javax.imageio.ImageWriteParam writeParam,
                                                                          ImageWriterParams params)
        Creates the stream metadata for image. By default, this method returns null which causes the default stream metadata to be used. Subclasses can override this to supply special stream metadata (see TIFF for an example).
        Overrides:
        createStreamMetadata in class ImageIOImageWriter
        Parameters:
        writer - the image write
        writeParam - the ImageIO write parameters
        params - the ImageWriter write parameters
        Returns:
        the stream metadata (or null if no special metadata needs to be produced)
      • setFromTree

        private void setFromTree​(java.util.Set<java.lang.String> names,
                                 javax.imageio.metadata.IIOMetadata streamMetadata,
                                 Endianness endian,
                                 java.lang.String format)