Examples of ColorMatrixRable


Examples of org.apache.batik.ext.awt.image.renderable.ColorMatrixRable

            float[][] matrix = { {1, 0, 0, 0, 0},
                                 {0, 1, 0, 0, 0},
                                 {0, 0, 1, 0, 0},
                                 {0, 0, 0, opacity, 0} };

            ColorMatrixRable filter = ColorMatrixRable8Bit.buildMatrix(matrix);
            Filter contentRable
                = new GraphicsNodeRable8Bit(patternContentNode, rc);
            filter.setSource(contentRable);
            patternContentNode.setFilter(filter);
        }

        return new PatternPaint(patternContentNode,
                                rc,
View Full Code Here

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

        // Extract the matrix type. Interpret the values accordingly.
        //
        String typeStr = filterElement.getAttributeNS(null, ATTR_TYPE);
        int type = convertType(typeStr);
        String valuesStr = filterElement.getAttributeNS(null, ATTR_VALUES);
        ColorMatrixRable colorMatrix;
        switch(type){
        case ColorMatrixRable.TYPE_MATRIX:
            float matrix[][] = convertValuesToMatrix(valuesStr);
            colorMatrix = ConcreteColorMatrixRable.buildMatrix(matrix);
            break;
        case ColorMatrixRable.TYPE_SATURATE:
            float s = 1;
            if (valuesStr.length() > 0) {
                s = CSSUtilities.convertRatio(valuesStr);
            }
            colorMatrix = ConcreteColorMatrixRable.buildSaturate(s);
            break;
        case ColorMatrixRable.TYPE_HUE_ROTATE:
            float a = 0; // default is 0
            if (valuesStr.length() > 0) {
                a = (float) (SVGUtilities.convertSVGNumber(ATTR_VALUES, valuesStr) * Math.PI/180);
            }
            colorMatrix = ConcreteColorMatrixRable.buildHueRotate(a);
            break;
        case ColorMatrixRable.TYPE_LUMINANCE_TO_ALPHA:
            colorMatrix = ConcreteColorMatrixRable.buildLuminanceToAlpha();
            break;
        default:
            /* Never happen: Bad type is catched previously */
            throw new Error();
        }

        colorMatrix.setSource(in);

        filter = new ConcretePadRable(colorMatrix,
                                      primitiveRegion,
                                      PadMode.ZERO_PAD);

View Full Code Here

Examples of org.apache.flex.forks.batik.ext.awt.image.renderable.ColorMatrixRable

                                                        defaultRegion,
                                                        filterRegion,
                                                        ctx);

        int type = convertType(filterElement);
        ColorMatrixRable colorMatrix;
        switch (type) {
        case ColorMatrixRable.TYPE_HUE_ROTATE:
            float a = convertValuesToHueRotate(filterElement);
            colorMatrix = ColorMatrixRable8Bit.buildHueRotate(a);
            break;
        case ColorMatrixRable.TYPE_LUMINANCE_TO_ALPHA:
            colorMatrix = ColorMatrixRable8Bit.buildLuminanceToAlpha();
            break;
        case ColorMatrixRable.TYPE_MATRIX:
            float [][] matrix = convertValuesToMatrix(filterElement);
            colorMatrix = ColorMatrixRable8Bit.buildMatrix(matrix);
            break;
        case ColorMatrixRable.TYPE_SATURATE:
            float s = convertValuesToSaturate(filterElement);
            colorMatrix = ColorMatrixRable8Bit.buildSaturate(s);
            break;
        default:
            throw new Error(); // can't be reached
        }
        colorMatrix.setSource(in);

        // handle the 'color-interpolation-filters' property
        handleColorInterpolationFilters(colorMatrix, filterElement);

        Filter filter
View Full Code Here

Examples of org.apache.flex.forks.batik.ext.awt.image.renderable.ColorMatrixRable

                                                        defaultRegion,
                                                        filterRegion,
                                                        ctx);

        int type = convertType(filterElement, ctx);
        ColorMatrixRable colorMatrix;
        switch (type) {
        case ColorMatrixRable.TYPE_HUE_ROTATE:
            float a = convertValuesToHueRotate(filterElement, ctx);
            colorMatrix = ColorMatrixRable8Bit.buildHueRotate(a);
            break;
        case ColorMatrixRable.TYPE_LUMINANCE_TO_ALPHA:
            colorMatrix = ColorMatrixRable8Bit.buildLuminanceToAlpha();
            break;
        case ColorMatrixRable.TYPE_MATRIX:
            float [][] matrix = convertValuesToMatrix(filterElement, ctx);
            colorMatrix = ColorMatrixRable8Bit.buildMatrix(matrix);
            break;
        case ColorMatrixRable.TYPE_SATURATE:
            float s = convertValuesToSaturate(filterElement, ctx);
            colorMatrix = ColorMatrixRable8Bit.buildSaturate(s);
            break;
        default:
            throw new Error("invalid convertType:" + type ); // can't be reached
        }
        colorMatrix.setSource(in);

        // handle the 'color-interpolation-filters' property
        handleColorInterpolationFilters(colorMatrix, filterElement);

        Filter filter
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.