当前位置: 首页>>代码示例>>Java>>正文


Java OutputSettings类代码示例

本文整理汇总了Java中com.google.appengine.api.images.OutputSettings的典型用法代码示例。如果您正苦于以下问题:Java OutputSettings类的具体用法?Java OutputSettings怎么用?Java OutputSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OutputSettings类属于com.google.appengine.api.images包,在下文中一共展示了OutputSettings类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testResizeAsync

import com.google.appengine.api.images.OutputSettings; //导入依赖的package包/类
@Test
public void testResizeAsync() throws IOException {
    InputSettings inputSettings = new InputSettings();
    OutputSettings outputSettings = new OutputSettings(OutputEncoding.PNG);

    Image originalImage = readImage(CAPEDWARF_PNG);
    Image resizedImage = waitOnFuture(imagesService.applyTransformAsync(ImagesServiceFactory.makeResize(400, 286), originalImage));
    assertEquals(400, resizedImage.getWidth());
    assertEquals(286, resizedImage.getHeight());

    originalImage = readImage(CAPEDWARF_PNG);
    resizedImage = waitOnFuture(imagesService.applyTransformAsync(ImagesServiceFactory.makeResize(300, 286), originalImage, outputSettings));
    assertEquals(300, resizedImage.getWidth());
    assertEquals(215, resizedImage.getHeight());

    originalImage = readImage(CAPEDWARF_PNG);
    resizedImage = waitOnFuture(imagesService.applyTransformAsync(ImagesServiceFactory.makeResize(300, 286), originalImage, inputSettings, outputSettings));
    assertEquals(300, resizedImage.getWidth());
    assertEquals(215, resizedImage.getHeight());

    originalImage = readImage(CAPEDWARF_PNG);
    resizedImage = waitOnFuture(imagesService.applyTransformAsync(ImagesServiceFactory.makeResize(300, 286), originalImage, OutputEncoding.JPEG));
    assertEquals(300, resizedImage.getWidth());
    assertEquals(215, resizedImage.getHeight());
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-tck,代码行数:26,代码来源:TransformationsTest.java

示例2: getTransformedImage

import com.google.appengine.api.images.OutputSettings; //导入依赖的package包/类
private Image getTransformedImage() {
    Assumption.assertNotNull(blobKey);

    Image oldImage = ImagesServiceFactory.makeImageFromBlob(blobKey);
    CompositeTransform finalTransform = getCompositeTransformToApply();
    OutputSettings settings = new OutputSettings(ImagesService.OutputEncoding.PNG);

    return ImagesServiceFactory.getImagesService().applyTransform(finalTransform, oldImage, settings);
}
 
开发者ID:TEAMMATES,项目名称:teammates,代码行数:10,代码来源:StudentProfilePictureEditAction.java

示例3: testSettings

import com.google.appengine.api.images.OutputSettings; //导入依赖的package包/类
@Test
public void testSettings() throws IOException {
    Image originalImage = readImage(CAPEDWARF_PNG);
    Composite c1 = ImagesServiceFactory.makeComposite(originalImage, 0, 0, 1, Composite.Anchor.BOTTOM_LEFT);
    Image ci = imagesService.composite(newArrayList(c1), 200, 143, 0, new OutputSettings(OutputEncoding.JPEG));
    assertImages(null, originalImage, ci);
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-tck,代码行数:8,代码来源:CompositeTest.java

示例4: testResize

import com.google.appengine.api.images.OutputSettings; //导入依赖的package包/类
@Test
public void testResize() throws IOException {
    InputSettings inputSettings = new InputSettings();
    OutputSettings outputSettings = new OutputSettings(OutputEncoding.PNG);

    Image originalImage = readImage(CAPEDWARF_PNG);
    assertEquals(200, originalImage.getWidth());
    assertEquals(143, originalImage.getHeight());

    originalImage = readImage(CAPEDWARF_PNG);
    Image resizedImage = imagesService.applyTransform(ImagesServiceFactory.makeResize(400, 286), originalImage);
    assertEquals(400, resizedImage.getWidth());
    assertEquals(286, resizedImage.getHeight());

    originalImage = readImage(CAPEDWARF_PNG);
    resizedImage = waitOnFuture(imagesService.applyTransformAsync(ImagesServiceFactory.makeResize(400, 286), originalImage));
    assertEquals(400, resizedImage.getWidth());
    assertEquals(286, resizedImage.getHeight());

    originalImage = readImage(CAPEDWARF_PNG);
    resizedImage = imagesService.applyTransform(ImagesServiceFactory.makeResize(300, 286), originalImage, inputSettings, outputSettings);
    assertEquals(300, resizedImage.getWidth());
    assertEquals(215, resizedImage.getHeight());

    originalImage = readImage(CAPEDWARF_PNG);
    resizedImage = waitOnFuture(imagesService.applyTransformAsync(ImagesServiceFactory.makeResize(300, 286), originalImage, inputSettings, outputSettings));
    assertEquals(300, resizedImage.getWidth());
    assertEquals(215, resizedImage.getHeight());

    originalImage = readImage(CAPEDWARF_PNG);
    resizedImage = imagesService.applyTransform(ImagesServiceFactory.makeResize(400, 200), originalImage, outputSettings);
    assertEquals(280, resizedImage.getWidth());
    assertEquals(200, resizedImage.getHeight());
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-tck,代码行数:35,代码来源:TransformationsTest.java

示例5: applyTransform

import com.google.appengine.api.images.OutputSettings; //导入依赖的package包/类
@Override
public Image applyTransform(Transform transform, Image image, OutputSettings outputSettings) {
    return null;
}
 
开发者ID:AndrewJack,项目名称:moment-for-android-wear,代码行数:5,代码来源:FakeImagesService.java

示例6: applyTransformAsync

import com.google.appengine.api.images.OutputSettings; //导入依赖的package包/类
@Override
public Future<Image> applyTransformAsync(Transform transform, Image image, OutputSettings outputSettings) {
    return null;
}
 
开发者ID:AndrewJack,项目名称:moment-for-android-wear,代码行数:5,代码来源:FakeImagesService.java

示例7: composite

import com.google.appengine.api.images.OutputSettings; //导入依赖的package包/类
@Override
public Image composite(Collection<Composite> composites, int i, int i2, long l, OutputSettings outputSettings) {
    return null;
}
 
开发者ID:AndrewJack,项目名称:moment-for-android-wear,代码行数:5,代码来源:FakeImagesService.java


注:本文中的com.google.appengine.api.images.OutputSettings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。