Tabnine Logo
ChannelSelection.getSelectedChannels
Code IndexAdd Tabnine to your IDE (free)

How to use
getSelectedChannels
method
in
org.geotools.styling.ChannelSelection

Best Java code snippets using org.geotools.styling.ChannelSelection.getSelectedChannels (Showing top 8 results out of 315)

origin: geotools/geotools

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);
}
origin: geotools/geotools

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");
}
origin: geotools/geotools

  /**
   * 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;
  }
}
origin: geotools/geotools

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;
}
origin: geotools/geotools

/**
 * 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;
}
origin: org.geotools/gt-main

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);
}

origin: org.geotools/gt-main

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");
}
origin: org.geotools/gt-main

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;
}

org.geotools.stylingChannelSelectiongetSelectedChannels

Javadoc

get the channels to be used

Popular methods of ChannelSelection

  • getRGBChannels
    get the RGB channels to be used
  • getGrayChannel
    Get the gray channel to be used
  • setGrayChannel
    Set the gray channel to be used
  • setRGBChannels
    set the RGB channels to be used
  • accept
  • setSelectedChannels
    set the channels to be used

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now