Package com.volantis.map.ics.imageprocessor.tool

Examples of com.volantis.map.ics.imageprocessor.tool.Tool


public class PipelineTestCase extends TestCase {

    public void testProcess() throws Exception {
        final boolean[] processed = new boolean[]{false, false};
        Tool tool1 = new Tool() {
            public RenderedOp[] process(RenderedOp[] ops, ObjectParameters params)
                throws ToolException {
                processed[0] = true;
                return null;
            }
        };
        Tool tool2 = new Tool() {
            public RenderedOp[] process(RenderedOp[] ops, ObjectParameters params)
                throws ToolException {
                processed[1] = true;
                return null;
            }
View Full Code Here


    public RenderedOp[] process(RenderedOp[] ops, ObjectParameters params)
        throws PipelineException {
        RenderedOp[] currentOps = ops;
        try {
            for (Iterator iterator = tools.iterator(); iterator.hasNext();) {
                Tool tool = (Tool) iterator.next();
                currentOps = tool.process(currentOps, params);
            }
        } catch (ToolException e) {
            throw new PipelineException(e);
        }
        return currentOps;
View Full Code Here

                // tool will not be used
                if (params.containsName(ParameterNames.LEFT_X) &&
                    params.containsName(ParameterNames.RIGHT_X) &&
                    params.containsName(ParameterNames.BOTTOM_Y) &&
                    params.containsName(ParameterNames.TOP_Y)) {
                    Tool croppingTool =
                        theToolFactory.getTool("CroppingTool");
                    pipeline.addTool(croppingTool);
                }


                // We should guarantee that all other tools works
                // with RGB(A) images. However we have an optimized path for
                // writing Indexed images as GIFs. The RGB converter tool won't
                // do anything in that case unless watermarking is required in
                // which case we take the slow route.
                pipeline.addTool(theToolFactory.getTool("RGBConverterTool"));

                // Add clipping tool if it is needed.
                if (params.containsName(ParameterNames.PRESERVE_X_LEFT) ||
                    params.containsName(ParameterNames.PRESERVE_X_RIGHT)) {
                    Tool clippingTool =
                        theToolFactory.getTool("ClippingTool");
                    pipeline.addTool(clippingTool);
                }

                // Add resizing tool if it is needed.
                if (params.containsName(ParameterNames.IMAGE_WIDTH)) {
                    Tool resizingTool =
                        theToolFactory.getTool("ResizingTool");
                    pipeline.addTool(resizingTool);
                }

               
                //Add watermarking tool.
                if (params.containsName(ParameterNames.WATERMARK_URL)) {
                    Tool watermarkingTool =
                        theToolFactory.getTool("WatermarkingTool");
                    pipeline.addTool(watermarkingTool);
                }

                RenderedOp[] ops = null;
View Full Code Here

TOP

Related Classes of com.volantis.map.ics.imageprocessor.tool.Tool

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.