From 956c52b5a09fa6b193b162bdb3aee629323cde2b Mon Sep 17 00:00:00 2001 From: Yin-Chia Yeh Date: Fri, 6 Feb 2015 11:23:25 -0800 Subject: Camera2: doc update for HAL3.3 tonemapping change Codegen doc change. Change-Id: Idd5185767c177f3179e5833be3f42357a5ead25f --- api/current.txt | 8 ++++ api/system-current.txt | 8 ++++ .../hardware/camera2/CameraCharacteristics.java | 9 +++- .../android/hardware/camera2/CameraMetadata.java | 53 ++++++++++++++++++++- .../android/hardware/camera2/CaptureRequest.java | 50 +++++++++++++++++++ .../android/hardware/camera2/CaptureResult.java | 50 +++++++++++++++++++ .../android.tonemap.curveRed/gamma_tonemap.png | Bin 33765 -> 31494 bytes .../android.tonemap.curveRed/inverse_tonemap.png | Bin 24914 -> 22690 bytes .../android.tonemap.curveRed/linear_tonemap.png | Bin 23631 -> 21822 bytes .../android.tonemap.curveRed/rec709_tonemap.png | Bin 0 -> 32384 bytes .../android.tonemap.curveRed/srgb_tonemap.png | Bin 34913 -> 32315 bytes 11 files changed, 174 insertions(+), 4 deletions(-) create mode 100644 docs/html/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png diff --git a/api/current.txt b/api/current.txt index 1abcdb1..3d54693 100644 --- a/api/current.txt +++ b/api/current.txt @@ -13048,7 +13048,11 @@ package android.hardware.camera2 { field public static final int SYNC_MAX_LATENCY_UNKNOWN = -1; // 0xffffffff field public static final int TONEMAP_MODE_CONTRAST_CURVE = 0; // 0x0 field public static final int TONEMAP_MODE_FAST = 1; // 0x1 + field public static final int TONEMAP_MODE_GAMMA_VALUE = 3; // 0x3 field public static final int TONEMAP_MODE_HIGH_QUALITY = 2; // 0x2 + field public static final int TONEMAP_MODE_PRESET_CURVE = 4; // 0x4 + field public static final int TONEMAP_PRESET_CURVE_REC709 = 1; // 0x1 + field public static final int TONEMAP_PRESET_CURVE_SRGB = 0; // 0x0 } public class CaptureFailure { @@ -13116,7 +13120,9 @@ package android.hardware.camera2 { field public static final android.hardware.camera2.CaptureRequest.Key STATISTICS_HOT_PIXEL_MAP_MODE; field public static final android.hardware.camera2.CaptureRequest.Key STATISTICS_LENS_SHADING_MAP_MODE; field public static final android.hardware.camera2.CaptureRequest.Key TONEMAP_CURVE; + field public static final android.hardware.camera2.CaptureRequest.Key TONEMAP_GAMMA; field public static final android.hardware.camera2.CaptureRequest.Key TONEMAP_MODE; + field public static final android.hardware.camera2.CaptureRequest.Key TONEMAP_PRESET_CURVE; } public static final class CaptureRequest.Builder { @@ -13204,7 +13210,9 @@ package android.hardware.camera2 { field public static final android.hardware.camera2.CaptureResult.Key STATISTICS_LENS_SHADING_MAP_MODE; field public static final android.hardware.camera2.CaptureResult.Key STATISTICS_SCENE_FLICKER; field public static final android.hardware.camera2.CaptureResult.Key TONEMAP_CURVE; + field public static final android.hardware.camera2.CaptureResult.Key TONEMAP_GAMMA; field public static final android.hardware.camera2.CaptureResult.Key TONEMAP_MODE; + field public static final android.hardware.camera2.CaptureResult.Key TONEMAP_PRESET_CURVE; } public static final class CaptureResult.Key { diff --git a/api/system-current.txt b/api/system-current.txt index f74538f..0235bef 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -13318,7 +13318,11 @@ package android.hardware.camera2 { field public static final int SYNC_MAX_LATENCY_UNKNOWN = -1; // 0xffffffff field public static final int TONEMAP_MODE_CONTRAST_CURVE = 0; // 0x0 field public static final int TONEMAP_MODE_FAST = 1; // 0x1 + field public static final int TONEMAP_MODE_GAMMA_VALUE = 3; // 0x3 field public static final int TONEMAP_MODE_HIGH_QUALITY = 2; // 0x2 + field public static final int TONEMAP_MODE_PRESET_CURVE = 4; // 0x4 + field public static final int TONEMAP_PRESET_CURVE_REC709 = 1; // 0x1 + field public static final int TONEMAP_PRESET_CURVE_SRGB = 0; // 0x0 } public class CaptureFailure { @@ -13386,7 +13390,9 @@ package android.hardware.camera2 { field public static final android.hardware.camera2.CaptureRequest.Key STATISTICS_HOT_PIXEL_MAP_MODE; field public static final android.hardware.camera2.CaptureRequest.Key STATISTICS_LENS_SHADING_MAP_MODE; field public static final android.hardware.camera2.CaptureRequest.Key TONEMAP_CURVE; + field public static final android.hardware.camera2.CaptureRequest.Key TONEMAP_GAMMA; field public static final android.hardware.camera2.CaptureRequest.Key TONEMAP_MODE; + field public static final android.hardware.camera2.CaptureRequest.Key TONEMAP_PRESET_CURVE; } public static final class CaptureRequest.Builder { @@ -13474,7 +13480,9 @@ package android.hardware.camera2 { field public static final android.hardware.camera2.CaptureResult.Key STATISTICS_LENS_SHADING_MAP_MODE; field public static final android.hardware.camera2.CaptureResult.Key STATISTICS_SCENE_FLICKER; field public static final android.hardware.camera2.CaptureResult.Key TONEMAP_CURVE; + field public static final android.hardware.camera2.CaptureResult.Key TONEMAP_GAMMA; field public static final android.hardware.camera2.CaptureResult.Key TONEMAP_MODE; + field public static final android.hardware.camera2.CaptureResult.Key TONEMAP_PRESET_CURVE; } public static final class CaptureResult.Key { diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index bb45b91..4c3a4a6 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -2299,8 +2299,13 @@ public final class CameraCharacteristics extends CameraMetadataList of tonemapping modes for {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} that are supported by this camera * device.

- *

Camera devices that support the MANUAL_POST_PROCESSING capability will always list - * CONTRAST_CURVE and FAST. This includes all FULL level devices.

+ *

Camera devices that support the MANUAL_POST_PROCESSING capability will always contain + * at least one of below mode combinations:

+ *
    + *
  • CONTRAST_CURVE and FAST
  • + *
  • GAMMA_VALUE, PRESET_CURVE, and FAST
  • + *
+ *

This includes all FULL level devices.

*

Range of valid values:
* Any value listed in {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}

*

Optional - This value may be {@code null} on some devices.

diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java index af7d365..7d7f9b0 100644 --- a/core/java/android/hardware/camera2/CameraMetadata.java +++ b/core/java/android/hardware/camera2/CameraMetadata.java @@ -374,13 +374,19 @@ public abstract class CameraMetadata { * The camera device supports basic manual control of the image post-processing * stages. This means the following controls are guaranteed to be supported:

*
    - *
  • Manual tonemap control
      + *
    • + *

      Manual tonemap control

      + *
        *
      • {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}
      • *
      • {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
      • *
      • {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}
      • + *
      • {@link CaptureRequest#TONEMAP_GAMMA android.tonemap.gamma}
      • + *
      • {@link CaptureRequest#TONEMAP_PRESET_CURVE android.tonemap.presetCurve}
      • *
      *
    • - *
    • Manual white balance control
        + *
      • + *

        Manual white balance control

        + *
          *
        • {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
        • *
        • {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}
        • *
        @@ -410,8 +416,10 @@ public abstract class CameraMetadata { * @see CaptureRequest#SHADING_MODE * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE * @see CaptureRequest#TONEMAP_CURVE + * @see CaptureRequest#TONEMAP_GAMMA * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS * @see CaptureRequest#TONEMAP_MODE + * @see CaptureRequest#TONEMAP_PRESET_CURVE * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES */ public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2; @@ -2096,6 +2104,47 @@ public abstract class CameraMetadata { */ public static final int TONEMAP_MODE_HIGH_QUALITY = 2; + /** + *

        Use the gamma value specified in {@link CaptureRequest#TONEMAP_GAMMA android.tonemap.gamma} to peform + * tonemapping.

        + *

        All color enhancement and tonemapping must be disabled, except + * for applying the tonemapping curve specified by {@link CaptureRequest#TONEMAP_GAMMA android.tonemap.gamma}.

        + *

        Must not slow down frame rate relative to raw sensor output.

        + * + * @see CaptureRequest#TONEMAP_GAMMA + * @see CaptureRequest#TONEMAP_MODE + */ + public static final int TONEMAP_MODE_GAMMA_VALUE = 3; + + /** + *

        Use the preset tonemapping curve specified in + * {@link CaptureRequest#TONEMAP_PRESET_CURVE android.tonemap.presetCurve} to peform tonemapping.

        + *

        All color enhancement and tonemapping must be disabled, except + * for applying the tonemapping curve specified by + * {@link CaptureRequest#TONEMAP_PRESET_CURVE android.tonemap.presetCurve}.

        + *

        Must not slow down frame rate relative to raw sensor output.

        + * + * @see CaptureRequest#TONEMAP_PRESET_CURVE + * @see CaptureRequest#TONEMAP_MODE + */ + public static final int TONEMAP_MODE_PRESET_CURVE = 4; + + // + // Enumeration values for CaptureRequest#TONEMAP_PRESET_CURVE + // + + /** + *

        Tonemapping curve is defined by sRGB

        + * @see CaptureRequest#TONEMAP_PRESET_CURVE + */ + public static final int TONEMAP_PRESET_CURVE_SRGB = 0; + + /** + *

        Tonemapping curve is defined by ITU-R BT.709

        + * @see CaptureRequest#TONEMAP_PRESET_CURVE + */ + public static final int TONEMAP_PRESET_CURVE_REC709 = 1; + // // Enumeration values for CaptureResult#CONTROL_AE_STATE // diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java index e1b14cc..f157605 100644 --- a/core/java/android/hardware/camera2/CaptureRequest.java +++ b/core/java/android/hardware/camera2/CaptureRequest.java @@ -2352,6 +2352,8 @@ public final class CaptureRequest extends CameraMetadata> *
      • {@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}
      • *
      • {@link #TONEMAP_MODE_FAST FAST}
      • *
      • {@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}
      • + *
      • {@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}
      • + *
      • {@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}
      • *

      *

      Available values for this device:
      * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}

      @@ -2367,12 +2369,60 @@ public final class CaptureRequest extends CameraMetadata> * @see #TONEMAP_MODE_CONTRAST_CURVE * @see #TONEMAP_MODE_FAST * @see #TONEMAP_MODE_HIGH_QUALITY + * @see #TONEMAP_MODE_GAMMA_VALUE + * @see #TONEMAP_MODE_PRESET_CURVE */ @PublicKey public static final Key TONEMAP_MODE = new Key("android.tonemap.mode", int.class); /** + *

      Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is + * GAMMA_VALUE

      + *

      The tonemap curve will be defined the following formula: + * * OUT = pow(IN, 1.0 / gamma) + * where IN and OUT is the input pixel value scaled to range [0.0, 1.0], + * pow is the power function and gamma is the gamma value specified by this + * key.

      + *

      The same curve will be applied to all color channels. The camera device + * may clip the input gamma value to its supported range. The actual applied + * value will be returned in capture result.

      + *

      The valid range of gamma value varies on different devices, but values + * within [1.0, 5.0] are guaranteed not to be clipped.

      + *

      Optional - This value may be {@code null} on some devices.

      + * + * @see CaptureRequest#TONEMAP_MODE + */ + @PublicKey + public static final Key TONEMAP_GAMMA = + new Key("android.tonemap.gamma", float.class); + + /** + *

      Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is + * PRESET_CURVE

      + *

      The tonemap curve will be defined by specified standard.

      + *

      sRGB (approximated by 16 control points):

      + *

      sRGB tonemapping curve

      + *

      Rec. 709 (approximated by 16 control points):

      + *

      Rec. 709 tonemapping curve

      + *

      Note that above figures show a 16 control points approximation of preset + * curves. Camera devices may apply a different approximation to the curve.

      + *

      Possible values: + *

        + *
      • {@link #TONEMAP_PRESET_CURVE_SRGB SRGB}
      • + *
      • {@link #TONEMAP_PRESET_CURVE_REC709 REC709}
      • + *

      + *

      Optional - This value may be {@code null} on some devices.

      + * + * @see CaptureRequest#TONEMAP_MODE + * @see #TONEMAP_PRESET_CURVE_SRGB + * @see #TONEMAP_PRESET_CURVE_REC709 + */ + @PublicKey + public static final Key TONEMAP_PRESET_CURVE = + new Key("android.tonemap.presetCurve", int.class); + + /** *

      This LED is nominally used to indicate to the user * that the camera is powered on and may be streaming images back to the * Application Processor. In certain rare circumstances, the OS may diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index 5bf5b29..0011735 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -3543,6 +3543,8 @@ public class CaptureResult extends CameraMetadata> { *

    • {@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}
    • *
    • {@link #TONEMAP_MODE_FAST FAST}
    • *
    • {@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}
    • + *
    • {@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}
    • + *
    • {@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}
    • *

    *

    Available values for this device:
    * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}

    @@ -3558,12 +3560,60 @@ public class CaptureResult extends CameraMetadata> { * @see #TONEMAP_MODE_CONTRAST_CURVE * @see #TONEMAP_MODE_FAST * @see #TONEMAP_MODE_HIGH_QUALITY + * @see #TONEMAP_MODE_GAMMA_VALUE + * @see #TONEMAP_MODE_PRESET_CURVE */ @PublicKey public static final Key TONEMAP_MODE = new Key("android.tonemap.mode", int.class); /** + *

    Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is + * GAMMA_VALUE

    + *

    The tonemap curve will be defined the following formula: + * * OUT = pow(IN, 1.0 / gamma) + * where IN and OUT is the input pixel value scaled to range [0.0, 1.0], + * pow is the power function and gamma is the gamma value specified by this + * key.

    + *

    The same curve will be applied to all color channels. The camera device + * may clip the input gamma value to its supported range. The actual applied + * value will be returned in capture result.

    + *

    The valid range of gamma value varies on different devices, but values + * within [1.0, 5.0] are guaranteed not to be clipped.

    + *

    Optional - This value may be {@code null} on some devices.

    + * + * @see CaptureRequest#TONEMAP_MODE + */ + @PublicKey + public static final Key TONEMAP_GAMMA = + new Key("android.tonemap.gamma", float.class); + + /** + *

    Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is + * PRESET_CURVE

    + *

    The tonemap curve will be defined by specified standard.

    + *

    sRGB (approximated by 16 control points):

    + *

    sRGB tonemapping curve

    + *

    Rec. 709 (approximated by 16 control points):

    + *

    Rec. 709 tonemapping curve

    + *

    Note that above figures show a 16 control points approximation of preset + * curves. Camera devices may apply a different approximation to the curve.

    + *

    Possible values: + *

      + *
    • {@link #TONEMAP_PRESET_CURVE_SRGB SRGB}
    • + *
    • {@link #TONEMAP_PRESET_CURVE_REC709 REC709}
    • + *

    + *

    Optional - This value may be {@code null} on some devices.

    + * + * @see CaptureRequest#TONEMAP_MODE + * @see #TONEMAP_PRESET_CURVE_SRGB + * @see #TONEMAP_PRESET_CURVE_REC709 + */ + @PublicKey + public static final Key TONEMAP_PRESET_CURVE = + new Key("android.tonemap.presetCurve", int.class); + + /** *

    This LED is nominally used to indicate to the user * that the camera is powered on and may be streaming images back to the * Application Processor. In certain rare circumstances, the OS may diff --git a/docs/html/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png b/docs/html/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png index ec89e37..a02fd89 100644 Binary files a/docs/html/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png and b/docs/html/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png differ diff --git a/docs/html/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png b/docs/html/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png index cf0c63d..c309ac5 100644 Binary files a/docs/html/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png and b/docs/html/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png differ diff --git a/docs/html/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png b/docs/html/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png index f226a54..414fad4 100644 Binary files a/docs/html/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png and b/docs/html/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png differ diff --git a/docs/html/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png b/docs/html/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png new file mode 100644 index 0000000..c147a87 Binary files /dev/null and b/docs/html/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png differ diff --git a/docs/html/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png b/docs/html/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png index ded0645..4ce2125 100644 Binary files a/docs/html/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png and b/docs/html/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png differ -- cgit v1.1