public class TLcdEarthImageTileDataCodec extends Object implements ILcdEarthTileDataCodec
BufferedImage
objects. The images can be
encoded to any format supported by the ImageIO package.Constructor and Description |
---|
TLcdEarthImageTileDataCodec()
Constructs a new
TLcdEarthImageTileDataCodec with the default format (jpeg) and
the default compression quality (0.9 ). |
TLcdEarthImageTileDataCodec(String aFormat)
Constructs a new
TLcdEarthImageTileDataCodec with the specified format and the
default compression quality. |
TLcdEarthImageTileDataCodec(String aFormat,
float aQuality)
Constructs a new
TLcdEarthImageTileDataCodec with the specified format and
compression quality. |
Modifier and Type | Method and Description |
---|---|
Object |
decodeTileData(InputStream aSource)
Decodes tile data from the given input stream.
|
void |
encodeTileData(Object aTile,
OutputStream aOutputStream)
Encodes tile data to the given output stream.
|
TLcdEarthTileFormat |
getDecodedTileFormat()
Returns the tile data format that this codec can encode or
decode.
|
TLcdEarthTileFormat |
getEncodedDataFormat()
Returns the format in which this codec encodes data.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
encodeTile
public TLcdEarthImageTileDataCodec()
TLcdEarthImageTileDataCodec
with the default format (jpeg) and
the default compression quality (0.9
).public TLcdEarthImageTileDataCodec(String aFormat)
TLcdEarthImageTileDataCodec
with the specified format and the
default compression quality.aFormat
- a format name that is supported by the ImageIO packageImageIO.getReaderFormatNames()
,
ImageIO.getWriterFormatNames()
public TLcdEarthImageTileDataCodec(String aFormat, float aQuality)
TLcdEarthImageTileDataCodec
with the specified format and
compression quality.
Note that some ImageIO readers or writers may or may not support explicit compression settings.aFormat
- a format name that is supported by the ImageIO packageaQuality
- a compression quality in [0,1]
ImageIO.getReaderFormatNames()
,
ImageIO.getWriterFormatNames()
public Object decodeTileData(InputStream aSource) throws IOException
ILcdEarthTileDataCodec
ILcdEarthTileDataCodec.getDecodedTileFormat()
.decodeTileData
in interface ILcdEarthTileDataCodec
aSource
- the input stream from which to read the tile dataIOException
- if the tile data cannot be decodedpublic void encodeTileData(Object aTile, OutputStream aOutputStream) throws IOException
ILcdEarthTileDataCodec
aTileData
parameter must be an object of the type returned by ILcdEarthTileDataCodec.getDecodedTileFormat()
.encodeTileData
in interface ILcdEarthTileDataCodec
aTile
- the tile data to be encodedaOutputStream
- the output stream to which to encode the tile dataIOException
- if the tile data cannot be encodedpublic TLcdEarthTileFormat getDecodedTileFormat()
ILcdEarthTileDataCodec
aTile
parameter of encodeTileData()
should always be of this type, as should the return value of
decodeTileData()
.getDecodedTileFormat
in interface ILcdEarthTileDataCodec
public TLcdEarthTileFormat getEncodedDataFormat()
ILcdEarthTileDataCodec
ILcdEarthTileDataCodec.getDecodedTileFormat()
to retrieve an
appropriate tile data codec for any particular tile.getEncodedDataFormat
in interface ILcdEarthTileDataCodec