diff options
author | Igor Murashkin <iam@google.com> | 2014-04-17 18:37:06 -0700 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2014-05-02 15:55:30 -0700 |
commit | 94814218d2313a989a5a8969f633e3fc33e43071 (patch) | |
tree | ff5a4d4c447b5eafe0c83bca989bb308a0ea179c /graphics | |
parent | b3a78b2ca9655396e2d73950221d187b7e5bb3ba (diff) | |
download | frameworks_base-94814218d2313a989a5a8969f633e3fc33e43071.zip frameworks_base-94814218d2313a989a5a8969f633e3fc33e43071.tar.gz frameworks_base-94814218d2313a989a5a8969f633e3fc33e43071.tar.bz2 |
camera2: Add camera-specific data types used for metadata key/value
Adds new public API classes:
* InputOutputFormatsMap
* LensShadingMap
* RggbChannelVector
* StreamConfigurationMap
* TonemapCurve
Adds new @hide classes:
* StreamConfiguration
* StreamConfigurationDuration
Minor changes:
* CameraDevice (doc only)
* Preconditions (new @hide function)
Change-Id: I2f3757e2fe9d63e710f51469c650377165fd6631
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/ImageFormat.java | 27 | ||||
-rw-r--r-- | graphics/java/android/graphics/PixelFormat.java | 27 |
2 files changed, 53 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/ImageFormat.java b/graphics/java/android/graphics/ImageFormat.java index e08ed50..062acaf 100644 --- a/graphics/java/android/graphics/ImageFormat.java +++ b/graphics/java/android/graphics/ImageFormat.java @@ -253,4 +253,31 @@ public class ImageFormat { } return -1; } + + /** + * Determine whether or not this is a public-visible {@code format}. + * + * <p>In particular, {@code @hide} formats will return {@code false}.</p> + * + * <p>Any other formats (including UNKNOWN) will return {@code false}.</p> + * + * @param format an integer format + * @return a boolean + * + * @hide + */ + public static boolean isPublicFormat(int format) { + switch (format) { + case RGB_565: + case NV16: + case YUY2: + case YV12: + case NV21: + case YUV_420_888: + case RAW_SENSOR: + return true; + } + + return false; + } } diff --git a/graphics/java/android/graphics/PixelFormat.java b/graphics/java/android/graphics/PixelFormat.java index d96d6d8..832b9c3 100644 --- a/graphics/java/android/graphics/PixelFormat.java +++ b/graphics/java/android/graphics/PixelFormat.java @@ -115,7 +115,7 @@ public class PixelFormat info.bytesPerPixel = 1; break; default: - throw new IllegalArgumentException("unkonwon pixel format " + format); + throw new IllegalArgumentException("unknown pixel format " + format); } } @@ -135,4 +135,29 @@ public class PixelFormat public int bytesPerPixel; public int bitsPerPixel; + + /** + * Determine whether or not this is a public-visible and non-deprecated {@code format}. + * + * <p>In particular, {@code @hide} formats will return {@code false}.</p> + * + * <p>Any other indirect formats (such as {@code TRANSPARENT} or {@code TRANSLUCENT}) + * will return {@code false}.</p> + * + * @param format an integer format + * @return a boolean + * + * @hide + */ + public static boolean isPublicFormat(int format) { + switch (format) { + case RGBA_8888: + case RGBX_8888: + case RGB_888: + case RGB_565: + return true; + } + + return false; + } } |