From a8d36036f2e75707f595d5ae1c18f20de9f0c176 Mon Sep 17 00:00:00 2001
From: Shuzhen Wang
Possible values: *
Optional - This value may be {@code null} on some devices.
*Full capability -
@@ -2688,6 +2691,8 @@ public final class CameraCharacteristics extends CameraMetadata
Starting from Android Q, this key will not be present for a MONOCHROME camera, even if + * the camera device has RAW capability.
*Possible values: *
Starting from Android Q, this key will not be present for a MONOCHROME camera, even if + * the camera device has RAW capability.
*Range of valid values:
* Any value listed in {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}
Optional - This value may be {@code null} on some devices.
@@ -3006,6 +3015,8 @@ public final class CameraCharacteristics extends CameraMetadataStarting from Android Q, this key will not be present for a MONOCHROME camera, even if + * the camera device has RAW capability.
*Optional - This value may be {@code null} on some devices.
*Permission {@link android.Manifest.permission#CAMERA } is needed to access this property
* @@ -3029,6 +3040,8 @@ public final class CameraCharacteristics extends CameraMetadataThis matrix will only be present if the second reference * illuminant is present.
+ *Starting from Android Q, this key will not be present for a MONOCHROME camera, even if + * the camera device has RAW capability.
*Optional - This value may be {@code null} on some devices.
*Permission {@link android.Manifest.permission#CAMERA } is needed to access this property
* @@ -3053,6 +3066,8 @@ public final class CameraCharacteristics extends CameraMetadataStarting from Android Q, this key will not be present for a MONOCHROME camera, even if + * the camera device has RAW capability.
*Optional - This value may be {@code null} on some devices.
*Permission {@link android.Manifest.permission#CAMERA } is needed to access this property
* @@ -3079,6 +3094,8 @@ public final class CameraCharacteristics extends CameraMetadataThis matrix will only be present if the second reference * illuminant is present.
+ *Starting from Android Q, this key will not be present for a MONOCHROME camera, even if + * the camera device has RAW capability.
*Optional - This value may be {@code null} on some devices.
*Permission {@link android.Manifest.permission#CAMERA } is needed to access this property
* @@ -3101,6 +3118,8 @@ public final class CameraCharacteristics extends CameraMetadataStarting from Android Q, this key will not be present for a MONOCHROME camera, even if + * the camera device has RAW capability.
*Optional - This value may be {@code null} on some devices.
*Permission {@link android.Manifest.permission#CAMERA } is needed to access this property
* @@ -3125,6 +3144,8 @@ public final class CameraCharacteristics extends CameraMetadataThis matrix will only be present if the second reference * illuminant is present.
+ *Starting from Android Q, this key will not be present for a MONOCHROME camera, even if + * the camera device has RAW capability.
*Optional - This value may be {@code null} on some devices.
*Permission {@link android.Manifest.permission#CAMERA } is needed to access this property
* @@ -3153,6 +3174,7 @@ public final class CameraCharacteristics extends CameraMetadataFor a MONOCHROME camera device, all of the 2x2 channels must have the same values.
*Range of valid values:
* >= 0 for each.
Optional - This value may be {@code null} on some devices.
diff --git a/core/java/android/hardware/camera2/CameraDevice.java b/core/java/android/hardware/camera2/CameraDevice.java index ac00f1488b14..dc6cffc4ebee 100644 --- a/core/java/android/hardware/camera2/CameraDevice.java +++ b/core/java/android/hardware/camera2/CameraDevice.java @@ -357,7 +357,7 @@ public abstract class CameraDevice implements AutoCloseable { * * *MONOCHROME-capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES} - * includes {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME MONOCHROME}) + * includes {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME MONOCHROME}) devices * supporting {@link android.graphics.ImageFormat#Y8 Y8} support substituting {@code YUV} * streams with {@code Y8} in all guaranteed stream combinations for the device's hardware level * and capabilities.
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java index ffc22641f025..402472af65a3 100644 --- a/core/java/android/hardware/camera2/CameraMetadata.java +++ b/core/java/android/hardware/camera2/CameraMetadata.java @@ -880,11 +880,15 @@ public abstract class CameraMetadataThe camera device is a monochrome camera that doesn't contain a color filter array, - * and the pixel values on U and V planes are all 128.
+ * and for YUV_420_888 stream, the pixel values on U and V planes are all 128. *A MONOCHROME camera must support the guaranteed stream combinations required for * its device level and capabilities. Additionally, if the monochrome camera device * supports Y8 format, all mandatory stream combination requirements related to {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888} apply - * to {@link android.graphics.ImageFormat#Y8 Y8} as well.
+ * to {@link android.graphics.ImageFormat#Y8 Y8} as well. There are no + * mandatory stream combination requirements with regard to + * {@link android.graphics.ImageFormat#Y8 Y8} for Bayer camera devices. + *Starting from Android Q, the SENSOR_INFO_COLOR_FILTER_ARRANGEMENT of a MONOCHROME + * camera will be either MONO or NIR.
* @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES */ public static final int REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME = 12; @@ -937,6 +941,23 @@ public abstract class CameraMetadataSensor doesn't have any Bayer color filter. + * Such sensor captures visible light in monochrome. The exact weighting and + * wavelengths captured is not specified, but generally only includes the visible + * frequencies. This value implies a MONOCHROME camera.
+ * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT + */ + public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_MONO = 5; + + /** + *Sensor has a near infrared filter capturing light with wavelength between + * roughly 750nm and 1400nm, and the same filter covers the whole sensor array. This + * value implies a MONOCHROME camera.
+ * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT + */ + public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_NIR = 6; + // // Enumeration values for CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE // diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java index 2744e9111509..8ebaf2f7db44 100644 --- a/core/java/android/hardware/camera2/CaptureRequest.java +++ b/core/java/android/hardware/camera2/CaptureRequest.java @@ -24,8 +24,8 @@ import android.hardware.camera2.impl.PublicKey; import android.hardware.camera2.impl.SyntheticKey; import android.hardware.camera2.params.OutputConfiguration; import android.hardware.camera2.utils.HashCodeHelpers; -import android.hardware.camera2.utils.TypeReference; import android.hardware.camera2.utils.SurfaceUtils; +import android.hardware.camera2.utils.TypeReference; import android.os.Parcel; import android.os.Parcelable; import android.util.ArraySet; @@ -2947,8 +2947,8 @@ public final class CaptureRequest extends CameraMetadataFor devices with MONOCHROME capability, only red channel is used. Green and blue channels - * are ignored.
+ *For devices with MONOCHROME capability, all three channels must have the same set of + * control points.
*A few examples, and their corresponding graphical mappings; these * only specify the red channel and the precision is limited to 4 * digits, for conciseness.
@@ -3011,8 +3011,8 @@ public final class CaptureRequest extends CameraMetadataFor devices with MONOCHROME capability, only red channel is used. Green and blue channels - * are ignored.
+ *For devices with MONOCHROME capability, all three channels must have the same set of + * control points.
*A few examples, and their corresponding graphical mappings; these * only specify the red channel and the precision is limited to 4 * digits, for conciseness.
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index 2b67f3e6adcb..3d70c516b577 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -3417,6 +3417,8 @@ public class CaptureResult extends CameraMetadataThe order of the values is R, G, B; where R is in the lowest index.
+ *Starting from Android Q, this key will not be present for a MONOCHROME camera, even if + * the camera device has RAW capability.
*Optional - This value may be {@code null} on some devices.
*/ @PublicKey @@ -3442,6 +3444,8 @@ public class CaptureResult extends CameraMetadataA more detailed description of the noise model can be found in the * Adobe DNG specification for the NoiseProfile tag.
+ *For a MONOCHROME camera, there is only one color channel. So the noise model coefficients + * will only contain one S and one O.
*Optional - This value may be {@code null} on some devices.
* * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT @@ -3482,6 +3486,8 @@ public class CaptureResult extends CameraMetadataStarting from Android Q, this key will not be present for a MONOCHROME camera, even if + * the camera device has RAW capability.
*Range of valid values:
>= 0
*Optional - This value may be {@code null} on some devices.
@@ -3592,6 +3598,7 @@ public class CaptureResult extends CameraMetadataFor a MONOCHROME camera, all of the 2x2 channels must have the same values.
*This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is available or the * camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.
*Range of valid values: As a visualization only, inverting the full-color map to recover an
* image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives: For a MONOCHROME camera, all of the 2x2 channels must have the same values. An example
+ * shading map for such a camera is defined as: Range of valid values: Optional - This value may be {@code null} on some devices.
@@ -3852,6 +3859,17 @@ public class CaptureResult extends CameraMetadata
* android.lens.info.shadingMapSize = [ 4, 3 ]
+ * android.statistics.lensShadingMap =
+ * [ 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
+ * 1.1, 1.1, 1.1, 1.1, 1.3, 1.3, 1.3, 1.3,
+ * 1.2, 1.2, 1.2, 1.2, 1.1, 1.1, 1.1, 1.1,
+ * 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.2, 1.2,
+ * 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
+ * 1.2, 1.2, 1.2, 1.2, 1.3, 1.3, 1.3, 1.3 ]
+ *
* Each gain factor is >= 1
The channel order is [R, Geven, Godd, B], where Geven is the green - * channel for the even rows of a Bayer pattern, and Godd is the odd rows. + *
For a Bayer camera, the channel order is [R, Geven, Godd, B], where Geven is + * the green channel for the even rows of a Bayer pattern, and Godd is the odd rows. * The shading map is stored in a fully interleaved format, and its size * is provided in the camera static metadata by android.lens.info.shadingMapSize.
*The shading map will generally have on the order of 30-40 rows and columns, * and will be smaller than 64x64.
- *As an example, given a very small map defined as:
+ *As an example, given a very small map for a Bayer camera defined as:
*android.lens.info.shadingMapSize = [ 4, 3 ]
* android.statistics.lensShadingMap =
* [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
@@ -3920,6 +3938,17 @@ public class CaptureResult extends CameraMetadata> {
* image of a gray wall (using bicubic interpolation for visual quality)
* as captured by the sensor gives:
* 
+ * For a MONOCHROME camera, all of the 2x2 channels must have the same values. An example
+ * shading map for such a camera is defined as:
+ * android.lens.info.shadingMapSize = [ 4, 3 ]
+ * android.statistics.lensShadingMap =
+ * [ 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
+ * 1.1, 1.1, 1.1, 1.1, 1.3, 1.3, 1.3, 1.3,
+ * 1.2, 1.2, 1.2, 1.2, 1.1, 1.1, 1.1, 1.1,
+ * 1.0, 1.0, 1.0, 1.0, 1.2, 1.2, 1.2, 1.2,
+ * 1.3, 1.3, 1.3, 1.3, 1.2, 1.2, 1.2, 1.2,
+ * 1.2, 1.2, 1.2, 1.2, 1.3, 1.3, 1.3, 1.3 ]
+ *
* Note that the RAW image data might be subject to lens shading
* correction not reported on this map. Query
* {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject
@@ -4250,8 +4279,8 @@ public class CaptureResult extends CameraMetadata> {
* of points can be less than max (that is, the request doesn't have to
* always provide a curve with number of points equivalent to
* {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).
- * For devices with MONOCHROME capability, only red channel is used. Green and blue channels
- * are ignored.
+ * For devices with MONOCHROME capability, all three channels must have the same set of
+ * control points.
* A few examples, and their corresponding graphical mappings; these
* only specify the red channel and the precision is limited to 4
* digits, for conciseness.
@@ -4314,8 +4343,8 @@ public class CaptureResult extends CameraMetadata> {
* of points can be less than max (that is, the request doesn't have to
* always provide a curve with number of points equivalent to
* {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).
- * For devices with MONOCHROME capability, only red channel is used. Green and blue channels
- * are ignored.
+ * For devices with MONOCHROME capability, all three channels must have the same set of
+ * control points.
* A few examples, and their corresponding graphical mappings; these
* only specify the red channel and the precision is limited to 4
* digits, for conciseness.
diff --git a/core/java/android/hardware/camera2/params/BlackLevelPattern.java b/core/java/android/hardware/camera2/params/BlackLevelPattern.java
index 6d6c094ebf04..283977fecbd5 100644
--- a/core/java/android/hardware/camera2/params/BlackLevelPattern.java
+++ b/core/java/android/hardware/camera2/params/BlackLevelPattern.java
@@ -16,13 +16,17 @@
package android.hardware.camera2.params;
-import java.util.Arrays;
-
import static com.android.internal.util.Preconditions.checkNotNull;
+import java.util.Arrays;
+
/**
* Immutable class to store a 4-element vector of integers corresponding to a 2x2 pattern
* of color channel offsets used for the black level offsets of each color channel.
+ *
+ * For a camera device with
+ * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME
+ * MONOCHROME} capability, all 4 elements of the pattern will have the same value.
*/
public final class BlackLevelPattern {
@@ -133,6 +137,12 @@ public final class BlackLevelPattern {
* {@link android.hardware.camera2.CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT}).
*
*
+ * A {@link
+ * android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME
+ * MONOCHROME} camera only has one channel. As a result, the returned string will contain 4
+ * identical values.
+ *
+ *
* @return string representation of {@link BlackLevelPattern}
*
* @see android.hardware.camera2.CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
diff --git a/core/java/android/hardware/camera2/params/TonemapCurve.java b/core/java/android/hardware/camera2/params/TonemapCurve.java
index 71e68a5271c2..90e63556f018 100644
--- a/core/java/android/hardware/camera2/params/TonemapCurve.java
+++ b/core/java/android/hardware/camera2/params/TonemapCurve.java
@@ -34,6 +34,10 @@ import java.util.Arrays;
* use as the tonemapping/contrast/gamma curve when {@link CaptureRequest#TONEMAP_MODE} is
* set to {@link CameraMetadata#TONEMAP_MODE_CONTRAST_CURVE}.
*
+ * For a camera device with
+ * {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME
+ * MONOCHROME} capability, all 3 channels will contain the same set of control points.
+ *
*
The total number of points {@code (Pin, Pout)} for each color channel can be no more than
* {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS}.
*
--
cgit v1.2.3