Examples of ColorEngine


Examples of com.visitrend.ndvis.colormapper.util.ColorEngine

        super("Redraw");
        this.view = NDVis.getDefault();
    }

    public void actionPerformed(ActionEvent arg0) {
        ColorEngine e = view.getActiveDataVisualization().getLookup().lookup(ColorMapper.class).getEngine();
        e.colorImage(view.getActiveDataVisualization());
    }
View Full Code Here

Examples of com.visitrend.ndvis.colormapper.util.ColorEngine

            /*
             * Make the colorEngine color the current image. The color engine
             * will update its order from Parameters, which has been set
             * directly above, and then color the image accordingly.
             */
            ColorEngine e = dataVis.getLookup().lookup(ColorMapper.class).getEngine();
            e.colorImage(dataVis);
        }
        view.makeActiveVisualizationVisible();
    }
View Full Code Here

Examples of com.visitrend.ndvis.colormapper.util.ColorEngine

    public Optimizer() {
    }

    public static short[] flipOptimize(NDVis view) {
        DataVisualization dataVis = view.getActiveDataVisualization();
        ColorEngine engine = dataVis.getLookup().lookup(ColorMapper.class).getEngine();
        // TODO: why are you getting the number of parameters on X from the
        // color engine instead of parameters?
        int numParametersOnX = dataVis.getLookup().lookup(Parameters.class).getNumParametersOnX();
        int[] rgb = engine.getPixels();
        int[] rgbCopy = new int[rgb.length];
        short[] currentOrder = engine.getCurrentOrder();
        short[] bestOrder = PermutorCombinator.cloneShorts(engine.getCurrentOrder());
        // I leave this as being a local reference to bases because the user may
        // actually set a different value while this processing is happening
        short[] bases = view.getDataInfoForVisualization(
                dataVis).getBases();
        ParametersUtils paramUtils = dataVis.getLookup().lookup(Parameters.class).getParametersUtils();

        // score the current image
        int score = Score0.score(paramUtils, currentOrder, numParametersOnX,
                rgb, Integer.MAX_VALUE);
        int bestScore = score;

        short[] candidate = null;
        boolean keepgoing = true;
        // int j = 0;
        while (keepgoing) {
            if (bestScore == 0) {
                return bestOrder;
            }
            // j += 1;

            // System.out.println("Front of while and bestScore is " + bestScore
            // + " and currentOrder is: ");
            // PermuterCombinatorTest.printPermutation(currentOrder);
            // immediately reset keep going, only keep going if there is
            // some score out of the next series of flips that is better
            // than the current best score
            keepgoing = false;
            // get every pair-wise swap of values in bestOrder - i.e. this will
            // be bestOrder.length choose 2 short[]s returned in an ArrayList
            ArrayList permutations = generateAllPairWiseFlips(bestOrder);
            for (int k = 0, n = permutations.size(); k < n; k++) {
                candidate = (short[]) permutations.get(k);
                // PermuterCombinatorTest.printPermutation(candidate);

                // reorder the pixels given the candidate ordering
                engine.reorderPixelColors(rgb, rgbCopy, currentOrder,
                        candidate, bases);
                // score the new rgb int[] (in terms of what it would look like
                // if used to create an image)
                score = Score0.score(paramUtils, candidate, numParametersOnX,
                        rgbCopy, bestScore);
View Full Code Here

Examples of com.visitrend.ndvis.colormapper.util.ColorEngine

    public ColorMapper(Parameters params, DataVisualization dataVis) {
        view = NDVis.getDefault();
        this.dataVis = dataVis;
        this.params = params;
        this.engine = new ColorEngine(params);
        init(view);
    }
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.