public SelectedChannelTypeImpl selectedChannelType( Expression channelName, org.opengis.style.ContrastEnhancement contrastEnhancement) { SelectedChannelTypeImpl selectedChannelType = new SelectedChannelTypeImpl(filterFactory); selectedChannelType.setChannelName(channelName); selectedChannelType.setContrastEnhancement(contrastEnhancement); return selectedChannelType; }
public SelectedChannelTypeImpl selectedChannelType( String channelName, org.opengis.style.ContrastEnhancement contrastEnhancement) { SelectedChannelTypeImpl selectedChannelType = new SelectedChannelTypeImpl(filterFactory); selectedChannelType.setChannelName(channelName); selectedChannelType.setContrastEnhancement(contrastEnhancement); return selectedChannelType; }
/** * 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; }
public SelectedChannelTypeImpl selectedChannelType(String channelName, org.opengis.style.ContrastEnhancement contrastEnhancement) { SelectedChannelTypeImpl selectedChannelType = new SelectedChannelTypeImpl( filterFactory ); selectedChannelType.setChannelName(channelName); selectedChannelType.setContrastEnhancement( contrastEnhancement ); return selectedChannelType; }