@Override public void visit(ChannelSelection cs) { if (cs.getGrayChannel() != null) { cs.getGrayChannel().accept(this); } final SelectedChannelType[] rgbChannels = cs.getRGBChannels(); for (SelectedChannelType ch : rgbChannels) { if (ch != null) ch.accept(this); } } });
protected ChannelSelection copy(ChannelSelection channelSelection) { if (channelSelection == null) return null; SelectedChannelType[] channels = copy(channelSelection.getSelectedChannels()); ChannelSelection copy = sf.createChannelSelection(channels); copy.setGrayChannel(copy(channelSelection.getGrayChannel())); copy.setRGBChannels(copy(channelSelection.getRGBChannels())); return copy; }
public void visit(ChannelSelection cs) { cs.accept(this); }
@Override public void setTo( org.geotools.styling.ChannelSelection sel, org.geotools.styling.SelectedChannelType chan) { org.geotools.styling.SelectedChannelType channels[] = sel.getRGBChannels(); channels[1] = chan; sel.setRGBChannels(channels); } },
@Override protected ContrastEnhancement getContrastEnhancement( GroupIdEnum id, ChannelSelection channelSelection) { if (id == GroupIdEnum.RASTER_RGB_CHANNEL_OPTION) { SelectedChannelType[] channelTypes = channelSelection.getRGBChannels(); return channelTypes[0].getContrastEnhancement(); } return null; }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { ChannelSelection cs = styleFactory.createChannelSelection(null); if (node.hasChild("GrayChannel")) { cs.setGrayChannel((SelectedChannelType) node.getChildValue("GrayChannel")); } else { SelectedChannelType[] rgb = new SelectedChannelType[] { (SelectedChannelType) node.getChildValue("RedChannel"), (SelectedChannelType) node.getChildValue("GreenChannel"), (SelectedChannelType) node.getChildValue("BlueChannel") }; cs.setRGBChannels(rgb); } return cs; } }
@Override public void setTo( org.geotools.styling.ChannelSelection sel, org.geotools.styling.SelectedChannelType chan) { sel.setGrayChannel(chan); } },
@Override protected ContrastEnhancement getContrastEnhancement( GroupIdEnum id, ChannelSelection channelSelection) { if (id == GroupIdEnum.RASTER_GREY_CHANNEL_OPTION) { return channelSelection.getGrayChannel().getContrastEnhancement(); } return null; }
chTypeBlue.setChannelName("1"); chSel.setRGBChannels(chTypeRed, chTypeGreen, chTypeBlue);
public void visit(ChannelSelection cs) { // get the channels final SelectedChannelType sct[] = copy(cs.getSelectedChannels()); final ChannelSelection copy = sf.createChannelSelection(sct); if (STRICT && !copy.equals(cs)) { throw new IllegalStateException( "Was unable to duplicate provided ChannelSelection:" + cs); } pages.push(copy); }
@Override public void setTo( org.geotools.styling.ChannelSelection sel, org.geotools.styling.SelectedChannelType chan) { org.geotools.styling.SelectedChannelType channels[] = sel.getRGBChannels(); channels[0] = chan; sel.setRGBChannels(channels); } },
@Override protected ContrastEnhancement getContrastEnhancement( GroupIdEnum id, ChannelSelection channelSelection) { if (id == GroupIdEnum.RASTER_RGB_CHANNEL_OPTION) { SelectedChannelType[] channelTypes = channelSelection.getRGBChannels(); return channelTypes[1].getContrastEnhancement(); } return null; }
@Override public void handle(YamlObject<?> obj, YamlParseContext context) { YamlMap map = obj.map(); if (map.has(Band.GRAY.key)) { if (map.has(Band.RED.key) || map.has(Band.GREEN.key) || map.has(Band.BLUE.key)) throw new IllegalArgumentException("grey and RGB can not be combined"); SelectedChannelType gray = factory.style.selectedChannelType((String) null, null); selection.setGrayChannel(gray); parse(Band.GRAY, gray, map, context); } else { if (!(map.has(Band.RED.key) && map.has(Band.GREEN.key) && map.has(Band.BLUE.key))) throw new IllegalArgumentException("all of red green and blue must be preset"); SelectedChannelType red = factory.style.selectedChannelType((String) null, null); SelectedChannelType green = factory.style.selectedChannelType((String) null, null); SelectedChannelType blue = factory.style.selectedChannelType((String) null, null); selection.setRGBChannels(red, green, blue); parse(Band.RED, red, map, context); parse(Band.GREEN, green, map, context); parse(Band.BLUE, blue, map, context); } } }
@Override public void setTo( org.geotools.styling.ChannelSelection sel, org.geotools.styling.SelectedChannelType chan) { sel.setGrayChannel(chan); } },
@Override protected ContrastEnhancement getContrastEnhancement(RasterSymbolizer rasterSymbolizer) { if (rasterSymbolizer != null) { ChannelSelection channelSelection = rasterSymbolizer.getChannelSelection(); if (channelSelection != null) { SelectedChannelType greyChannel = channelSelection.getGrayChannel(); if (greyChannel != null) { return greyChannel.getContrastEnhancement(); } } } return null; }
chTypeGreen.setChannelName("3"); chSel.setRGBChannels(chTypeRed, chTypeBlue, chTypeGreen);
public void visit(ChannelSelection cs) { if (cs == null) return; start("ChannelSelection"); final SelectedChannelType[] sct = cs.getSelectedChannels(); for (int i = 0; i < sct.length && sct != null; i++) visit(sct[i]); end("ChannelSelection"); }
@Override public void visit(ChannelSelection cs) { if (cs.getGrayChannel() != null) { cs.getGrayChannel().accept(this); } for (SelectedChannelType ch : cs.getRGBChannels()) { if (ch != null) { ch.accept(this); } } }
protected ChannelSelection copy(ChannelSelection channelSelection) { if( channelSelection == null ) return null; SelectedChannelType[] channels = copy( channelSelection.getSelectedChannels() ); ChannelSelection copy = sf.createChannelSelection( channels); copy.setGrayChannel( copy( channelSelection.getGrayChannel() )); copy.setRGBChannels( copy( channelSelection.getRGBChannels() )); return copy; }
@Override public void setTo( org.geotools.styling.ChannelSelection sel, org.geotools.styling.SelectedChannelType chan) { org.geotools.styling.SelectedChannelType channels[] = sel.getRGBChannels(); channels[2] = chan; sel.setRGBChannels(channels); } };