Class TLcdGXYViewPNGEncoder
java.lang.Object
com.luciad.wms.server.viewencoder.TLcdGXYViewPNGEncoder
- All Implemented Interfaces:
ILcdGXYViewEncoder
,ILcdWMSFeatureInfoRequestEncoder
@LcdService(service=ILcdGXYViewEncoder.class,
priority=5000)
public class TLcdGXYViewPNGEncoder
extends Object
implements ILcdGXYViewEncoder, ILcdWMSFeatureInfoRequestEncoder
Implementation of
ILcdGXYViewEncoder
and ILcdWMSFeatureInfoRequestEncoder
that can encode a ILcdGXYView
as PNG, with or without selection.
This encoder uses the ObjectPlanet PNG encoder library.
This view encoder allows to set the compression level (see setCompressionLevel(int)
,
getCompressionLevel()
).
This make it possible to determine a trade-off between compression and speed. The possible values are [0 - 9],
with 0 indicating no compression and 9 indicating best compression.
The default value is set to 6.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(ILcdGXYLayerSubsetList aSubsetList, OutputStream aOutputStream, ILcdGXYView aGXYView) Encodes the given selection in theTLcdGXYLayerSubsetList
from a givenILcdGXYView
and sends it to the givenOutputStream
.void
encodeGXYView
(ILcdGXYView aGXYView, OutputStream aOutputStream) encodes a givenILcdGXYView
to theOutputStream
.int
Returns the compression level.Returns the content MIME type of the encoder.void
setCompressionLevel
(int aCompressionLevel) Sets the compression level.
-
Constructor Details
-
TLcdGXYViewPNGEncoder
public TLcdGXYViewPNGEncoder()Creates a newTLcdGXYViewPNGEncoder
object.
-
-
Method Details
-
encodeGXYView
Description copied from interface:ILcdGXYViewEncoder
encodes a givenILcdGXYView
to theOutputStream
.- Specified by:
encodeGXYView
in interfaceILcdGXYViewEncoder
- Parameters:
aGXYView
- theILcdGXYView
to be encoded.aOutputStream
- theOutputStream
to write the encoded view to.- Throws:
IOException
- for any I/O Exceptions.
-
getContentType
Description copied from interface:ILcdGXYViewEncoder
Returns the content MIME type of the encoder.- Specified by:
getContentType
in interfaceILcdGXYViewEncoder
- Specified by:
getContentType
in interfaceILcdWMSFeatureInfoRequestEncoder
- Returns:
- the MIME-type as
String
.
-
setCompressionLevel
public void setCompressionLevel(int aCompressionLevel) Sets the compression level. The possible values are [0 - 9], with 0 indicating no compression and 9 indicating best compression.- Parameters:
aCompressionLevel
- A compression level.- See Also:
-
getCompressionLevel
public int getCompressionLevel()Returns the compression level. The possible values are [0 - 9], with 0 indicating no compression and 9 indicating best compression.- Returns:
- the compression level.
- See Also:
-
encode
public void encode(ILcdGXYLayerSubsetList aSubsetList, OutputStream aOutputStream, ILcdGXYView aGXYView) throws jakarta.servlet.ServletException Description copied from interface:ILcdWMSFeatureInfoRequestEncoder
Encodes the given selection in theTLcdGXYLayerSubsetList
from a givenILcdGXYView
and sends it to the givenOutputStream
.- Specified by:
encode
in interfaceILcdWMSFeatureInfoRequestEncoder
- Parameters:
aSubsetList
- aTLcdGXYLayerSubsetList
containing the selection to be encoded.aOutputStream
- theOutputStream
to write the output to.aGXYView
- theILcdGXYView
in which the elements are selected .- Throws:
jakarta.servlet.ServletException
- for writing and sending exceptions.
-