Examples of Warp


Examples of javax.media.jai.Warp

        final WarpTransform2D inverse = (WarpTransform2D) transform.inverse();
        assertNotNull("WKT formatting test", transform.toString());
        /*
         * Checks Warp properties.
         */
        final Warp warp = transform.getWarp();
        assertTrue("Expected a polynomial warp but got " + Classes.getShortClassName(warp),
                   warp instanceof WarpPolynomial);
        final WarpPolynomial poly = (WarpPolynomial) warp;
        /*
         * Compares transformations to the expected points.
View Full Code Here

Examples of javax.media.jai.Warp

            if(!srcBounds.contains(srcROI.getBounds())) {
                srcROI = srcROI.intersect(new ROIShape(srcBounds));
            }

            // Retrieve the Warp object.
            Warp warp = (Warp)pb.getObjectParameter(0);

            // Setting constant image to be warped as a ROI
            Rectangle dstBounds = op.getBounds();
           
            // Setting layout of the constant image
View Full Code Here

Examples of javax.media.jai.Warp

            final float[] yCoeffs   = (float[]) value(Y_COEFFS, values);
            final float   preScaleX = scale( PRE_SCALE_X, values);
            final float   preScaleY = scale( PRE_SCALE_Y, values);
            final float  postScaleX = scale(POST_SCALE_X, values);
            final float  postScaleY = scale(POST_SCALE_Y, values);
            final Warp warp;
            switch (degree) {
                case 1:  warp = new WarpAffine           (xCoeffs, yCoeffs, preScaleX, preScaleY, postScaleX, postScaleY); break;
                case 2:  warp = new WarpQuadratic        (xCoeffs, yCoeffs, preScaleX, preScaleY, postScaleX, postScaleY); break;
                case 3:  warp = new WarpCubic            (xCoeffs, yCoeffs, preScaleX, preScaleY, postScaleX, postScaleY); break;
                default: warp = new WarpGeneralPolynomial(xCoeffs, yCoeffs, preScaleX, preScaleY, postScaleX, postScaleY); break;
View Full Code Here

Examples of javax.media.jai.Warp

         * delegates the work to a "Crop" operation.
         */
        final String operation;
        final ParameterBlock paramBlk = new ParameterBlock().addSource(sourceImage);
        final Map<String, Object> imageProperties = new HashMap<String, Object>();
        Warp warp = null;
        if (allSteps.isIdentity() || (allSteps instanceof AffineTransform &&
                XAffineTransform.isIdentity((AffineTransform) allSteps, EPS)))
        {
            /*
             * Since there is no interpolation to perform, use the native view (which may be
View Full Code Here

Examples of javax.media.jai.Warp

             * matches exactly the source rectangle. Checks if the bounding boxes calculated by the
             * Warp object match the expected ones. In the usual case where they do, we are done.
             * Otherwise we assume that the difference is caused by rounding error and we will try
             * progressive empirical adjustment in order to get the rectangles to fit.
             */
            final Warp warp = wb.buildWarp(transform, targetBB);
            if(true) {
                return warp;
            }
           
//            // remainder is disabled for now since it break Geoserver build.
View Full Code Here

Examples of javax.media.jai.Warp

                        // otherwise the warped roi image layout won't be computed properly
                        mappingBB = sourceBB.union(targetBB);
                    } else {
                        mappingBB = targetBB;
                    }
                    Warp warp = wb.buildWarp(chained, mappingBB);

                    // do the switch only if we get a warp that is as fast as the original one
                    Warp sourceWarp = (Warp) op.getParameterBlock().getObjectParameter(0);
                    if (warp instanceof WarpGrid
                            || warp instanceof WarpAffine
                            || !(sourceWarp instanceof WarpGrid || sourceWarp instanceof WarpAffine)) {
                        // and then the JAI Operation
                        PlanarImage sourceImage = op.getSourceImage(0);
View Full Code Here

Examples of net.canarymod.warp.Warp

                    else {
                        player.notice(Translator.translateAndFormat("no home set other", target.getName()));
                    }
                }
                else {
                    Warp home = Canary.warps().getHome(args[1]);
                    if (home != null) {
                        player.notice(Translator.translateAndFormat("home teleport other", args[1]));
                        player.teleportTo(home.getLocation());
                    }
                    else {
                        player.notice(Translator.translateAndFormat("no home set other", args[1]));
                    }
                }
View Full Code Here

Examples of net.canarymod.warp.Warp

                Group[] groups = makeGroupArray(data.groups);
                String owner = ToolBox.stringToNull(data.owner);
                String name = data.name;
                boolean playerHome = data.isPlayerHome;
                Location loc = Location.fromString(data.location);
                Warp warp;

                if (owner != null) {
                    warp = new Warp(loc, name, owner, playerHome);
                }
                else if (groups != null && groups.length > 0) {
                    warp = new Warp(loc, groups, name);
                }
                else {
                    // assume this is a public warp
                    warp = new Warp(loc, name);
                }
                warps.add(warp);
            }
        }
        catch (DatabaseReadException e) {
View Full Code Here

Examples of net.canarymod.warp.Warp

                player.notice(Translator.translate("setwarp failed"));
                return;
            }
            // SET PUBLIC WARP
            if (args.length == 2 && player.hasPermission("canary.command.warp.set.public")) {
                Warp newWarp = new Warp(player.getLocation(), args[1]);

                Canary.warps().addWarp(newWarp);
                player.message(Colors.YELLOW + Translator.translateAndFormat("setwarp success", args[1]));
            }
            else if (args.length > 3) {
                // SET GROUP SPECIFIC WARP
                if (args[2].equalsIgnoreCase("G") && player.hasPermission("canary.command.warp.set.group")) {
                    Group[] groups = new Group[args.length - 3];

                    for (int i = 0; i < groups.length; i++) {
                        groups[i] = Canary.usersAndGroups().getGroup(args[i + 3]);
                    }
                    Warp newWarp = new Warp(player.getLocation(), groups, args[1]);

                    Canary.warps().addWarp(newWarp);
                    player.message(Colors.YELLOW + Translator.translateAndFormat("setwarp success group", args[1]));
                    return;
                }
                // SET PRIVATE WARP
                if (args[2].equalsIgnoreCase("P") && player.hasPermission("canary.command.warp.set.private")) {
                    Warp newWarp = new Warp(player.getLocation(), args[1], args[3], false);

                    Canary.warps().addWarp(newWarp);
                    player.message(Colors.YELLOW + Translator.translateAndFormat("setwarp success private", args[1]));
                }
                else {
View Full Code Here

Examples of net.canarymod.warp.Warp

* @author Chris (damagefilter)
*/
public class WarpRemove implements NativeCommand {
    public void execute(MessageReceiver caller, String[] args) {
        if (Canary.warps().warpExists(args[1])) {
            Warp target = Canary.warps().getWarp(args[1]);
            Canary.warps().removeWarp(target);
            caller.message(Colors.YELLOW + Translator.translateAndFormat("warp removed", target.getName()));
        }
        else {
            caller.notice(Translator.translateAndFormat("warp unknown", args[1]));
        }
    }
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.