Class Jpeg2000Encoder

  • All Implemented Interfaces:
    com.idrsolutions.image.Encoder

    public class Jpeg2000Encoder
    extends com.idrsolutions.image.JDeliImage
    implements com.idrsolutions.image.Encoder
    Class writes BufferedImages as JPEG2000

    Example:

    
     Jpeg2000Encoder encoder = new Jpeg2000Encoder();
     //encoder.getEncoderOptions().setQuality(75); //default is 75
     encoder.write(bufferedImage, outputStream);
     
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      Jpeg2000EncoderOptions getEncoderOptions()  
      int getQuality()
      Deprecated.
      - use getEncoderOptions().getQuality();
      void setQuality​(int percentage)
      Deprecated.
      - use jpeg2000EncoderOptions.setQuality(int percentage); setEncoderOptions(jpeg2000EncoderOptions);
      void write​(java.awt.image.BufferedImage image, java.io.File file)
      Writes BufferedImage as JPEG2000 to a file
      void write​(java.awt.image.BufferedImage inputImage, java.io.OutputStream os)
      Writes BufferedImage as JPEG2000 to an OutputStream
      • Methods inherited from class com.idrsolutions.image.JDeliImage

        optimiseImage
      • Methods inherited from class java.lang.Object

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

      • Jpeg2000Encoder

        public Jpeg2000Encoder()
    • Method Detail

      • write

        public void write​(java.awt.image.BufferedImage image,
                          java.io.File file)
                   throws java.io.IOException
        Writes BufferedImage as JPEG2000 to a file
        Parameters:
        image - BufferedImage The image to write
        file - The output file to write to
        Throws:
        java.io.IOException - if the image wasn't written
      • write

        public void write​(java.awt.image.BufferedImage inputImage,
                          java.io.OutputStream os)
                   throws java.io.IOException
        Writes BufferedImage as JPEG2000 to an OutputStream

        This method does not close the provided OutputStream after the write operation has completed; it is the responsibility of the caller to close the stream.

        Specified by:
        write in interface com.idrsolutions.image.Encoder
        Parameters:
        os - The stream to write to
        Throws:
        java.io.IOException - if the image wasn't written
      • setQuality

        @Deprecated
        public void setQuality​(int percentage)
        Deprecated.
        - use jpeg2000EncoderOptions.setQuality(int percentage); setEncoderOptions(jpeg2000EncoderOptions);
      • getQuality

        @Deprecated
        public int getQuality()
        Deprecated.
        - use getEncoderOptions().getQuality();