summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/api1/client2/Parameters.h
diff options
context:
space:
mode:
authorChien-Yu Chen <cychen@google.com>2014-11-13 13:41:23 -0800
committerChien-Yu Chen <cychen@google.com>2014-11-13 14:54:57 -0800
commit5e15b80e801a0110bc1bad1190f02cb9c7d22e37 (patch)
tree3a4bb1ea7edcad06d5a5895f31fa395df4bfdbe2 /services/camera/libcameraservice/api1/client2/Parameters.h
parent745602d87607521f4fe84c4f3a6388fbdb6a867c (diff)
downloadframeworks_av-5e15b80e801a0110bc1bad1190f02cb9c7d22e37.zip
frameworks_av-5e15b80e801a0110bc1bad1190f02cb9c7d22e37.tar.gz
frameworks_av-5e15b80e801a0110bc1bad1190f02cb9c7d22e37.tar.bz2
CameraService: normalize face rectangles properly
Use android.scaler.cropRegion reported in the capture result to normalize face rectangles instead of using the one in current capture request. Bug: 11460393 Change-Id: Id21834bf6ae1f7cc106b4dffb98f9f249a75034b
Diffstat (limited to 'services/camera/libcameraservice/api1/client2/Parameters.h')
-rw-r--r--services/camera/libcameraservice/api1/client2/Parameters.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/services/camera/libcameraservice/api1/client2/Parameters.h b/services/camera/libcameraservice/api1/client2/Parameters.h
index 815cc55..389cb92 100644
--- a/services/camera/libcameraservice/api1/client2/Parameters.h
+++ b/services/camera/libcameraservice/api1/client2/Parameters.h
@@ -325,13 +325,17 @@ struct Parameters {
// Note that this doesn't apply to the (deprecated) single FPS value.
static const int kFpsToApiScale = 1000;
- // Transform between (-1000,-1000)-(1000,1000) normalized coords from camera
- // API and HAL2 (0,0)-(activePixelArray.width/height) coordinates
- int arrayXToNormalized(int width) const;
- int arrayYToNormalized(int height) const;
+ // Transform from (-1000,-1000)-(1000,1000) normalized coords from camera
+ // API to HAL2 (0,0)-(activePixelArray.width/height) coordinates
int normalizedXToArray(int x) const;
int normalizedYToArray(int y) const;
+ // Transform from HAL3 (0,0)-(activePixelArray.width/height) coordinates to
+ // (-1000,-1000)-(1000,1000) normalized coordinates given a scaler crop
+ // region.
+ int arrayXToNormalizedWithCrop(int x, const CropRegion &scalerCrop) const;
+ int arrayYToNormalizedWithCrop(int y, const CropRegion &scalerCrop) const;
+
struct Range {
int min;
int max;
@@ -341,20 +345,20 @@ struct Parameters {
private:
- // Convert between HAL2 sensor array coordinates and
- // viewfinder crop-region relative array coordinates
+ // Convert from viewfinder crop-region relative array coordinates
+ // to HAL2 sensor array coordinates
int cropXToArray(int x) const;
int cropYToArray(int y) const;
- int arrayXToCrop(int x) const;
- int arrayYToCrop(int y) const;
- // Convert between viewfinder crop-region relative array coordinates
- // and camera API (-1000,1000)-(1000,1000) normalized coords
- int cropXToNormalized(int x) const;
- int cropYToNormalized(int y) const;
+ // Convert from camera API (-1000,1000)-(1000,1000) normalized coords
+ // to viewfinder crop-region relative array coordinates
int normalizedXToCrop(int x) const;
int normalizedYToCrop(int y) const;
+ // Given a scaler crop region, calculate preview crop region based on
+ // preview aspect ratio.
+ CropRegion calculatePreviewCrop(const CropRegion &scalerCrop) const;
+
Vector<Size> availablePreviewSizes;
Vector<Size> availableVideoSizes;
// Get size list (that are no larger than limit) from static metadata.