Class JpegImageEncoder

  • All Implemented Interfaces:
    ImageEncoder

    public class JpegImageEncoder
    extends java.lang.Object
    implements ImageEncoder
    Todo: Document Me
    Author:
    Thomas Morgner
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void encodeImage​(java.awt.Image image, java.io.OutputStream outputStream)  
      void encodeImage​(java.awt.Image image, java.io.OutputStream outputStream, float quality, boolean encodeAlpha)
      Encodes the given image using the given encoder-specific quality and alpha-channel settings and writes the encoded image-data to the given stream.
      java.lang.String getMimeType()
      Returns the mime-type of the encoded data.
      static boolean isJpegEncodingAvailable()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JpegImageEncoder

        public JpegImageEncoder()
    • Method Detail

      • encodeImage

        public void encodeImage​(java.awt.Image image,
                                java.io.OutputStream outputStream,
                                float quality,
                                boolean encodeAlpha)
                         throws java.io.IOException,
                                UnsupportedEncoderException
        Description copied from interface: ImageEncoder
        Encodes the given image using the given encoder-specific quality and alpha-channel settings and writes the encoded image-data to the given stream.
        Specified by:
        encodeImage in interface ImageEncoder
        Parameters:
        image - the image to be encoded.
        outputStream - the output stream, where to write the image data to.
        quality - the quality of the encoding.
        encodeAlpha - a flag controlling whether the alpha-channel should be encoded as well.
        Throws:
        java.io.IOException - if there was an IO error while generating or writing the image data.
        UnsupportedEncoderException - if the encoder is not supported.
      • getMimeType

        public java.lang.String getMimeType()
        Description copied from interface: ImageEncoder
        Returns the mime-type of the encoded data.
        Specified by:
        getMimeType in interface ImageEncoder
        Returns:
        the mime-type.
      • isJpegEncodingAvailable

        public static boolean isJpegEncodingAvailable()