public class TLcdEarthSeparateAlphaImageTileDataCodec extends Object implements ILcdEarthTileDataCodec
BufferedImage
objects. The images can be encoded to any format
supported by the ImageIO package. This format will only be used to encode the opaque image data.
The alpha channel is handled separately by this codec.
Typically the encoded format used with this codec either does not support an alpha channel or
does not provide sufficient quality for an alpha channel (ex. jpeg).Constructor and Description |
---|
TLcdEarthSeparateAlphaImageTileDataCodec()
Constructs and
TLcdEarthSeparateAlphaImageTileDataCodec using the default format
for the opaque image data (jpeg) and the default compression quality (0.9 ). |
TLcdEarthSeparateAlphaImageTileDataCodec(String aFormat)
Constructs and
TLcdEarthSeparateAlphaImageTileDataCodec using the specified format
for the opaque image data and the default compression quality. |
TLcdEarthSeparateAlphaImageTileDataCodec(String aFormat,
float aQuality)
Constructs a new
TLcdEarthSeparateAlphaImageTileDataCodec using the specified
format for the opaque image data and the specified compression quality. |
Modifier and Type | Method and Description |
---|---|
Object |
decodeTileData(InputStream aSource)
Decodes tile data from the given input stream.
|
void |
encodeTileData(Object aTileData,
OutputStream aDestination)
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 TLcdEarthSeparateAlphaImageTileDataCodec()
TLcdEarthSeparateAlphaImageTileDataCodec
using the default format
for the opaque image data (jpeg) and the default compression quality (0.9
).public TLcdEarthSeparateAlphaImageTileDataCodec(String aFormat)
TLcdEarthSeparateAlphaImageTileDataCodec
using the specified format
for the opaque image data and the default compression quality.aFormat
- the format that will be used to encode/decode the opaque image data. This format
must be supported by the ImageIO package.ImageIO.getReaderFormatNames()
,
ImageIO.getWriterFormatNames()
public TLcdEarthSeparateAlphaImageTileDataCodec(String aFormat, float aQuality)
TLcdEarthSeparateAlphaImageTileDataCodec
using the specified
format for the opaque image data and the specified 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 aTileData, OutputStream aDestination) throws IOException
ILcdEarthTileDataCodec
aTileData
parameter must be an object of the type returned by ILcdEarthTileDataCodec.getDecodedTileFormat()
.encodeTileData
in interface ILcdEarthTileDataCodec
aTileData
- the tile data to be encodedaDestination
- 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