當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。