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

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

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

origin: geoserver/geoserver

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

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

public ChannelSelectionBuilder reset(ChannelSelection original) {
  if (original == null) {
    return unset();
  }
  if (original.getGrayChannel() != null) {
    gray.reset(original.getGrayChannel());
  } else {
    red.reset(original.getRGBChannels()[0]);
    green.reset(original.getRGBChannels()[1]);
    blue.reset(original.getRGBChannels()[2]);
  }
  unset = false;
  return this;
}
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

final SelectedChannelType gray = cs.getGrayChannel();
origin: robward-scisys/sldeditor

@Override
protected ContrastEnhancement getContrastEnhancement(
    GroupIdEnum id, ChannelSelection channelSelection) {
  if (id == GroupIdEnum.RASTER_GREY_CHANNEL_OPTION) {
    return channelSelection.getGrayChannel().getContrastEnhancement();
  }
  return null;
}
origin: org.geotools/gt-main

@Override
public void visit(ChannelSelection cs) {
  if (cs.getGrayChannel() != null) {
    cs.getGrayChannel().accept(this);
  }
  for (SelectedChannelType ch : cs.getRGBChannels()) {
    ch.accept(this);
  }
}
origin: robward-scisys/sldeditor

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

if (cs.getGrayChannel() != null) {
  start("ChannelSelection");
  SelectedChannelType gray = cs.getGrayChannel();
origin: org.geotools/gt-widgets-swing-pending

public void setEdited(ChannelSelection channel) {
  this.channel = channel;
  if (channel != null) {
    guiGray.setEdited(channel.getGrayChannel());
    SelectedChannelType[] sct = channel.getRGBChannels();
    
    if(sct!= null && sct.length==3){
      guiRed.setEdited(sct[0]);
      guiGreen.setEdited(sct[1]);
      guiBlue.setEdited(sct[2]);
    }
  }
  
  lock();
}
origin: geotools/geotools

  /**
   * Test to ensure that updating the channels duplicates the raster sybmolizer with the new rgb
   * channels
   */
  public void testSetRasterRGBChannels() {
    RasterSymbolizer rs = sb.createRasterSymbolizer();
    Style s = sb.createStyle(rs);

    SelectedChannelType red =
        sf.createSelectedChannelType("red", sf.createContrastEnhancement(ff.literal(0.2)));
    SelectedChannelType green =
        sf.createSelectedChannelType(
            "green", sf.createContrastEnhancement(ff.literal(0.4)));
    SelectedChannelType blue =
        sf.createSelectedChannelType("blue", sf.createContrastEnhancement(ff.literal(0.7)));

    SLD.setChannelSelection(s, new SelectedChannelType[] {red, green, blue}, null);

    assertNull(SLD.rasterSymbolizer(s).getChannelSelection().getGrayChannel());
    assertNotNull(SLD.rasterSymbolizer(s).getChannelSelection().getRGBChannels());
    SelectedChannelType[] selectedChannels =
        SLD.rasterSymbolizer(s).getChannelSelection().getRGBChannels();

    assertEquals("red", selectedChannels[0].getChannelName().evaluate(null, String.class));
    assertEquals("green", selectedChannels[1].getChannelName().evaluate(null, String.class));
    assertEquals("blue", selectedChannels[2].getChannelName().evaluate(null, String.class));

    assertNotSame(SLD.rasterSymbolizer(s), rs);
  }
}
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;
}

origin: robward-scisys/sldeditor

    ((channelSelection.getGrayChannel() != null)
        || (rgbChannels[0] != null)
        || (rgbChannels[1] != null)
SelectedChannelType greyChannel = channelSelection.getGrayChannel();
if (greyChannel != null) {
  channelSelectionGroup.setOption(GroupIdEnum.RASTER_GREY_CHANNEL_OPTION);
origin: org.geotools/gt-render

final SelectedChannelType gray=cs.getGrayChannel();
origin: org.geoserver.community/gs-oseo-rest

@Test
public void testCreateCollectionSimpleLayerWithCustomStyle() throws Exception {
  // setup the granules
  setupLayer(
      "/test123-product-granules-rgb.json",
      "/test123-layer-simple-graystyle.json",
      "gs",
      Boolean.FALSE);
  LayerInfo layer =
      validateBasicLayerStructure(
          "gs", "gs:test123", new String[] {"RED_BAND", "GREEN_BAND", "BLUE_BAND"});
  // ... its style is a gray one based on the RED band
  assertThat(layer.getDefaultStyle().prefixedName(), equalTo("gs:test123"));
  ChannelSelection cs = getChannelSelection(layer);
  assertNull(cs.getRGBChannels()[0]);
  assertNull(cs.getRGBChannels()[1]);
  assertNull(cs.getRGBChannels()[2]);
  assertEquals("1", cs.getGrayChannel().getChannelName().evaluate(null, String.class));
  BufferedImage image =
      getAsImage("wms/reflect?layers=gs:test123&format=image/png&width=200", "image/png");
  File expected = new File("src/test/resources/test123-simple-gray.png");
  ImageAssert.assertEquals(expected, image, 1000);
}
origin: org.geoserver.community/gs-oseo-rest

@Test
public void testBandsFlagsGrayFlag() throws Exception {
  setupLayer(
      "/test123-product-granules-bands-flags.json",
      "/test123-layer-bands-flags-grayFlag.json",
      "gs",
      Boolean.TRUE);
  // check the configuration elements are there too
  LayerInfo layer =
      validateBasicLayerStructure(
          "gs",
          "gs:test123",
          new String[] {
            "VNIR_0", "VNIR_1", "VNIR_2", "QUALITY", "CLOUDSHADOW", "HAZE", "SNOW"
          });
  // ... its style has been generated
  assertThat(layer.getDefaultStyle().prefixedName(), equalTo("gs:test123"));
  // ... and it uses only a gray band, the snow flag
  ChannelSelection cs = getChannelSelection(layer);
  assertNull(cs.getRGBChannels()[0]);
  assertNull(cs.getRGBChannels()[1]);
  assertNull(cs.getRGBChannels()[2]);
  assertEquals("7", cs.getGrayChannel().getChannelName().evaluate(null, String.class));
  // the image is almost black, but not fully
  BufferedImage image =
      getAsImage("wms/reflect?layers=gs:test123&format=image/png&width=200", "image/png");
  File expected = new File("src/test/resources/test123-gray-snow.png");
  ImageAssert.assertEquals(expected, image, 1000);
}
origin: org.geotools/gt-main

if (cs.getGrayChannel() != null) {
  start("ChannelSelection");
  SelectedChannelType gray = cs.getGrayChannel();
origin: org.geoserver.community/gs-oseo-rest

@Test
public void testCreateCollectionMultiband() throws Exception {
  // setup the granules
  setupLayer(
      "/test123-product-granules-multiband.json",
      "/test123-layer-multiband.json",
      "gs",
      Boolean.TRUE);
  // check the configuration elements are there too
  LayerInfo layer =
      validateBasicLayerStructure(
          "gs", "gs:test123", new String[] {"B02", "B03", "B04", "B08"});
  // ... its style is a RGB one based on the B2, B3, B4
  assertThat(layer.getDefaultStyle().prefixedName(), equalTo("gs:test123"));
  ChannelSelection cs = getChannelSelection(layer);
  assertEquals("4", cs.getRGBChannels()[0].getChannelName().evaluate(null, String.class));
  assertEquals("2", cs.getRGBChannels()[1].getChannelName().evaluate(null, String.class));
  assertEquals("1", cs.getRGBChannels()[2].getChannelName().evaluate(null, String.class));
  assertNull(cs.getGrayChannel());
  BufferedImage image =
      getAsImage("wms/reflect?layers=gs:test123&format=image/png&width=200", "image/png");
  File expected = new File("src/test/resources/test123-multiband.png");
  ImageAssert.assertEquals(expected, image, 1000);
}
origin: org.geoserver.community/gs-oseo-rest

@Test
public void testBandsFlagsMix() throws Exception {
  setupLayer(
      "/test123-product-granules-bands-flags.json",
      "/test123-layer-bands-flags-browseMix.json",
      "gs",
      Boolean.TRUE);
  // check the configuration elements are there too
  LayerInfo layer =
      validateBasicLayerStructure(
          "gs",
          "gs:test123",
          new String[] {
            "VNIR_0", "VNIR_1", "VNIR_2", "QUALITY", "CLOUDSHADOW", "HAZE", "SNOW"
          });
  // ... its style has been generated
  assertThat(layer.getDefaultStyle().prefixedName(), equalTo("gs:test123"));
  // ... and it uses all two vnir bands and a flag
  ChannelSelection cs = getChannelSelection(layer);
  assertEquals("1", cs.getRGBChannels()[0].getChannelName().evaluate(null, String.class));
  assertEquals("2", cs.getRGBChannels()[1].getChannelName().evaluate(null, String.class));
  assertEquals("7", cs.getRGBChannels()[2].getChannelName().evaluate(null, String.class));
  assertNull(cs.getGrayChannel());
  BufferedImage image =
      getAsImage("wms/reflect?layers=gs:test123&format=image/png&width=200", "image/png");
  File expected = new File("src/test/resources/test123-vnir-snow.png");
  ImageAssert.assertEquals(expected, image, 1000);
}
origin: org.geoserver.community/gs-oseo-rest

@Test
public void testBandsFlagsAll() throws Exception {
  setupLayer(
      "/test123-product-granules-bands-flags.json",
      "/test123-layer-bands-flags-all.json",
      "gs",
      Boolean.TRUE);
  // check the configuration elements are there too
  LayerInfo layer =
      validateBasicLayerStructure(
          "gs",
          "gs:test123",
          new String[] {
            "VNIR_0", "VNIR_1", "VNIR_2", "QUALITY", "CLOUDSHADOW", "HAZE", "SNOW"
          });
  // ... its style has been generated
  assertThat(layer.getDefaultStyle().prefixedName(), equalTo("gs:test123"));
  // ... and it uses all VNIR bands
  ChannelSelection cs = getChannelSelection(layer);
  assertEquals("1", cs.getRGBChannels()[0].getChannelName().evaluate(null, String.class));
  assertEquals("2", cs.getRGBChannels()[1].getChannelName().evaluate(null, String.class));
  assertEquals("3", cs.getRGBChannels()[2].getChannelName().evaluate(null, String.class));
  assertNull(cs.getGrayChannel());
  BufferedImage image =
      getAsImage("wms/reflect?layers=gs:test123&format=image/png&width=200", "image/png");
  File expected = new File("src/test/resources/test123-vnir.png");
  ImageAssert.assertEquals(expected, image, 1000);
}
org.geotools.stylingChannelSelectiongetGrayChannel

Javadoc

Get the gray channel to be used

Popular methods of ChannelSelection

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

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • CodeWhisperer alternatives
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