Package com.google.appengine.api.images

Examples of com.google.appengine.api.images.Transform


    @Test
    public void testRotate() throws IOException {
        ChkType chkType;
        for (int dg : DEGREES) {
            Transform transform = ImagesServiceFactory.makeRotate(dg);
            if ((dg == 90) || (dg == 270)) {
                chkType = ChkType.ROTATE;
            } else {
                chkType = ChkType.FLIP;
            }
View Full Code Here


        ChkType chkType = ChkType.CROP;
        String cropLeftX = "0.0";
        String cropTopY = "0.0";
        String cropRightX = "0.5";
        String cropBottomY = "0.5";
        Transform transform = ImagesServiceFactory.makeCrop(new Float(cropLeftX), new Float(cropTopY), new Float(cropRightX), new Float(cropBottomY));
        for (OutputEncoding encoding : ENCODES) {
            applyAndVerify("pngAttach.png", transform, chkType, encoding);
        }
    }
View Full Code Here

    @Test
    public void testResizeWithStretch() throws IOException {
        int resizedWidth = 300;
        int resizedHeight = 200;
        Image originalImage = readImage(CAPEDWARF_PNG);
        Transform resize = ImagesServiceFactory.makeResize(resizedWidth, resizedHeight, true);
        Image resizedImage = imagesService.applyTransform(resize, originalImage);

        assertEquals(resizedWidth, resizedImage.getWidth());
        assertEquals(resizedHeight, resizedImage.getHeight());
    }
View Full Code Here

    @Test
    public void testResizeWithCrop() throws IOException {
        int resizedWidth = 300;
        int resizedHeight = 200;
        Image originalImage = readImage(CAPEDWARF_PNG);
        Transform resize = ImagesServiceFactory.makeResize(resizedWidth, resizedHeight, 0.5f, 0.5f);
        Image resizedImage = imagesService.applyTransform(resize, originalImage);
        assertEquals(resizedWidth, resizedImage.getWidth());
        assertEquals(resizedHeight, resizedImage.getHeight());

        originalImage = readImage(CAPEDWARF_PNG);
View Full Code Here

    }

    @Test
    public void testHorizontalFlip() throws IOException {
        Image image = readImage("capedwarf.png");
        Transform horizontalFlip = ImagesServiceFactory.makeHorizontalFlip();

        Image flippedImage = imagesService.applyTransform(horizontalFlip, image);

        assertNotNull(flippedImage);
    }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.images.Transform

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.