use of org.geotools.styling.ContrastEnhancement in project sldeditor by robward-scisys.
the class VOGeoServerContrastEnhancementNormalizeGreyTest method createChannelSelectionError.
/**
* Creates the channel selection error object.
*
* @param styleFactory the style factory
* @param contrastMethod the contrast method
* @return the channel selection
*/
private ChannelSelection createChannelSelectionError(StyleFactoryImpl styleFactory, ContrastMethod contrastMethod) {
ContrastEnhancement contrastEnhancement = (ContrastEnhancement) styleFactory.contrastEnhancement(null, contrastMethod.name());
FilterFactory ff = CommonFactoryFinder.getFilterFactory();
Map<String, Expression> options = contrastEnhancement.getOptions();
options.put("algorithm", ff.literal("TestStretchToMinimumMaximum"));
options.put("minValue", ff.literal("1.0"));
options.put("maxValue", ff.literal("5.0"));
SelectedChannelType channelType = styleFactory.createSelectedChannelType("channel name", contrastEnhancement);
SelectedChannelType[] channels = new SelectedChannelType[3];
channels[0] = channelType;
channels[1] = channelType;
channels[2] = channelType;
ChannelSelection channelSelection = styleFactory.createChannelSelection(channels);
return channelSelection;
}
use of org.geotools.styling.ContrastEnhancement in project sldeditor by robward-scisys.
the class VOGeoServerContrastEnhancementNormalizeOverallTest method createChannelSelectionError.
/**
* Creates the channel selection error object.
*
* @param styleFactory the style factory
* @param contrastMethod the contrast method
* @return the channel selection
*/
private ChannelSelection createChannelSelectionError(StyleFactoryImpl styleFactory, ContrastMethod contrastMethod) {
ContrastEnhancement contrastEnhancement = (ContrastEnhancement) styleFactory.contrastEnhancement(null, contrastMethod.name());
FilterFactory ff = CommonFactoryFinder.getFilterFactory();
Map<String, Expression> options = contrastEnhancement.getOptions();
options.put("algorithm", ff.literal("TestStretchToMinimumMaximum"));
options.put("minValue", ff.literal("1.0"));
options.put("maxValue", ff.literal("5.0"));
SelectedChannelType channelType = styleFactory.createSelectedChannelType("channel name", contrastEnhancement);
SelectedChannelType[] channels = new SelectedChannelType[3];
channels[0] = channelType;
channels[1] = channelType;
channels[2] = channelType;
ChannelSelection channelSelection = styleFactory.createChannelSelection(channels);
return channelSelection;
}
use of org.geotools.styling.ContrastEnhancement in project sldeditor by robward-scisys.
the class VOGeoServerContrastEnhancementNormalizeOverallTest method createChannelSelection.
/**
* Creates the channel selection object.
*
* @param styleFactory the style factory
* @param contrastMethod the contrast method
* @return the channel selection
*/
private ChannelSelection createChannelSelection(StyleFactoryImpl styleFactory, ContrastMethod contrastMethod) {
ContrastEnhancement contrastEnhancement = (ContrastEnhancement) styleFactory.contrastEnhancement(null, contrastMethod.name());
FilterFactory ff = CommonFactoryFinder.getFilterFactory();
Map<String, Expression> options = contrastEnhancement.getOptions();
options.put("algorithm", ff.literal("StretchToMinimumMaximum"));
options.put("minValue", ff.literal("1"));
options.put("maxValue", ff.literal("5"));
SelectedChannelType channelType = styleFactory.createSelectedChannelType("channel name", contrastEnhancement);
SelectedChannelType[] channels = new SelectedChannelType[3];
channels[0] = channelType;
channels[1] = channelType;
channels[2] = channelType;
ChannelSelection channelSelection = styleFactory.createChannelSelection(channels);
return channelSelection;
}
use of org.geotools.styling.ContrastEnhancement in project sldeditor by robward-scisys.
the class VOGeoServerContrastEnhancementNormalizeRedTest method createChannelSelection.
/**
* Creates the channel selection object.
*
* @param styleFactory the style factory
* @param contrastMethod the contrast method
* @return the channel selection
*/
private ChannelSelection createChannelSelection(StyleFactoryImpl styleFactory, ContrastMethod contrastMethod) {
ContrastEnhancement contrastEnhancement = (ContrastEnhancement) styleFactory.contrastEnhancement(null, contrastMethod.name());
FilterFactory ff = CommonFactoryFinder.getFilterFactory();
Map<String, Expression> options = contrastEnhancement.getOptions();
options.put("algorithm", ff.literal("StretchToMinimumMaximum"));
options.put("minValue", ff.literal("1"));
options.put("maxValue", ff.literal("5"));
SelectedChannelType channelType = styleFactory.createSelectedChannelType("channel name", contrastEnhancement);
SelectedChannelType[] channels = new SelectedChannelType[3];
channels[0] = channelType;
channels[1] = channelType;
channels[2] = channelType;
ChannelSelection channelSelection = styleFactory.createChannelSelection(channels);
return channelSelection;
}
use of org.geotools.styling.ContrastEnhancement in project sldeditor by robward-scisys.
the class RasterSymbolizerDetails method populateContrastEnhancementGroup.
/**
* Populate contrast enhancement group.
*
* @param channelGroup the channel group
* @param nameField the name field
* @param contrastGroup the contrast group
* @param gammaField the gamma field
* @param methodField the method field
* @param channelType the channel type
*/
private void populateContrastEnhancementGroup(GroupIdEnum channelGroup, FieldIdEnum nameField, GroupIdEnum contrastGroup, FieldIdEnum gammaField, GroupIdEnum methodField, SelectedChannelType channelType) {
String name = "";
if (channelType != null) {
name = channelType.getChannelName();
}
fieldConfigVisitor.populateTextField(nameField, name);
GroupConfigInterface contrastGrp = getGroup(contrastGroup);
ContrastEnhancement contrastEnhancement = null;
if (channelType != null) {
contrastEnhancement = channelType.getContrastEnhancement();
}
contrastGrp.enable(contrastEnhancement != null);
if (contrastEnhancement != null) {
fieldConfigVisitor.populateField(gammaField, contrastEnhancement.getGammaValue());
populateContrastMethod(contrastEnhancement, methodField);
}
}
Aggregations