raja.io
Interface ImageWriter


public interface ImageWriter

An interface specifying objects that can write images. Images are encoded as instances of RenderedImage.

See Also:
ImageReader

Method Summary
 Object createDefaultImageWriteParam(RenderedImage image)
          Returns the default writing parameters appropriate to encode the given RenderedImage.
 Object getImageWriteParam()
          Returns the current writing parameters.
 void setImageWriteParam(Object param)
          Sets the current writing parameters.
 void write(RenderedImage image)
          Encodes the given RenderedImage.
 

Method Detail

write

public void write(RenderedImage image)
           throws IOException
Encodes the given RenderedImage.
Parameters:
image - the RenderedImage to be written.
Throws:
IOException - if an I/O error occurs

getImageWriteParam

public Object getImageWriteParam()
Returns the current writing parameters. Concrete implementations of this interface should return an instance of the appropriate subclass or subinterface.
Returns:
the current writing parameters.

setImageWriteParam

public void setImageWriteParam(Object param)
Sets the current writing parameters. Concrete implementations of this interface may throw a RuntimeException if the param argument is not an instance of the appropriate subclass or subinterface.
Parameters:
param - the writing parameters to use.

createDefaultImageWriteParam

public Object createDefaultImageWriteParam(RenderedImage image)
Returns the default writing parameters appropriate to encode the given RenderedImage. Concrete implementations of this interface should return an instance of the appropriate subclass or subinterface.
Parameters:
image - the RenderedImage to be encoded.
Returns:
the default writing parameters to encoded the given image.