Class AbstractImageSink<T>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String outputFormat
      The name of the format to output the image as.
      protected ThumbnailParameter param
      The parameters that should be used when storing the image.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractImageSink()
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String preferredOutputFormatName()
      Returns the output format to use from information provided for the output image.
      void setOutputFormatName​(java.lang.String format)
      Sets the output format of the resulting image.
      void setThumbnailParameter​(ThumbnailParameter param)
      Sets the ThumbnailParameter from which to retrieve parameters to use when storing the image.
      void write​(java.awt.image.BufferedImage img)
      Writes the resulting image to a destination.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface net.coobird.thumbnailator.tasks.io.ImageSink

        getSink
    • Field Detail

      • outputFormat

        protected java.lang.String outputFormat
        The name of the format to output the image as.
      • param

        protected ThumbnailParameter param
        The parameters that should be used when storing the image.
    • Constructor Detail

      • AbstractImageSink

        protected AbstractImageSink()
        Default constructor.
    • Method Detail

      • setOutputFormatName

        public void setOutputFormatName​(java.lang.String format)
        Description copied from interface: ImageSink
        Sets the output format of the resulting image.

        For ImageSinks which stores raw images, the format name specified by this method may be ignored.

        Specified by:
        setOutputFormatName in interface ImageSink<T>
        Parameters:
        format - File format with which to store the image.
      • write

        public void write​(java.awt.image.BufferedImage img)
                   throws java.io.IOException
        Description copied from interface: ImageSink
        Writes the resulting image to a destination.
        Specified by:
        write in interface ImageSink<T>
        Parameters:
        img - The image to write or store.
        Throws:
        java.io.IOException - When a problem occurs while writing or storing the image.
      • preferredOutputFormatName

        public java.lang.String preferredOutputFormatName()
        Description copied from interface: ImageSink

        Returns the output format to use from information provided for the output image.

        If the output format cannot be determined, then ThumbnailParameter.ORIGINAL_FORMAT should be returned.

        Specified by:
        preferredOutputFormatName in interface ImageSink<T>
        Returns:
        Name of the preferred output format.