Package org.geotools.styling

Examples of org.geotools.styling.ChannelSelection


    }

    public void testRGB() throws Exception {
        SLDMockData.channelSelectionRGB(document, document);

        ChannelSelection cs = (ChannelSelection) parse();
        assertNotNull(cs);

        assertEquals(cs.getRGBChannels()[0].getChannelName(), "Red");
        assertEquals(cs.getRGBChannels()[1].getChannelName(), "Green");
        assertEquals(cs.getRGBChannels()[2].getChannelName(), "Blue");
    }
View Full Code Here


    }
   
    public void testGray() throws Exception {
        SLDMockData.channelSelectionGray(document, document);

        ChannelSelection cs = (ChannelSelection) parse();
        assertNotNull(cs);

        assertEquals(cs.getGrayChannel().getChannelName(), "Gray");
    }
View Full Code Here

        ContrastEnhancement ce = styleFactory.contrastEnhancement(filterFactory.literal(1.0), ContrastMethod.NORMALIZE);
        for( int i = 0; i < 3; i++ ) {
            sct[i] = styleFactory.createSelectedChannelType(String.valueOf(channelNum[i]), ce);
        }
        RasterSymbolizer sym = styleFactory.getDefaultRasterSymbolizer();
        ChannelSelection sel = styleFactory.channelSelection(sct[RED], sct[GREEN], sct[BLUE]);
        sym.setChannelSelection(sel);

        return SLD.wrapSymbolizers(sym);
    }
View Full Code Here

            // Setting label font and font bkgColor
            cmapLegendBuilder.setLabelFont(LegendUtils.getLabelFont(request));
            cmapLegendBuilder.setLabelFontColor(LegendUtils.getLabelFontColor(request));

            // set band
            final ChannelSelection channelSelection = rasterSymbolizer.getChannelSelection();
            cmapLegendBuilder.setBand(channelSelection != null ? channelSelection.getGrayChannel()
                    : null);

            // adding the colormap entries
            final ColorMapEntry[] colorMapEntries = cmap.getColorMapEntries();
            for (ColorMapEntry ce : colorMapEntries)
View Full Code Here

      } else if (childName.equalsIgnoreCase("BlueChannel")) {
        channels.add(parseSelectedChannel(child));
      }
    }

    ChannelSelection dap = factory
        .createChannelSelection((SelectedChannelType[]) channels
            .toArray(new SelectedChannelType[channels.size()]));

    return dap;
  }
View Full Code Here

            // Setting label font and font bkgColor
            cmapLegendBuilder.setLabelFont(LegendUtils.getLabelFont(request));
            cmapLegendBuilder.setLabelFontColor(LegendUtils.getLabelFontColor(request));

            // set band
            final ChannelSelection channelSelection = rasterSymbolizer.getChannelSelection();
            cmapLegendBuilder.setBand(channelSelection != null ? channelSelection.getGrayChannel()
                    : null);

            // adding the colormap entries
            final ColorMapEntry[] colorMapEntries = cmap.getColorMapEntries();
            for (ColorMapEntry ce : colorMapEntries)
View Full Code Here

TOP

Related Classes of org.geotools.styling.ChannelSelection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.