Package org.apache.batik.gvt.filter

Examples of org.apache.batik.gvt.filter.Filter


            (CSSPrimitiveValue)decl.getPropertyCSSValue(ATTR_OPACITY);
        Composite composite = CSSUtilities.convertOpacityToComposite(val);
        node.setComposite(composite);

        // Set the node filter
        Filter filter = CSSUtilities.convertFilter(element, node, ctx);
        node.setFilter(filter);

        // Set the node mask
        Mask mask = CSSUtilities.convertMask(element, node, ctx);
        node.setMask(mask);
View Full Code Here


        Iterator i = srcs.iterator();
        boolean first = true;
        while (i.hasNext()) {
            // Get the source to work with...
            Filter cr = (Filter)i.next();

            // Get our sources image...
            RenderedImage ri = cr.createRendering(rc);
            // No output image keep going...
            if (ri == null)
                continue;

            if ((ri.getMinX()   != r.x)     || (ri.getMinY()   != r.y) ||
View Full Code Here

        if (clipElementClipPath != null) {
            clipPath.subtract(new Area(clipElementClipPath.getClipPath()));
        }

        // OTHER PROBLEM: SHOULD TAKE MASK REGION INTO ACCOUNT
        Filter filter = gn.getFilter();
        if (filter == null) {
              // Make the initial source as a RenderableImage
            GraphicsNodeRableFactory gnrFactory
                = ctx.getGraphicsNodeRableFactory();
            filter = gnrFactory.createGraphicsNodeRable(gn);
View Full Code Here

        //
        // The default region is the input source's region unless the
        // source is SourceGraphics, in which case the default region
        // is the filter chain's region
        //
        Filter sourceGraphics = (Filter)filterMap.get(VALUE_SOURCE_GRAPHIC);

        Rectangle2D defaultRegion = in.getBounds2D();
        if (in == sourceGraphics) {
            defaultRegion = filterRegion;
        }

        CSSStyleDeclaration cssDecl
            = bridgeContext.getViewCSS().getComputedStyle(filterElement, null);

        UnitProcessor.Context uctx
            = new DefaultUnitProcessorContext(bridgeContext, cssDecl);

        Rectangle2D blurArea
            = SVGUtilities.convertFilterPrimitiveRegion(filterElement,
                                                        filteredElement,
                                                        defaultRegion,
                                                        filteredNode,
                                                        uctx);

        PadRable pad = new ConcretePadRable(in, blurArea, PadMode.ZERO_PAD);

        // Build filter
        Filter filter = null;
        filter = new ConcreteGaussianBlurRable(pad,
                                               stdDeviationX,
                                               stdDeviationY);

        // Get result attribute if any
View Full Code Here

        //
        // The default region is the input source's region unless the
        // source is SourceGraphics, in which case the default region
        // is the filter chain's region
        //
        Filter sourceGraphics = (Filter)filterMap.get(VALUE_SOURCE_GRAPHIC);

        Rectangle2D defaultRegion = in.getBounds2D();

        if (in == sourceGraphics) {
            defaultRegion = filterRegion;
View Full Code Here

            (CSSPrimitiveValue)decl.getPropertyCSSValue(ATTR_OPACITY);
        Composite composite = CSSUtilities.convertOpacityToComposite(val);
        gn.setComposite(composite);

        // Set the node filter
        Filter filter = CSSUtilities.convertFilter(element, gn, ctx);
        gn.setFilter(filter);

        // Set the node mask
        Mask mask = CSSUtilities.convertMask(element, gn, ctx);
        gn.setMask(mask);
View Full Code Here

        at = SVGUtilities.convertAffineTransform(at,
                                                 maskedNode,
                                                 maskContentUnitsType);
        maskNodeContent.setTransform(at);

        Filter filter = maskedNode.getFilter();
        if (filter == null) {
            // Make the initial source as a RenderableImage
            GraphicsNodeRableFactory gnrFactory
                = bridgeContext.getGraphicsNodeRableFactory();
            filter = gnrFactory.createGraphicsNodeRable(maskedNode);
View Full Code Here

                         Element filterElement,
                         Element filteredElement,
                         Filter in,
                         Rectangle2D filterRegion,
                         Map filterMap){
        Filter filter = null;

        // First, extract source
        String inAttr = filterElement.getAttributeNS(null, ATTR_IN);
        in = CSSUtilities.getFilterSource(filteredNode,
                                          inAttr,
                                          bridgeContext,
                                          filteredElement,
                                          in,
                                          filterMap);

        // Exit if no 'in' found
        if (in == null) {
            return null;
        }

        //
        // The default region is the input source's region unless the
        // source is SourceGraphics, in which case the default region
        // is the filter chain's region
        //
        Filter sourceGraphics = (Filter)filterMap.get(VALUE_SOURCE_GRAPHIC);

        Rectangle2D defaultRegion = in.getBounds2D();

        if (in == sourceGraphics){
            defaultRegion = filterRegion;
View Full Code Here

        //
        // The default region is the input source's region unless the
        // source is SourceGraphics, in which case the default region
        // is the filter chain's region
        //
        Filter sourceGraphics = (Filter)filterMap.get(VALUE_SOURCE_GRAPHIC);

        Rectangle2D defaultRegion = in.getBounds2D();

        if (in == sourceGraphics) {
            defaultRegion = filterRegion;
        }

        CSSStyleDeclaration cssDecl
            = bridgeContext.getViewCSS().getComputedStyle(filterElement, null);

        UnitProcessor.Context uctx
            = new DefaultUnitProcessorContext(bridgeContext, cssDecl);

        Rectangle2D primitiveRegion
            = SVGUtilities.convertFilterPrimitiveRegion(filterElement,
                                                        filteredElement,
                                                        defaultRegion,
                                                        filteredNode,
                                                        uctx);

        PadRable pad = new ConcretePadRable(in,
                                            primitiveRegion,
                                            PadMode.ZERO_PAD);

        // Build filter
        Filter filter =
            new ConcreteMorphologyRable(pad, radiusX, radiusY, doDilation);

        // Get result attribute if any
        String result = filterElement.getAttributeNS(null, ATTR_RESULT);
        if((result != null) && (result.trim().length() > 0)){
View Full Code Here

            at = at.createInverse(); // clip in user space

            GraphicsNodeRableFactory gnrFactory
                = ctx.getGraphicsNodeRableFactory();

            Filter filter = gnrFactory.createGraphicsNodeRable(node);

            Shape clip = at.createTransformedShape
                (new Rectangle2D.Float(x, y, w, h));

            node.setClip(new ConcreteClipRable(filter, clip));
View Full Code Here

TOP

Related Classes of org.apache.batik.gvt.filter.Filter

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.