java.lang.Object
one.jpro.platform.image.manager.encoder.ImageEncoderPNG
All Implemented Interfaces:
ImageEncoder, JsonConvertible

public class ImageEncoderPNG extends Object implements ImageEncoder
An implementation of the ImageEncoder interface for PNG image format.
See Also:
  • Constructor Details

    • ImageEncoderPNG

      public ImageEncoderPNG()
  • Method Details

    • saveImage

      public void saveImage(BufferedImage image, File target)
      Saves the provided BufferedImage to a specified target file in PNG format.
      Specified by:
      saveImage in interface ImageEncoder
      Parameters:
      image - The BufferedImage to be saved.
      target - The target file where the image should be saved.
      Throws:
      ImageEncoderException - If there's an error during the save process, or if the provided format is unsupported.
    • getFileExtension

      public String getFileExtension()
      Gets the file extension for this encoder, which is "png".
      Specified by:
      getFileExtension in interface ImageEncoder
      Returns:
      The file extension string.
    • toJSON

      public org.json.JSONObject toJSON()
      Description copied from interface: JsonConvertible
      Converts the object to a JSON representation.
      Specified by:
      toJSON in interface JsonConvertible
      Returns:
      A JSONObject representing the object.