From cc073aac88a30dded339bc8809297fb78cc1b43a Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Thu, 7 Jun 2018 12:27:17 -0700 Subject: [PATCH] Camera: DistortionMapper: Move FACE_RECTANGLES to point list Face rectangles are actually a pair of points, not rects with (top, left, width, height). This is very silly but what can you do. Test: Check metadata output with forced-on distortion correction Bug: 74434422 Change-Id: I5c0ede9624a198f1dd68328c2dcfa6788ed2d9d9 --- .../camera/libcameraservice/device3/DistortionMapper.cpp | 6 +++--- services/camera/libcameraservice/device3/DistortionMapper.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/camera/libcameraservice/device3/DistortionMapper.cpp b/services/camera/libcameraservice/device3/DistortionMapper.cpp index 9229079717..9503d272b9 100644 --- a/services/camera/libcameraservice/device3/DistortionMapper.cpp +++ b/services/camera/libcameraservice/device3/DistortionMapper.cpp @@ -43,13 +43,13 @@ constexpr std::array DistortionMapper::kRequestRectsToCorrect = { }; // Only for capture result -constexpr std::array DistortionMapper::kResultRectsToCorrect = { +constexpr std::array DistortionMapper::kResultRectsToCorrect = { ANDROID_SCALER_CROP_REGION, - ANDROID_STATISTICS_FACE_RECTANGLES }; // Only for capture result -constexpr std::array DistortionMapper::kResultPointsToCorrect = { +constexpr std::array DistortionMapper::kResultPointsToCorrect = { + ANDROID_STATISTICS_FACE_RECTANGLES, // Says rectangles, is really points ANDROID_STATISTICS_FACE_LANDMARKS, }; diff --git a/services/camera/libcameraservice/device3/DistortionMapper.h b/services/camera/libcameraservice/device3/DistortionMapper.h index c6d715b5ae..271574ea28 100644 --- a/services/camera/libcameraservice/device3/DistortionMapper.h +++ b/services/camera/libcameraservice/device3/DistortionMapper.h @@ -148,10 +148,10 @@ class DistortionMapper { static const std::array kRequestRectsToCorrect; // Only capture result - static const std::array kResultRectsToCorrect; + static const std::array kResultRectsToCorrect; // Only for capture results - static const std::array kResultPointsToCorrect; + static const std::array kResultPointsToCorrect; // Utility to create reverse mapping grids status_t buildGrids();