Package org.geotools.gce.grassraster.core.color

Examples of org.geotools.gce.grassraster.core.color.ColorRule


            }

            ArrayList<Rule> listOfRules = new ArrayList<Rule>();

            while( rules.hasMoreElements() ) {
                ColorRule element = (ColorRule) rules.nextElement();

                float lowvalue = element.getLowCategoryValue();
                float highvalue = element.getLowCategoryValue() + element.getCategoryRange();
                byte[] lowcatcol = element.getColor(lowvalue);
                byte[] highcatcol = element.getColor(highvalue);

                float[] lowHigh = new float[]{lowvalue, highvalue};
                Color lowColor = new Color(Display.getDefault(), (int) (lowcatcol[0] & 0xff),
                        (int) (lowcatcol[1] & 0xff), (int) (lowcatcol[2] & 0xff));
                Color highColor = new Color(Display.getDefault(), (int) (highcatcol[0] & 0xff),
View Full Code Here


        }

        ArrayList<Rule> listOfRules = new ArrayList<Rule>();

        while( rules.hasMoreElements() ) {
            ColorRule element = rules.nextElement();

            float lowvalue = element.getLowCategoryValue();
            float highvalue = element.getLowCategoryValue() + element.getCategoryRange();
            byte[] lowcatcol = element.getColor(lowvalue);
            byte[] highcatcol = element.getColor(highvalue);

            float[] lowHigh = new float[]{lowvalue, highvalue};
            Color lowColor = new Color(Display.getDefault(), (lowcatcol[0] & 0xff), (lowcatcol[1] & 0xff), (lowcatcol[2] & 0xff));
            Color highColor = new Color(Display.getDefault(), (highcatcol[0] & 0xff), (highcatcol[1] & 0xff),
                    (highcatcol[2] & 0xff));
View Full Code Here

    /**
     *
     */
    protected void addColorRule( int cat, int r, int g, int b ) {
        insertRule(cat, new ColorRule(cat, r, g, b));
    }
View Full Code Here

    /**
     *
     */
    protected void addColorRule( float cat0, int r0, int g0, int b0, float cat1, int r1, int g1,
            int b1 ) {
        insertRule(cat0, new ColorRule(cat0, r0, g0, b0, cat1, r1, g1, b1));
    }
View Full Code Here

        int low = 0;
        int high = rules.size() - 1;

        while( low <= high ) {
            i = (low + high) / 2;
            ColorRule crule = (ColorRule) rules.elementAt(i);
            int c = crule.compare(cat);
            // System.out.println("C="+c+", I="+i+", cat="+cat+",
            // CRULE="+crule);
            if (c == 0) {
                /*
                 * Attribute found with equal value so break and insert using this index.
View Full Code Here

        int low = 0;
        int high = rules.size() - 1;

        while( low <= high ) {
            int i = (low + high) / 2;
            ColorRule crule = (ColorRule) rules.elementAt(i);
            int c = crule.compare(cat);
            // System.out.println("C="+c+", I="+i+", cat="+cat+",
            // CRULE="+crule);
            if (c == 0) {
                return crule;
            } else if (c < 0) {
View Full Code Here

    /**
     *
     */
    public byte[] getColor( float x ) {
        ColorRule crule = get(x);

        return crule == null ? blank : crule.getColor(x);
    }
View Full Code Here

TOP

Related Classes of org.geotools.gce.grassraster.core.color.ColorRule

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.