Package org.mapfish.print.test.util

Examples of org.mapfish.print.test.util.ImageSimilarity


        scalebarParams.verticalAlign = VerticalAlign.TOP.getLabel();

        ScalebarGraphic scalebar = new ScalebarGraphic();
        URI file = scalebar.render(mapParams, scalebarParams, folder.getRoot(), this.template);
//      Files.copy(new File(file), new File("/tmp/" + getClass().getSimpleName() + "expected-scalebar-graphic.tiff"));
        new ImageSimilarity(new File(file), 4).assertSimilarity(getFile("expected-scalebar-graphic.tiff"), 15);
    }
View Full Code Here


        ScalebarAttributeValues scalebarParams = scalebarAttibute.createValue(null);

        ScalebarGraphic scalebar = new ScalebarGraphic();
        URI file = scalebar.render(mapParams, scalebarParams, folder.getRoot(), this.template);
//      Files.copy(new File(file), new File("/tmp/" + getClass().getSimpleName() + "expected-scalebar-graphic-dpi.tiff"));
        new ImageSimilarity(new File(file), 4).assertSimilarity(getFile("expected-scalebar-graphic-dpi.tiff"), 15);
    }
View Full Code Here

        ScalebarGraphic scalebar = new ScalebarGraphic();
        URI file = scalebar.render(mapParams, scalebarParams, folder.getRoot(), this.template);
//        Files.copy(new File(file), new File("/tmp/" + getClass().getSimpleName() + "expected-scalebar-graphic.svg"));
//        ImageSimilarity.writeUncompressedImage(
//                ImageSimilarity.convertFromSvg(file, 300, 40), "/tmp/" + getClass().getSimpleName() + "expected-scalebar-graphic-svg.tiff");
        new ImageSimilarity(ImageSimilarity.convertFromSvg(file, 300, 40), 4).assertSimilarity(getFile("expected-scalebar-graphic-svg.tiff"), 15);
    }
View Full Code Here

        ScaleBarRenderSettings settings = getSettings(graphics2d, 1);
        ScalebarDrawer drawer = Type.LINE.createDrawer(graphics2d, settings);
        drawer.draw();

//        ImageSimilarity.writeUncompressedImage(bufferedImage, "/tmp/expected-scalebar-line.tiff");
        new ImageSimilarity(bufferedImage, 4).assertSimilarity(getFile("expected-scalebar-line.tiff"), 5);
    }
View Full Code Here

        ScaleBarRenderSettings settings = getSettings(graphics2d, 2);
        ScalebarDrawer drawer = Type.LINE.createDrawer(graphics2d, settings);
        drawer.draw();

//        ImageSimilarity.writeUncompressedImage(bufferedImage, "/tmp/expected-scalebar-line-subs.tiff");
        new ImageSimilarity(bufferedImage, 4).assertSimilarity(getFile("expected-scalebar-line-subs.tiff"), 5);
    }
View Full Code Here

        ScaleBarRenderSettings settings = getSettings(graphics2d, 1);
        ScalebarDrawer drawer = Type.BAR.createDrawer(graphics2d, settings);
        drawer.draw();

//        ImageSimilarity.writeUncompressedImage(bufferedImage, "/tmp/expected-scalebar-bar.tiff");
        new ImageSimilarity(bufferedImage, 4).assertSimilarity(getFile(expectedDir + "expected-scalebar-bar.tiff"), 5);
    }
View Full Code Here

        ScaleBarRenderSettings settings = getSettings(graphics2d, 2);
        ScalebarDrawer drawer = Type.BAR.createDrawer(graphics2d, settings);
        drawer.draw();

//        ImageSimilarity.writeUncompressedImage(bufferedImage, "/tmp/expected-scalebar-bar-subs.tiff");
        new ImageSimilarity(bufferedImage, 4).assertSimilarity(getFile(expectedDir + "expected-scalebar-bar-subs.tiff"), 5);
    }
View Full Code Here

        settings.getParams().backgroundColor = "rgb(214, 214, 214)";
        ScalebarDrawer drawer = Type.BAR.createDrawer(graphics2d, settings);
        drawer.draw();

//        ImageSimilarity.writeUncompressedImage(bufferedImage, "/tmp/expected-scalebar-bar-bg.tiff");
        new ImageSimilarity(bufferedImage, 4).assertSimilarity(getFile(expectedDir + "expected-scalebar-bar-bg.tiff"), 25);
    }
View Full Code Here

        ScaleBarRenderSettings settings = getSettings(graphics2d, 1);
        ScalebarDrawer drawer = Type.BAR_SUB.createDrawer(graphics2d, settings);
        drawer.draw();

//        ImageSimilarity.writeUncompressedImage(bufferedImage, "e:/tmp/expected-scalebar-barsub.tiff");
        new ImageSimilarity(bufferedImage, 4).assertSimilarity(getFile(expectedDir + "expected-scalebar-barsub.tiff"), 5);
    }
View Full Code Here

        ScaleBarRenderSettings settings = getSettings(graphics2d, 2);
        ScalebarDrawer drawer = Type.BAR_SUB.createDrawer(graphics2d, settings);
        drawer.draw();

//        ImageSimilarity.writeUncompressedImage(bufferedImage, "e:/tmp/expected-scalebar-barsub-subs.tiff");
        new ImageSimilarity(bufferedImage, 4).assertSimilarity(getFile(expectedDir + "expected-scalebar-barsub-subs.tiff"), 5);
    }
View Full Code Here

TOP

Related Classes of org.mapfish.print.test.util.ImageSimilarity

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.