Interface ImageEncoder

All Known Implementing Classes:
JPEGEncoder, PNGEncoder

public interface ImageEncoder
Represents an image encoder used to encode an AWT image into a particular format, such as PNG.
Since:
3.0.7
Author:
tomyeh
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Encodes an AWT image into a byte array in a particular format.
    float
    Return the quality of the image encoding.
    boolean
    Returns whether to encode the alpha transparency.
    void
    setEncodingAlpha(boolean encodeAlpha)
    Sets whether to encode the alpha transparency.
    void
    setQuality(float quality)
    Sets the quality of the image encoding.
  • Method Details

    • encode

      byte[] encode(RenderedImage image) throws IOException
      Encodes an AWT image into a byte array in a particular format.
      Throws:
      IOException
    • getQuality

      float getQuality()
      Return the quality of the image encoding.
    • setQuality

      void setQuality(float quality)
      Sets the quality of the image encoding. Simply does nothing if the encoder does not support it.
    • isEncodingAlpha

      boolean isEncodingAlpha()
      Returns whether to encode the alpha transparency.
    • setEncodingAlpha

      void setEncodingAlpha(boolean encodeAlpha)
      Sets whether to encode the alpha transparency. Simply does nothing if the encoder does not support it.