summaryrefslogtreecommitdiff
path: root/graphics/java
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2019-02-22 00:27:43 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-02-22 00:27:43 +0000
commit432b9640a667be9fff16d9e2253ade1be32ed33e (patch)
tree5d500da563060e75d4f8f45a8fe820fabb1b0685 /graphics/java
parent7a81c02723306c6f77b5240b2460dae5fe6f3b29 (diff)
parente7c158f1148ddd774e33a33ff3db216726b04f5c (diff)
Merge "Add annotations for ImageReader/ImageWriter factory methods"
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/ImageFormat.java40
1 files changed, 38 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/ImageFormat.java b/graphics/java/android/graphics/ImageFormat.java
index 62647741dcfa..15d855e9560c 100644
--- a/graphics/java/android/graphics/ImageFormat.java
+++ b/graphics/java/android/graphics/ImageFormat.java
@@ -16,7 +16,43 @@
package android.graphics;
+import android.annotation.IntDef;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
public class ImageFormat {
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {
+ UNKNOWN,
+ RGB_565,
+ YV12,
+ Y8,
+ Y16,
+ NV16,
+ NV21,
+ YUY2,
+ JPEG,
+ DEPTH_JPEG,
+ YUV_420_888,
+ YUV_422_888,
+ YUV_444_888,
+ FLEX_RGB_888,
+ FLEX_RGBA_8888,
+ RAW_SENSOR,
+ RAW_PRIVATE,
+ RAW10,
+ RAW12,
+ DEPTH16,
+ DEPTH_POINT_CLOUD,
+ RAW_DEPTH,
+ PRIVATE,
+ HEIC
+ })
+ public @interface Format {
+ }
+
/*
* these constants are chosen to be binary compatible with their previous
* location in PixelFormat.java
@@ -731,7 +767,7 @@ public class ImageFormat {
* @return the number of bits per pixel of the given format or -1 if the
* format doesn't exist or is not supported.
*/
- public static int getBitsPerPixel(int format) {
+ public static int getBitsPerPixel(@Format int format) {
switch (format) {
case RGB_565:
return 16;
@@ -781,7 +817,7 @@ public class ImageFormat {
*
* @hide
*/
- public static boolean isPublicFormat(int format) {
+ public static boolean isPublicFormat(@Format int format) {
switch (format) {
case RGB_565:
case NV16: