1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef ANDROID_SERVERS_COORDINATEMAPPER_H 18 #define ANDROID_SERVERS_COORDINATEMAPPER_H 19 20 #include <array> 21 #include <set> 22 23 namespace android { 24 25 namespace camera3 { 26 27 class CoordinateMapper { 28 public: 29 // The result metadata tags that are to be re-mapped getRemappedKeys()30 const std::set<uint32_t>& getRemappedKeys() const { 31 return mRemappedKeys; 32 } 33 34 virtual ~CoordinateMapper() = default; 35 36 protected: 37 // Metadata tags containing 2D coordinates to be corrected. 38 39 // Both capture request and result 40 static const std::array<uint32_t, 3> kMeteringRegionsToCorrect; 41 42 // Both capture request and result 43 static const std::array<uint32_t, 1> kRectsToCorrect; 44 45 // Only for capture results; don't clamp 46 static const std::array<uint32_t, 2> kResultPointsToCorrectNoClamp; 47 48 virtual void initRemappedKeys() = 0; 49 std::set<uint32_t> mRemappedKeys; 50 51 }; // class CoordinateMapper 52 53 } // namespace camera3 54 55 } // namespace android 56 57 #endif 58