App Engine Java SDK version 1.9.8
[gae.git] / java / src / main / com / google / appengine / api / images / InputSettings.java
blob161e6f38a07c4a2e0a64bd56cc11bd6d0736df1c
1 // Copyright 2011 Google Inc. All Rights Reserved.
3 package com.google.appengine.api.images;
5 /**
6 * {@code InputSettings} represents the different settings to specify how
7 * an {@link Image} is interpreted by a transform.
9 */
10 public class InputSettings {
11 /**
12 * Actions to take with respect to correcting image orientation based
13 * on image metadata. EXIF metadata within the image may contain a parameter
14 * indicating its proper orientation. This value can equal 1 through 8,
15 * inclusive. "1" means that the image is in its "normal" orientation, i.e.,
16 * it should be viewed as it is stored.
18 * <p>Regardless of the {@code OrientationCorrection} value used, the
19 * orientation value in a transformed image is always cleared to indicate that
20 * no additional corrections of the returned image's orientation is necessary.
22 public static enum OrientationCorrection {
23 /**
24 * Do not apply any orientation correction specified in the EXIF metadata.
26 UNCHANGED_ORIENTATION,
27 /**
28 * Apply any orientation specified in the EXIF metadata to the image during
29 * the first transformation.
31 * <p>NOTE: If the image is already in portrait orientation, i.e., "taller"
32 * than it is "wide" no correction will be made, since it appears that the
33 * camera has already corrected it.
35 CORRECT_ORIENTATION,
38 /**
39 * What action should be taken with respect to correcting orientation.
41 private OrientationCorrection orientationCorrection;
43 /**
44 * Create an InputSettings with default orientation correction of
45 * {@link OrientationCorrection#UNCHANGED_ORIENTATION}.
47 public InputSettings() {
48 orientationCorrection = OrientationCorrection.UNCHANGED_ORIENTATION;
51 /**
52 * Set what action to take with respect to correcting image orientation based
53 * on image metadata.
54 * @param orientationCorrection what should be done to correct orientation
56 public void setOrientationCorrection(OrientationCorrection orientationCorrection) {
57 this.orientationCorrection = orientationCorrection;
60 /**
61 * Get what action to take with respect to correcting image orientation based
62 * on image metadata.
63 * @return what should be done to correct orientation
65 public OrientationCorrection getOrientationCorrection() {
66 return orientationCorrection;