Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2618b23c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add RAW_DEPTH10 image format"

parents 2192b22c 0173af01
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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:
+12 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ public class ImageFormat {
             DEPTH16,
             DEPTH_POINT_CLOUD,
             RAW_DEPTH,
             RAW_DEPTH10,
             PRIVATE,
             HEIC
     })
@@ -724,6 +725,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>
@@ -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:
+7 −0
Original line number Diff line number Diff line
@@ -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: