summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/hardware/camera2/CameraCharacteristics.java24
-rw-r--r--core/java/android/hardware/camera2/CaptureRequest.java16
-rw-r--r--core/java/android/hardware/camera2/CaptureResult.java16
-rw-r--r--docs/html/images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.pngbin0 -> 25603 bytes
-rw-r--r--docs/html/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.pngbin0 -> 33765 bytes
-rw-r--r--docs/html/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.pngbin0 -> 24914 bytes
-rw-r--r--docs/html/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.pngbin0 -> 23631 bytes
-rw-r--r--docs/html/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.pngbin0 -> 34913 bytes
-rw-r--r--graphics/java/android/graphics/drawable/RevealDrawable.java21
-rw-r--r--graphics/java/android/graphics/drawable/Ripple.java48
10 files changed, 86 insertions, 39 deletions
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java
index 2f55fc7e3f23..adc3a1eea39e 100644
--- a/core/java/android/hardware/camera2/CameraCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraCharacteristics.java
@@ -215,8 +215,15 @@ public final class CameraCharacteristics extends CameraMetadata {
new Key<byte[]>("android.control.availableEffects", byte[].class);
/**
- * <p>what subset of the scene mode enum list is
- * supported.</p>
+ * <p>List containing a subset of scene modes
+ * specified in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}.</p>
+ * <p>This list contains scene modes that can be set for the camera device.
+ * Only scene modes that have been fully implemented for the
+ * camera device may be included here. Implementations are not expected
+ * to be consistent across all devices. If no scene modes are supported
+ * by the camera device, this will be set to <code>[DISABLED]</code>.</p>
+ *
+ * @see CaptureRequest#CONTROL_SCENE_MODE
*/
public static final Key<byte[]> CONTROL_AVAILABLE_SCENE_MODES =
new Key<byte[]>("android.control.availableSceneModes", byte[].class);
@@ -309,11 +316,14 @@ public final class CameraCharacteristics extends CameraMetadata {
new Key<float[]>("android.lens.info.availableFilterDensities", float[].class);
/**
- * <p>If fitted with optical zoom, what focal
- * lengths are available. If not, the static focal
- * length</p>
- * <p>If optical zoom not supported, only one value
- * should be reported</p>
+ * <p>The available focal lengths for this device for use with
+ * {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}.</p>
+ * <p>If optical zoom is not supported, this will only report
+ * a single value corresponding to the static focal length of the
+ * device. Otherwise, this will report every focal length supported
+ * by the device.</p>
+ *
+ * @see CaptureRequest#LENS_FOCAL_LENGTH
*/
public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS =
new Key<float[]>("android.lens.info.availableFocalLengths", float[].class);
diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java
index fbc4e32ed86d..8f398de726bc 100644
--- a/core/java/android/hardware/camera2/CaptureRequest.java
+++ b/core/java/android/hardware/camera2/CaptureRequest.java
@@ -936,8 +936,20 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable {
new Key<Float>("android.lens.filterDensity", float.class);
/**
- * <p>Lens optical zoom setting</p>
- * <p>Will not be supported on most devices.</p>
+ * <p>The current lens focal length; used for optical zoom.</p>
+ * <p>This setting controls the physical focal length of the camera
+ * device's lens. Changing the focal length changes the field of
+ * view of the camera device, and is usually used for optical zoom.</p>
+ * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
+ * setting won't be applied instantaneously, and it may take several
+ * frames before the lens can move to the requested focal length.
+ * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
+ * be set to MOVING.</p>
+ * <p>This is expected not to be supported on most devices.</p>
+ *
+ * @see CaptureRequest#LENS_APERTURE
+ * @see CaptureRequest#LENS_FOCUS_DISTANCE
+ * @see CaptureResult#LENS_STATE
*/
public static final Key<Float> LENS_FOCAL_LENGTH =
new Key<Float>("android.lens.focalLength", float.class);
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index aa12d5e8c52c..999014288842 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -1097,8 +1097,20 @@ public final class CaptureResult extends CameraMetadata {
new Key<Float>("android.lens.filterDensity", float.class);
/**
- * <p>Lens optical zoom setting</p>
- * <p>Will not be supported on most devices.</p>
+ * <p>The current lens focal length; used for optical zoom.</p>
+ * <p>This setting controls the physical focal length of the camera
+ * device's lens. Changing the focal length changes the field of
+ * view of the camera device, and is usually used for optical zoom.</p>
+ * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
+ * setting won't be applied instantaneously, and it may take several
+ * frames before the lens can move to the requested focal length.
+ * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
+ * be set to MOVING.</p>
+ * <p>This is expected not to be supported on most devices.</p>
+ *
+ * @see CaptureRequest#LENS_APERTURE
+ * @see CaptureRequest#LENS_FOCUS_DISTANCE
+ * @see CaptureResult#LENS_STATE
*/
public static final Key<Float> LENS_FOCAL_LENGTH =
new Key<Float>("android.lens.focalLength", float.class);
diff --git a/docs/html/images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png b/docs/html/images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png
new file mode 100644
index 000000000000..7578b48770fb
--- /dev/null
+++ b/docs/html/images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png
Binary files differ
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
new file mode 100644
index 000000000000..ec89e37ec2b9
--- /dev/null
+++ b/docs/html/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png
Binary files 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
new file mode 100644
index 000000000000..cf0c63ddda42
--- /dev/null
+++ b/docs/html/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png
Binary files 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
new file mode 100644
index 000000000000..f226a548633e
--- /dev/null
+++ b/docs/html/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png
Binary files 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
new file mode 100644
index 000000000000..ded0645a48ca
--- /dev/null
+++ b/docs/html/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png
Binary files differ
diff --git a/graphics/java/android/graphics/drawable/RevealDrawable.java b/graphics/java/android/graphics/drawable/RevealDrawable.java
index c357ae1487a2..38765e8f7cc9 100644
--- a/graphics/java/android/graphics/drawable/RevealDrawable.java
+++ b/graphics/java/android/graphics/drawable/RevealDrawable.java
@@ -18,6 +18,7 @@ package android.graphics.drawable;
import android.content.res.Resources;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
@@ -248,6 +249,7 @@ public class RevealDrawable extends LayerDrawable {
}
// Draw ripple mask into a buffer that merges using SRC_OVER.
+ boolean needsMask = false;
int layerSaveCount = -1;
int n = activeRipples.size();
for (int i = 0; i < n; i++) {
@@ -261,7 +263,7 @@ public class RevealDrawable extends LayerDrawable {
layerSaveCount = canvas.saveLayer(0, 0, width, height, null, 0);
}
- ripple.draw(canvas, mRipplePaint);
+ needsMask |= ripple.draw(canvas, mRipplePaint);
}
}
@@ -269,15 +271,18 @@ public class RevealDrawable extends LayerDrawable {
// into another layer and composite using SRC_IN, then composite onto
// the original canvas.
if (layerSaveCount >= 0) {
- if (mMaskingPaint == null) {
- mMaskingPaint = new Paint();
- mMaskingPaint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
+ if (needsMask) {
+ if (mMaskingPaint == null) {
+ mMaskingPaint = new Paint();
+ mMaskingPaint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
+ }
+
+ // TODO: When Drawable.setXfermode() is supported by all drawables,
+ // we won't need an extra layer.
+ canvas.saveLayer(0, 0, width, height, mMaskingPaint, 0);
+ getDrawable(1).draw(canvas);
}
- // TODO: When Drawable.setXfermode() is supported by all drawables,
- // we won't need an extra layer.
- canvas.saveLayer(0, 0, width, height, mMaskingPaint, 0);
- getDrawable(1).draw(canvas);
canvas.restoreToCount(layerSaveCount);
}
}
diff --git a/graphics/java/android/graphics/drawable/Ripple.java b/graphics/java/android/graphics/drawable/Ripple.java
index 6378cb73a9c7..543d2a6493ea 100644
--- a/graphics/java/android/graphics/drawable/Ripple.java
+++ b/graphics/java/android/graphics/drawable/Ripple.java
@@ -160,7 +160,7 @@ class Ripple {
}
}
- public void draw(Canvas c, Paint p) {
+ public boolean draw(Canvas c, Paint p) {
final Rect bounds = mBounds;
final Rect padding = mPadding;
final float dX = Math.max(mX, bounds.right - mX);
@@ -221,26 +221,34 @@ class Ripple {
}
}
- if (exitState <= 0) {
- // Exit state isn't showing, so we can simplify to a solid
- // circle.
- if (outerRadius > 0) {
- p.setAlpha(maxAlpha);
- p.setStyle(Style.FILL);
- c.drawCircle(x, y, outerRadius, p);
- }
- } else {
- // Both states are showing, so we need a circular stroke.
- final float innerRadius = MathUtils.lerp(0, outerRadius, exitState);
- final float strokeWidth = outerRadius - innerRadius;
- if (strokeWidth > 0) {
- final float strokeRadius = innerRadius + strokeWidth / 2f;
- final int alpha = (int) (MathUtils.lerp(maxAlpha, 0, exitState) + 0.5f);
- p.setAlpha(alpha);
- p.setStyle(Style.STROKE);
- p.setStrokeWidth(strokeWidth);
- c.drawCircle(x, y, strokeRadius, p);
+ if (maxAlpha > 0) {
+ if (exitState <= 0) {
+ // Exit state isn't showing, so we can simplify to a solid
+ // circle.
+ if (outerRadius > 0) {
+ p.setAlpha(maxAlpha);
+ p.setStyle(Style.FILL);
+ c.drawCircle(x, y, outerRadius, p);
+ return true;
+ }
+ } else {
+ // Both states are showing, so we need a circular stroke.
+ final float innerRadius = MathUtils.lerp(0, outerRadius, exitState);
+ final float strokeWidth = outerRadius - innerRadius;
+ if (strokeWidth > 0) {
+ final float strokeRadius = innerRadius + strokeWidth / 2f;
+ final int alpha = (int) (MathUtils.lerp(maxAlpha, 0, exitState) + 0.5f);
+ if (alpha > 0) {
+ p.setAlpha(alpha);
+ p.setStyle(Style.STROKE);
+ p.setStrokeWidth(strokeWidth);
+ c.drawCircle(x, y, strokeRadius, p);
+ return true;
+ }
+ }
}
}
+
+ return false;
}
}