public void visit(SelectedChannelType sct) { element("SourceChannelName", sct.getChannelName()); final ContrastEnhancement ce = sct.getContrastEnhancement(); if (ce != null) ce.accept(this); }
public SelectedChannelType createSelectedChannelType( Expression name, ContrastEnhancement enhancement) { SelectedChannelType sct = new SelectedChannelTypeImpl(filterFactory); sct.setChannelName(name); sct.setContrastEnhancement(enhancement); return sct; }
method.addOption("maxValue", sldBuilder.literalExpression(max + (20 * i))); cntEnh.setMethod(method); channels[i].setChannelName(Integer.toString((i * 2) + 1)); channels[i].setContrastEnhancement(cntEnh); final ContrastEnhancement cntEnh = postBandSelectionChannel.getContrastEnhancement(); ContrastMethod method = cntEnh.getMethod(); .equalsIgnoreCase( postBandSelectionChannel .getChannelName() .evaluate(null, String.class))); assertTrue(method.name().equalsIgnoreCase(ContrastMethod.NORMALIZE.name()));
public void visit(SelectedChannelType sct) { // ///////////////////////////////////////////////////////////////////// // // If a SelectedChannelType was provided, let's try to parse it. // // ///////////////////////////////////////////////////////////////////// if (sct != null) { try { bandIndex = sct.getChannelName().evaluate(null, Integer.class); } catch (NumberFormatException e) { // something bad happened final IllegalArgumentException iee = new IllegalArgumentException( Errors.format( ErrorKeys.BAD_BAND_NUMBER_$1, Integer.valueOf(bandIndex))); iee.initCause(e); throw iee; } return; } // ///////////////////////////////////////////////////////////////////// // // If no SelectedChannelType was provided, let's just forward the // source. // // ///////////////////////////////////////////////////////////////////// // do nothing }
@Override public void handle(YamlObject<?> obj, YamlParseContext context) { String name = obj.map().str("name"); sel.setChannelName(name); context.push( "contrast-enhancement", new ContrastEnhancementHandler() { @Override protected void set() { sel.setContrastEnhancement(this.contrast); } }); } }
@Override public void visit(SelectedChannelType sct) { if (sct.getContrastEnhancement() != null) { sct.getContrastEnhancement().accept(this); } }
@Override protected void set() { sel.setContrastEnhancement(this.contrast); } });
/** * Returns an int[] containing the indices of the coverage bands that are used for the * symbolizer's selection channels * * @param symbolizer The input symbolizer * @return the band indices array (null if no channel selection was present in symbolizer) */ public static int[] getBandIndicesFromSelectionChannels(RasterSymbolizer symbolizer) { int[] bandIndices = null; ChannelSelection channelSelection = symbolizer.getChannelSelection(); if (channelSelection != null) { SelectedChannelType[] channels = channelSelection.getSelectedChannels(); if (channels != null) { bandIndices = new int[channels.length]; for (int i = 0; i < channels.length; i++) { // Note that in channel selection, channels start at index 1 bandIndices[i] = channels[i].getChannelName().evaluate(null, Integer.class) - 1; } } } return bandIndices; } }
void parse(Band band, SelectedChannelType sel, YamlMap map, YamlParseContext context) { if (map.get(band.key) instanceof Map) { context.push(band.key, new SelectedChannelHandler(sel)); } else { sel.setChannelName(map.str(band.key)); } }
/** * Takes into account that the band selection has been delegated down to the reader by producing * a new channel selection * * @param symbolizer * @return */ public static RasterSymbolizer setupSymbolizerForBandsSelection(RasterSymbolizer symbolizer) { ChannelSelection selection = symbolizer.getChannelSelection(); final SelectedChannelType[] originalChannels = selection.getSelectedChannels(); if (originalChannels != null) { int i = 0; SelectedChannelType[] channels = new SelectedChannelType[originalChannels.length]; for (SelectedChannelType originalChannel : originalChannels) { // Remember, channel indices start from 1 SelectedChannelTypeImpl channel = new SelectedChannelTypeImpl(); channel.setChannelName(Integer.toString(i + 1)); channel.setContrastEnhancement(originalChannel.getContrastEnhancement()); channels[i] = channel; i++; } ChannelSelectionUpdateStyleVisitor channelsUpdateVisitor = new ChannelSelectionUpdateStyleVisitor(channels); symbolizer.accept(channelsUpdateVisitor); return (RasterSymbolizer) channelsUpdateVisitor.getCopy(); } return symbolizer; }
@Override protected void set() { sel.setContrastEnhancement(this.contrast); } });
public SelectedChannelTypeBuilder reset(SelectedChannelType selectedChannelType) { if (selectedChannelType == null) { return reset(); } contrastEnhancement.reset(selectedChannelType.getContrastEnhancement()); channelName = selectedChannelType.getChannelName(); unset = false; return this; }
public SelectedChannelType createSelectedChannelType(String name, Expression gammaValue) { SelectedChannelType sct = new SelectedChannelTypeImpl(filterFactory); sct.setChannelName(name); sct.setContrastEnhancement(createContrastEnhancement(gammaValue)); return sct; }
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { if (value != null && value instanceof SelectedChannelType) { selected = (SelectedChannelType) value; but.setText(selected.getChannelName()); } else { selected = null; } return but; }
final SelectedChannelType chTypeGreen = new SelectedChannelTypeImpl(); chTypeRed.setChannelName("5"); chTypeGreen.setChannelName("3"); chTypeBlue.setChannelName("1");
@Override public void visit(SelectedChannelType sct) { if (sct.getContrastEnhancement() != null) { sct.getContrastEnhancement().accept(this); } }
public void visit(SelectedChannelType sct) { sct.accept(this); }
public void visit(SelectedChannelType sct) { final SelectedChannelType copy = sf.createSelectedChannelType( sct.getChannelName(), copy(sct.getContrastEnhancement())); if (STRICT && !copy.equals(sct)) { throw new IllegalStateException( "Was unable to duplicate provided SelectedChannelType:" + sct); } pages.push(copy); }
public SelectedChannelType createSelectedChannelType(Expression name, Expression gammaValue) { SelectedChannelType sct = new SelectedChannelTypeImpl(filterFactory); sct.setChannelName(name); sct.setContrastEnhancement(createContrastEnhancement(gammaValue)); return sct; }