Class AbstractJAIWriter

    • Constructor Detail

      • AbstractJAIWriter

        public AbstractJAIWriter()
    • Method Detail

      • getFormatExtensions

        public abstract String[] getFormatExtensions()
        Returns the extension(s) of the format.
        Returns:
        the extension(s) (without the dot!)
      • getWriter

        public abstract ImageWriter getWriter()
                                       throws Exception
        Returns the writer.
        Returns:
        the writer
        Throws:
        Exception - if determining of writer fails
      • getParameters

        public abstract ImageWriteParam getParameters()
                                               throws Exception
        Returns the parameters for the writer.
        Returns:
        the parameters
        Throws:
        Exception - if determining of writer or setting of parameters fails
      • removeAlphaChannel

        public abstract boolean removeAlphaChannel()
        Returns whether the alpha channel must be removed.
        Returns:
        true if to remove
      • write

        public String write​(PlaceholderFile file,
                            BufferedImage img)
        Performs the actual writing of the image file.
        Parameters:
        file - the file to write to
        img - the image to write
        Returns:
        null if successfully written, otherwise error message
      • write

        public String write​(OutputStream stream,
                            BufferedImage img)
        Writes the image to the stream. Callers must close the stream.
        Parameters:
        stream - the stream to write to
        img - the image to write
        Returns:
        null if successfully written, otherwise error message