javax.media.jai.tilecodec
Interface TileEncoder

All Known Implementing Classes:
TileEncoderImpl

public interface TileEncoder

An interface describing objects that transform a Raster into an OutputStream. If the TileCodecDescriptor for this format returns true from its includesSampleModelInfo() and includesLocationInfo() methods, then the encoder must encode this information in the encoded tiles. If these methods return false, then this information (needed to create a Raster on decoding) must be provided to the TileDecoder by setting the SampleModel on the TileCodecParameterList supplied to the TileDecoder and supplying the tile upper left corner location to the TileDecoder via the TileDecoder's decode(Point location) method. The SampleModel value set on the TileCodecParameterList for the TileDecoder should be the same as that of the Raster to be encoded, in order to get a Raster on decoding that is equivalent to the one being encoded.

Since:
JAI 1.1
See Also:
TileCodecDescriptor, TileDecoder

Method Summary
 void encode(Raster ras)
          Encodes a Raster and writes the output to the OutputStream associated with this TileEncoder.
 TileCodecParameterList getEncodeParameterList()
          Returns the current parameters as an instance of the TileCodecParameterList interface.
 String getFormatName()
          Returns the format name of the encoding scheme.
 OutputStream getOutputStream()
          Returns the OutputStream to which the encoded data will be written.
 

Method Detail

getFormatName

public String getFormatName()
Returns the format name of the encoding scheme.


getEncodeParameterList

public TileCodecParameterList getEncodeParameterList()
Returns the current parameters as an instance of the TileCodecParameterList interface.


getOutputStream

public OutputStream getOutputStream()
Returns the OutputStream to which the encoded data will be written.


encode

public void encode(Raster ras)
            throws IOException
Encodes a Raster and writes the output to the OutputStream associated with this TileEncoder.

Parameters:
ras - the Raster to encode.
Throws:
IOException - if an I/O error occurs while writing to the OutputStream.
IllegalArgumentException - if ras is null.