Examples of ClipXY


Examples of com.volantis.map.ics.imageprocessor.tool.clip.ClipXY

            LOGGER.error("loading-param-failure", "newWidth, preserveXLeft, preserveXRight");
            throw new ToolException(e);
        }
        if (newWidth > -1 && oldWidth > newWidth) {
            // should try to crop the image.
            ClipXY clipper = new ClipXY(firstImage.getWidth(), preserveXLeft, preserveXRight,
                                        firstImage.getHeight(), ImageConstants.NO_CLIP_LEFT,
                                        ImageConstants.NO_CLIP_RIGHT);

            clipper.clipTo(newWidth, firstImage.getHeight());
            params.setObject(ParameterNames.CLIP_AREA, clipper);
        }

        return super.process(images, params);
    }
View Full Code Here

Examples of com.volantis.map.ics.imageprocessor.tool.clip.ClipXY

        RenderedOp clippedImage = image;
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("OriginalImage:" + ImageInformation.asString(image));
        }

        ClipXY clipper = null;

        // should try to crop the image.
        if (params.containsName(ParameterNames.CLIP_AREA)) {
            clipper = (ClipXY) params.getObject(ParameterNames.CLIP_AREA);
        }

        if (clipper != null) {
            // should try to crop the image.

            // adjust clipper for selected frame. It has to be cloned to preserve
            // initial clip area for further processing
            ClipXY frameClipper = (ClipXY) clipper.clone();
            frameClipper.adjustTo(image.getMinX(), image.getWidth(), image.getMinY(), image.getHeight());

            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("ClipInfo: " + clipper.toString());
                LOGGER.debug("FrameClipInfo: " + frameClipper.toString());
            }

            ParameterBlock cropParams = new ParameterBlock();
            cropParams.addSource(clippedImage);
            cropParams.add((float) frameClipper.getX().getClipOffset());
            cropParams.add((float) frameClipper.getY().getClipOffset());
            cropParams.add((float) frameClipper.getX().getClipSize());
            cropParams.add((float) frameClipper.getY().getClipSize());

            try {
                clippedImage = JAI.create("crop", cropParams);
            } catch (Exception e) {
                LOGGER.error("jai-operation-failure", "crop");
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.