summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2020-09-15 00:10:31 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-09-15 00:10:31 +0000
commit2618b23c8903504b5727ba5b6ece9e690dabf7f8 (patch)
tree5856b66f3b5feab1269e60912db1174c205f97cc
parent2192b22cf2aa9d57f6621910c58d8bf159320661 (diff)
parent0173af0189dff7f9b04d19300ce7bf5d84e24389 (diff)
Merge "Add RAW_DEPTH10 image format"
-rw-r--r--core/java/android/hardware/camera2/params/StreamConfigurationMap.java7
-rw-r--r--graphics/java/android/graphics/ImageFormat.java12
-rw-r--r--media/java/android/media/ImageUtils.java7
3 files changed, 26 insertions, 0 deletions
diff --git a/core/java/android/hardware/camera2/params/StreamConfigurationMap.java b/core/java/android/hardware/camera2/params/StreamConfigurationMap.java
index 52251ba90b98..9d32a809fe0d 100644
--- a/core/java/android/hardware/camera2/params/StreamConfigurationMap.java
+++ b/core/java/android/hardware/camera2/params/StreamConfigurationMap.java
@@ -1320,6 +1320,8 @@ public final class StreamConfigurationMap {
return ImageFormat.DEPTH16;
case HAL_PIXEL_FORMAT_RAW16:
return ImageFormat.RAW_DEPTH;
+ case HAL_PIXEL_FORMAT_RAW10:
+ return ImageFormat.RAW_DEPTH10;
case ImageFormat.JPEG:
throw new IllegalArgumentException(
"ImageFormat.JPEG is an unknown internal format");
@@ -1393,6 +1395,8 @@ public final class StreamConfigurationMap {
return HAL_PIXEL_FORMAT_Y16;
case ImageFormat.RAW_DEPTH:
return HAL_PIXEL_FORMAT_RAW16;
+ case ImageFormat.RAW_DEPTH10:
+ return HAL_PIXEL_FORMAT_RAW10;
default:
return format;
}
@@ -1437,6 +1441,7 @@ public final class StreamConfigurationMap {
case ImageFormat.DEPTH_POINT_CLOUD:
case ImageFormat.DEPTH16:
case ImageFormat.RAW_DEPTH:
+ case ImageFormat.RAW_DEPTH10:
return HAL_DATASPACE_DEPTH;
case ImageFormat.DEPTH_JPEG:
return HAL_DATASPACE_DYNAMIC_DEPTH;
@@ -1878,6 +1883,8 @@ public final class StreamConfigurationMap {
return "DEPTH_JPEG";
case ImageFormat.RAW_DEPTH:
return "RAW_DEPTH";
+ case ImageFormat.RAW_DEPTH10:
+ return "RAW_DEPTH10";
case ImageFormat.PRIVATE:
return "PRIVATE";
case ImageFormat.HEIC:
diff --git a/graphics/java/android/graphics/ImageFormat.java b/graphics/java/android/graphics/ImageFormat.java
index 15d855e9560c..a7d3f7980d37 100644
--- a/graphics/java/android/graphics/ImageFormat.java
+++ b/graphics/java/android/graphics/ImageFormat.java
@@ -47,6 +47,7 @@ public class ImageFormat {
DEPTH16,
DEPTH_POINT_CLOUD,
RAW_DEPTH,
+ RAW_DEPTH10,
PRIVATE,
HEIC
})
@@ -725,6 +726,15 @@ public class ImageFormat {
public static final int RAW_DEPTH = 0x1002;
/**
+ * Unprocessed implementation-dependent raw
+ * depth measurements, opaque with 10 bit
+ * samples and device specific bit layout.
+ *
+ * @hide
+ */
+ public static final int RAW_DEPTH10 = 0x1003;
+
+ /**
* Android private opaque image format.
* <p>
* The choices of the actual format and pixel data layout are entirely up to
@@ -797,6 +807,7 @@ public class ImageFormat {
case RAW_DEPTH:
case RAW_SENSOR:
return 16;
+ case RAW_DEPTH10:
case RAW10:
return 10;
case RAW12:
@@ -838,6 +849,7 @@ public class ImageFormat {
case DEPTH_POINT_CLOUD:
case PRIVATE:
case RAW_DEPTH:
+ case RAW_DEPTH10:
case Y8:
case DEPTH_JPEG:
case HEIC:
diff --git a/media/java/android/media/ImageUtils.java b/media/java/android/media/ImageUtils.java
index d8a0bb334c53..d248f61f03ca 100644
--- a/media/java/android/media/ImageUtils.java
+++ b/media/java/android/media/ImageUtils.java
@@ -63,6 +63,7 @@ class ImageUtils {
case ImageFormat.DEPTH16:
case ImageFormat.DEPTH_POINT_CLOUD:
case ImageFormat.RAW_DEPTH:
+ case ImageFormat.RAW_DEPTH10:
case ImageFormat.DEPTH_JPEG:
case ImageFormat.HEIC:
return 1;
@@ -110,6 +111,10 @@ class ImageUtils {
throw new IllegalArgumentException(
"Copy of RAW_DEPTH format has not been implemented");
}
+ if (src.getFormat() == ImageFormat.RAW_DEPTH10) {
+ throw new IllegalArgumentException(
+ "Copy of RAW_DEPTH10 format has not been implemented");
+ }
if (!(dst.getOwner() instanceof ImageWriter)) {
throw new IllegalArgumentException("Destination image is not from ImageWriter. Only"
+ " the images from ImageWriter are writable");
@@ -202,6 +207,7 @@ class ImageUtils {
estimatedBytePerPixel = 1.0;
break;
case ImageFormat.RAW10:
+ case ImageFormat.RAW_DEPTH10:
estimatedBytePerPixel = 1.25;
break;
case ImageFormat.YV12:
@@ -264,6 +270,7 @@ class ImageUtils {
case ImageFormat.RAW10:
case ImageFormat.RAW12:
case ImageFormat.RAW_DEPTH:
+ case ImageFormat.RAW_DEPTH10:
case ImageFormat.HEIC:
return new Size(image.getWidth(), image.getHeight());
case ImageFormat.PRIVATE: