Package org.geotools.image.palette

Examples of org.geotools.image.palette.ColorIndexer


        } else {
            if (!(image.getColorModel() instanceof IndexColorModel)) {
                // try to force a RGBA setup
                image = new ImageWorker(image).rescaleToBytes().forceComponentColorModel()
                        .getRenderedImage();
                ColorIndexer indexer = null;
               
                // user provided palette?
                if (mapContent.getPalette() != null) {
                    indexer = new CachingColorIndexer(new LRUColorIndexer(icm, 1024));
                } else if (palettedFormatName.equalsIgnoreCase(format)) {
View Full Code Here


        if (!(canvas.getColorModel() instanceof IndexColorModel)) {
            // try to force a RGBA setup
            ImageWorker imageWorker = new ImageWorker(canvas);
            RenderedImage image = imageWorker.rescaleToBytes().forceComponentColorModel()
                    .getRenderedImage();
            ColorIndexer indexer = new Quantizer(256).subsample().buildColorIndexer(image);

            // if we have an indexer transform the image
            if (indexer != null) {
                image = ColorIndexerDescriptor.create(image, indexer, null);
            }
View Full Code Here

TOP

Related Classes of org.geotools.image.palette.ColorIndexer

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.