public static class TLspRasterStyle.Builder<B extends TLspRasterStyle.Builder<B>> extends ALspStyle.Builder<B> implements ILspWorldElevationStyle.Builder, ILspEffectsHintStyle.Builder
1
, and it indicates that it should be
draped on terrain. The quality parameters are set to quality-performance trade-off that is good
for most rasters.
Example usages:
To create a raster style with 0.5 brightness and 0.7 contrast:TLspRasterStyle style = TLspRasterStyle.newBuilder().brightness(0.5f).contrast(0.7f).build();Note that you either need to set the
colorMap(com.luciad.util.TLcdColorMap)
/colorModel(java.awt.image.ColorModel)
or combine this style with a TLspImageProcessingStyle
if the
data is not color data (for example elevation data or hyperspectral data). So a minimal
style for elevation data would look like this:TLspRasterStyle style = TLspRasterStyle.newBuilder(). colorMap(TLcdColorModelFactory.createElevationColorMap()) build();For more complex non-color data (for example hyperspectral data) you can use an
image processing style
to control the conversion to colors. Typically this can be done by selecting bands
and either interpreting them as color bands
or
mapping values to colors
.
By default the painter maps the first band to gray-scale values.Modifier | Constructor and Description |
---|---|
protected |
Builder()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
B |
all(ALspStyle aRasterStyle)
Sets all parameters on the builder based on the given style.
|
B |
brightness(float aBrightness)
Sets the brightness.
|
TLspRasterStyle |
build()
Builds the style with the set parameters.
|
B |
colorMap(TLcdColorMap aColorMap)
Sets the color map.
|
B |
colorModel(ColorModel aColorModel)
Sets the color model.
|
B |
contrast(float aContrast)
Sets the contrast.
|
B |
effectsHints(ILspEffectsHintStyle.EffectsHint... aEffectsHints)
Specifies the effects hints to be added to the style.
|
B |
elevationMode(ILspWorldElevationStyle.ElevationMode aElevationMode)
Sets the elevation mode used for the raster data.
|
B |
interpolation(ELcdInterpolationType aInterpolationType)
Sets the interpolation type used for the raster data.
|
B |
levelSwitchFactor(double aLevelSwitchFactor)
Sets the lowest pixel density (number of raster pixels per screen pixel) at which a raster
level is used.
|
B |
modulationColor(Color aColor)
Sets the color that is modulated with the raster.
|
B |
opacity(float aOpacity)
Sets the opacity of the raster.
|
B |
startResolutionFactor(double aStartResolutionFactor)
Sets the highest pixel density (number of raster pixels per screen pixel) at which data will
be used.
|
B |
zOrder(int aZOrder)
Sets the Z-order of this style.
|
equals, hashCode
public B zOrder(int aZOrder)
aZOrder
- the z orderthis
public B modulationColor(Color aColor)
Sets the color that is modulated with the raster. For example using a raster with gray-scale colors and a red modulation color will result in a resulting painted raster with red hues.
Using a white color has no effect.
aColor
- the modulation colorthis
public B opacity(float aOpacity)
aOpacity
- the alpha value.
Must be contained in the [0,1] interval (0 is fully transparent, 1 is fully opaque).this
public B brightness(float aBrightness)
[0, 2]
. A value of 1 (the default) leaves the brightness
unchanged. Values larger than 1 makes the colors brighter, while a value smaller than 1 makes
the colors less bright.aBrightness
- the brightnessthis
public B contrast(float aContrast)
[0, 2]
. A value of 1 (the default) leaves the contrast
unchanged. A value larger than 1 enhances the contrast of dark colors by making them brighter,
while a value smaller than 1 enhances the contrast of bright colors by making them darker.aContrast
- the contrastthis
public B startResolutionFactor(double aStartResolutionFactor)
10.0
.aStartResolutionFactor
- the new start resolution factorthis
levelSwitchFactor(double)
public B levelSwitchFactor(double aLevelSwitchFactor)
1.0
a raster level is chosen such that a single raster
pixel will project to at most 1 screen pixel, if such a level exists. This way, the highest
practical raster quality is chosen. A value smaller than 1.0
delays the level
switching: a single raster pixel may project to multiple screen pixels. Such a value may
cause pixelating effects, but it reduces the amount of data that needs to be loaded.
Note that this factor does not influence when the least detailed level is used, this is
controlled using the start resolution factor. The default value is 0.3
.aLevelSwitchFactor
- the new level switch factorthis
startResolutionFactor(double)
public B colorModel(ColorModel aColorModel)
aColorModel
- the color modelthis
TLcdColorModelFactory
public B colorMap(TLcdColorMap aColorMap)
aColorMap
- the color mapthis
public B elevationMode(ILspWorldElevationStyle.ElevationMode aElevationMode)
ILspWorldElevationStyle.ElevationMode.ON_TERRAIN
ILspWorldElevationStyle.ElevationMode.ABOVE_ELLIPSOID
ILspWorldElevationStyle.ElevationMode.OBJECT_DEPENDENT
: uses one of the above modes depending
on the z coordinate of the object's boundselevationMode
in interface ILspWorldElevationStyle.Builder
aElevationMode
- the elevation modepublic B interpolation(ELcdInterpolationType aInterpolationType)
NONE
, LINEAR
and
CUBIC
are supported.
A null
interpolation type indicates the default (implementation specific) value
should be used.aInterpolationType
- the interpolation type or null
public B effectsHints(ILspEffectsHintStyle.EffectsHint... aEffectsHints)
ILspEffectsHintStyle.Builder
effectsHints
in interface ILspEffectsHintStyle.Builder
aEffectsHints
- the effects hints to be added to the stylethis
public B all(ALspStyle aRasterStyle)
ALspStyle.Builder
all
in class ALspStyle.Builder<B extends TLspRasterStyle.Builder<B>>
aRasterStyle
- the style to copythis
public TLspRasterStyle build()
ALspStyle.Builder
build
in class ALspStyle.Builder<B extends TLspRasterStyle.Builder<B>>