diff options
author | 2019-02-19 15:52:08 -0800 | |
---|---|---|
committer | 2019-02-20 10:48:04 -0800 | |
commit | e7c158f1148ddd774e33a33ff3db216726b04f5c (patch) | |
tree | afdbee9e88dcb4724792cfb93932575ece92fb48 /graphics/java | |
parent | fee9bcf89b89ace5a096b247c015d28cb0e342b5 (diff) |
Add annotations for ImageReader/ImageWriter factory methods
Test: make update-api && make
Bug: 124766727
Change-Id: I7f7c5afd013370ab6e42c28b96b3cfa93e8dc615
Diffstat (limited to 'graphics/java')
-rw-r--r-- | graphics/java/android/graphics/ImageFormat.java | 40 |
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: |