Loading core/java/android/hardware/camera2/params/StreamConfigurationMap.java +7 −0 Original line number Diff line number Diff line Loading @@ -1112,6 +1112,8 @@ public final class StreamConfigurationMap { return ImageFormat.DEPTH_POINT_CLOUD; case HAL_PIXEL_FORMAT_Y16: return ImageFormat.DEPTH16; case HAL_PIXEL_FORMAT_RAW16: return ImageFormat.RAW_DEPTH; case ImageFormat.JPEG: throw new IllegalArgumentException( "ImageFormat.JPEG is an unknown internal format"); Loading Loading @@ -1179,6 +1181,8 @@ public final class StreamConfigurationMap { return HAL_PIXEL_FORMAT_BLOB; case ImageFormat.DEPTH16: return HAL_PIXEL_FORMAT_Y16; case ImageFormat.RAW_DEPTH: return HAL_PIXEL_FORMAT_RAW16; default: return format; } Loading Loading @@ -1220,6 +1224,7 @@ public final class StreamConfigurationMap { return HAL_DATASPACE_V0_JFIF; case ImageFormat.DEPTH_POINT_CLOUD: case ImageFormat.DEPTH16: case ImageFormat.RAW_DEPTH: return HAL_DATASPACE_DEPTH; default: return HAL_DATASPACE_UNKNOWN; Loading Loading @@ -1609,6 +1614,8 @@ public final class StreamConfigurationMap { return "DEPTH16"; case ImageFormat.DEPTH_POINT_CLOUD: return "DEPTH_POINT_CLOUD"; case ImageFormat.RAW_DEPTH: return "RAW_DEPTH"; case ImageFormat.PRIVATE: return "PRIVATE"; default: Loading core/jni/android_view_Surface.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ int android_view_Surface_mapPublicFormatToHalFormat(PublicFormat f) { case PublicFormat::DEPTH16: return HAL_PIXEL_FORMAT_Y16; case PublicFormat::RAW_SENSOR: case PublicFormat::RAW_DEPTH: return HAL_PIXEL_FORMAT_RAW16; default: // Most formats map 1:1 Loading @@ -149,6 +150,7 @@ android_dataspace android_view_Surface_mapPublicFormatToHalDataspace( return HAL_DATASPACE_V0_JFIF; case PublicFormat::DEPTH_POINT_CLOUD: case PublicFormat::DEPTH16: case PublicFormat::RAW_DEPTH: return HAL_DATASPACE_DEPTH; case PublicFormat::RAW_SENSOR: case PublicFormat::RAW_PRIVATE: Loading Loading @@ -182,8 +184,12 @@ PublicFormat android_view_Surface_mapHalFormatDataspaceToPublicFormat( // Enums overlap in both name and value return static_cast<PublicFormat>(format); case HAL_PIXEL_FORMAT_RAW16: // Name differs, though value is the same switch (dataSpace) { case HAL_DATASPACE_DEPTH: return PublicFormat::RAW_DEPTH; default: return PublicFormat::RAW_SENSOR; } case HAL_PIXEL_FORMAT_RAW_OPAQUE: // Name differs, though value is the same return PublicFormat::RAW_PRIVATE; Loading core/jni/include/android_runtime/android_view_Surface.h +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ enum class PublicFormat { RGBA_1010102 = 0x2b, JPEG = 0x100, DEPTH_POINT_CLOUD = 0x101, RAW_DEPTH = 0x1002, // @hide YV12 = 0x32315659, Y8 = 0x20203859, // @hide Y16 = 0x20363159, // @hide Loading graphics/java/android/graphics/ImageFormat.java +11 −0 Original line number Diff line number Diff line Loading @@ -661,6 +661,15 @@ public class ImageFormat { */ public static final int DEPTH_POINT_CLOUD = 0x101; /** * Unprocessed implementation-dependent raw * depth measurements, opaque with 16 bit * samples. * * @hide */ public static final int RAW_DEPTH = 0x1002; /** * Android private opaque image format. * <p> Loading Loading @@ -723,6 +732,7 @@ public class ImageFormat { return 24; case FLEX_RGBA_8888: return 32; case RAW_DEPTH: case RAW_SENSOR: return 16; case RAW10: Loading Loading @@ -765,6 +775,7 @@ public class ImageFormat { case DEPTH16: case DEPTH_POINT_CLOUD: case PRIVATE: case RAW_DEPTH: return true; } Loading media/java/android/media/ImageUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ class ImageUtils { case ImageFormat.RAW12: case ImageFormat.DEPTH16: case ImageFormat.DEPTH_POINT_CLOUD: case ImageFormat.RAW_DEPTH: return 1; case ImageFormat.PRIVATE: return 0; Loading Loading @@ -103,6 +104,10 @@ class ImageUtils { throw new IllegalArgumentException( "Copy of RAW_OPAQUE format has not been implemented"); } if (src.getFormat() == ImageFormat.RAW_DEPTH) { throw new IllegalArgumentException( "Copy of RAW_DEPTH 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"); Loading Loading @@ -206,6 +211,7 @@ class ImageUtils { case PixelFormat.RGB_565: case ImageFormat.YUY2: case ImageFormat.Y16: case ImageFormat.RAW_DEPTH: case ImageFormat.RAW_SENSOR: case ImageFormat.RAW_PRIVATE: // round estimate, real size is unknown case ImageFormat.DEPTH16: Loading Loading @@ -253,6 +259,7 @@ class ImageUtils { case ImageFormat.RAW_SENSOR: case ImageFormat.RAW10: case ImageFormat.RAW12: case ImageFormat.RAW_DEPTH: return new Size(image.getWidth(), image.getHeight()); case ImageFormat.PRIVATE: return new Size(0, 0); Loading Loading
core/java/android/hardware/camera2/params/StreamConfigurationMap.java +7 −0 Original line number Diff line number Diff line Loading @@ -1112,6 +1112,8 @@ public final class StreamConfigurationMap { return ImageFormat.DEPTH_POINT_CLOUD; case HAL_PIXEL_FORMAT_Y16: return ImageFormat.DEPTH16; case HAL_PIXEL_FORMAT_RAW16: return ImageFormat.RAW_DEPTH; case ImageFormat.JPEG: throw new IllegalArgumentException( "ImageFormat.JPEG is an unknown internal format"); Loading Loading @@ -1179,6 +1181,8 @@ public final class StreamConfigurationMap { return HAL_PIXEL_FORMAT_BLOB; case ImageFormat.DEPTH16: return HAL_PIXEL_FORMAT_Y16; case ImageFormat.RAW_DEPTH: return HAL_PIXEL_FORMAT_RAW16; default: return format; } Loading Loading @@ -1220,6 +1224,7 @@ public final class StreamConfigurationMap { return HAL_DATASPACE_V0_JFIF; case ImageFormat.DEPTH_POINT_CLOUD: case ImageFormat.DEPTH16: case ImageFormat.RAW_DEPTH: return HAL_DATASPACE_DEPTH; default: return HAL_DATASPACE_UNKNOWN; Loading Loading @@ -1609,6 +1614,8 @@ public final class StreamConfigurationMap { return "DEPTH16"; case ImageFormat.DEPTH_POINT_CLOUD: return "DEPTH_POINT_CLOUD"; case ImageFormat.RAW_DEPTH: return "RAW_DEPTH"; case ImageFormat.PRIVATE: return "PRIVATE"; default: Loading
core/jni/android_view_Surface.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -135,6 +135,7 @@ int android_view_Surface_mapPublicFormatToHalFormat(PublicFormat f) { case PublicFormat::DEPTH16: return HAL_PIXEL_FORMAT_Y16; case PublicFormat::RAW_SENSOR: case PublicFormat::RAW_DEPTH: return HAL_PIXEL_FORMAT_RAW16; default: // Most formats map 1:1 Loading @@ -149,6 +150,7 @@ android_dataspace android_view_Surface_mapPublicFormatToHalDataspace( return HAL_DATASPACE_V0_JFIF; case PublicFormat::DEPTH_POINT_CLOUD: case PublicFormat::DEPTH16: case PublicFormat::RAW_DEPTH: return HAL_DATASPACE_DEPTH; case PublicFormat::RAW_SENSOR: case PublicFormat::RAW_PRIVATE: Loading Loading @@ -182,8 +184,12 @@ PublicFormat android_view_Surface_mapHalFormatDataspaceToPublicFormat( // Enums overlap in both name and value return static_cast<PublicFormat>(format); case HAL_PIXEL_FORMAT_RAW16: // Name differs, though value is the same switch (dataSpace) { case HAL_DATASPACE_DEPTH: return PublicFormat::RAW_DEPTH; default: return PublicFormat::RAW_SENSOR; } case HAL_PIXEL_FORMAT_RAW_OPAQUE: // Name differs, though value is the same return PublicFormat::RAW_PRIVATE; Loading
core/jni/include/android_runtime/android_view_Surface.h +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ enum class PublicFormat { RGBA_1010102 = 0x2b, JPEG = 0x100, DEPTH_POINT_CLOUD = 0x101, RAW_DEPTH = 0x1002, // @hide YV12 = 0x32315659, Y8 = 0x20203859, // @hide Y16 = 0x20363159, // @hide Loading
graphics/java/android/graphics/ImageFormat.java +11 −0 Original line number Diff line number Diff line Loading @@ -661,6 +661,15 @@ public class ImageFormat { */ public static final int DEPTH_POINT_CLOUD = 0x101; /** * Unprocessed implementation-dependent raw * depth measurements, opaque with 16 bit * samples. * * @hide */ public static final int RAW_DEPTH = 0x1002; /** * Android private opaque image format. * <p> Loading Loading @@ -723,6 +732,7 @@ public class ImageFormat { return 24; case FLEX_RGBA_8888: return 32; case RAW_DEPTH: case RAW_SENSOR: return 16; case RAW10: Loading Loading @@ -765,6 +775,7 @@ public class ImageFormat { case DEPTH16: case DEPTH_POINT_CLOUD: case PRIVATE: case RAW_DEPTH: return true; } Loading
media/java/android/media/ImageUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ class ImageUtils { case ImageFormat.RAW12: case ImageFormat.DEPTH16: case ImageFormat.DEPTH_POINT_CLOUD: case ImageFormat.RAW_DEPTH: return 1; case ImageFormat.PRIVATE: return 0; Loading Loading @@ -103,6 +104,10 @@ class ImageUtils { throw new IllegalArgumentException( "Copy of RAW_OPAQUE format has not been implemented"); } if (src.getFormat() == ImageFormat.RAW_DEPTH) { throw new IllegalArgumentException( "Copy of RAW_DEPTH 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"); Loading Loading @@ -206,6 +211,7 @@ class ImageUtils { case PixelFormat.RGB_565: case ImageFormat.YUY2: case ImageFormat.Y16: case ImageFormat.RAW_DEPTH: case ImageFormat.RAW_SENSOR: case ImageFormat.RAW_PRIVATE: // round estimate, real size is unknown case ImageFormat.DEPTH16: Loading Loading @@ -253,6 +259,7 @@ class ImageUtils { case ImageFormat.RAW_SENSOR: case ImageFormat.RAW10: case ImageFormat.RAW12: case ImageFormat.RAW_DEPTH: return new Size(image.getWidth(), image.getHeight()); case ImageFormat.PRIVATE: return new Size(0, 0); Loading