Examples of ChannelSelection


Examples of org.geotools.styling.ChannelSelection

    StyleBuilder sldBuilder = new StyleBuilder();
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);

    final RasterSymbolizer rsb_1 = sldBuilder.createRasterSymbolizer();
    final ChannelSelection chSel = new ChannelSelectionImpl();
    final SelectedChannelType chTypeGray    = new SelectedChannelTypeImpl();
    final ContrastEnhancement cntEnh = new ContrastEnhancementImpl();

    cntEnh.setMethod(ContrastMethod.HISTOGRAM);;
    //cntEnh.setGammaValue(sldBuilder.literalExpression(0.50));
   
    chTypeGray.setChannelName("1");   
    chSel.setGrayChannel(chTypeGray);

    rsb_1.setChannelSelection(chSel);
    rsb_1.setOpacity(sldBuilder.literalExpression(1.0));
    rsb_1.setContrastEnhancement(cntEnh);
    rsb_1.setOverlap(sldBuilder.literalExpression("AVERAGE"));
View Full Code Here

Examples of org.geotools.styling.ChannelSelection

    StyleBuilder sldBuilder = new StyleBuilder();
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);

    final RasterSymbolizer rsb_1 = sldBuilder.createRasterSymbolizer();
    final ChannelSelection chSel = new ChannelSelectionImpl();
    final SelectedChannelType chTypeGray = new SelectedChannelTypeImpl();
    final ContrastEnhancement cntEnh = new ContrastEnhancementImpl();

    //this will convert to byte!!!
    cntEnh.setMethod(ContrastMethod.HISTOGRAM);
    chTypeGray.setChannelName("1");
    chTypeGray.setContrastEnhancement(cntEnh);
    chSel.setGrayChannel(chTypeGray);
    rsb_1.setChannelSelection(chSel);
   
    // visit the RasterSymbolizer
    rsh.visit(rsb_1);
    final RenderedImage im=((GridCoverage2D) rsh.getOutput()).getRenderedImage();
View Full Code Here

Examples of org.geotools.styling.ChannelSelection

    StyleBuilder sldBuilder = new StyleBuilder();
    // the RasterSymbolizer Helper
    rsh = new RasterSymbolizerHelper(gc, null);

    final RasterSymbolizer rsb_1 = sldBuilder.createRasterSymbolizer();
    final ChannelSelection chSel = new ChannelSelectionImpl();
    final SelectedChannelType chTypeGray = new SelectedChannelTypeImpl();
    chTypeGray.setChannelName("1");
    chSel.setGrayChannel(chTypeGray);
    rsb_1.setChannelSelection(chSel);
    rsb_1.setOpacity(sldBuilder.literalExpression(1.0));
    final ColorMap cm = sldBuilder.createColorMap(
        new String[] { // labels
          "category",
View Full Code Here

Examples of org.geotools.styling.ChannelSelection

    // /////////////////////////////////////////////////////////////////////
    //
    // CHANNEL SELECTION
    //
    // /////////////////////////////////////////////////////////////////////
    final ChannelSelection cs = rs.getChannelSelection();
    csNode.addSource(this.getSource(0));
    csNode.addSink(cmNode);
    csNode.visit(cs);

    // /////////////////////////////////////////////////////////////////////
View Full Code Here

Examples of org.geotools.styling.ChannelSelection

    public ChannelSelection build() {
        if (unset) {
            return null;
        }
        ChannelSelection result;
        if (gray.isUnset()) {
            result = sf.channelSelection(red.build(), green.build(), blue.build());
        } else {
            result = sf.channelSelection(gray.build());
        }
View Full Code Here

Examples of org.geotools.styling.ChannelSelection

    private Style createGreyscaleStyle(int band) {
        ContrastEnhancement ce = sf.contrastEnhancement(ff.literal(1.0), ContrastMethod.NORMALIZE);
        SelectedChannelType sct = sf.createSelectedChannelType(String.valueOf(band), ce);

        RasterSymbolizer sym = sf.getDefaultRasterSymbolizer();
        ChannelSelection sel = sf.channelSelection(sct);
        sym.setChannelSelection(sel);

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

Examples of org.geotools.styling.ChannelSelection

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

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

Examples of org.geotools.styling.ChannelSelection

   
    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;
    }
View Full Code Here

Examples of org.geotools.styling.ChannelSelection

    }

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

    }
View Full Code Here

Examples of org.geotools.styling.ChannelSelection

     * @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;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.