1 /* 2 * IspParamsSplitter.h - Split ISP params to Left/Right ISP params 3 * 4 * Copyright (c) 2021 Rockchip Electronics Co., Ltd 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 * Author: Cody Xie <cody.xie@rock-chips.com> 19 */ 20 #ifndef __COMMON_HWI_ISP_PARAMS_SPLITTER_H__ 21 #define __COMMON_HWI_ISP_PARAMS_SPLITTER_H__ 22 23 #include "xcam_common.h" 24 #include "xcam_log.h" 25 26 27 namespace RkCam { 28 29 class IspParamsSplitter { 30 public: 31 struct Rectangle { 32 uint32_t x; 33 uint32_t y; 34 uint32_t w; 35 uint32_t h; 36 }; 37 38 IspParamsSplitter() = default; 39 ~IspParamsSplitter() = default; 40 IspParamsSplitter(const IspParamsSplitter&) = delete; 41 IspParamsSplitter& operator=(const IspParamsSplitter&) = delete; 42 43 IspParamsSplitter& SetPicInfo(IspParamsSplitter::Rectangle&& pic_rect); 44 IspParamsSplitter& SetLeftIspRect(IspParamsSplitter::Rectangle&& left_isp_rect); 45 IspParamsSplitter& SetRightIspRect(IspParamsSplitter::Rectangle&& right_isp_rect); 46 IspParamsSplitter& SetPicInfo(IspParamsSplitter::Rectangle& pic_rect); 47 IspParamsSplitter& SetLeftIspRect(IspParamsSplitter::Rectangle& left_isp_rect); 48 IspParamsSplitter& SetRightIspRect(IspParamsSplitter::Rectangle& right_isp_rect); 49 const IspParamsSplitter::Rectangle& GetPicInfo() const; 50 const IspParamsSplitter::Rectangle& GetLeftIspRect() const; 51 const IspParamsSplitter::Rectangle& GetRightIspRect() const; 52 53 template <typename U> 54 XCamReturn SplitIspParams(U* orig_isp_params, U* isp_params); 55 56 private: 57 //ae 58 template <typename U> 59 XCamReturn SplitAecParams(U* ori, U* left, U* right); 60 template <typename U> 61 XCamReturn SplitRawHistLiteParams(U* ori, U* left, U* right); 62 template <typename U> 63 XCamReturn SplitRawHistBigParams(U* ori, U* left, U* right); 64 template <typename U> 65 XCamReturn SplitRawAeLiteParams(U* ori, U* left, U* right); 66 template <typename U> 67 XCamReturn SplitRawAeBigParams(U* ori, U* left, U* right); 68 69 //awb 70 template <typename U> 71 XCamReturn SplitAwbParams(U* ori, U* left, U* right); 72 template <typename U> 73 XCamReturn SplitAfParams(U* ori, U* left, U* right); 74 // LSC 75 template <typename U> 76 XCamReturn SplitAlscParams(U* ori, U* left, U* right); 77 78 79 Rectangle pic_rect_; 80 Rectangle left_isp_rect_; 81 Rectangle right_isp_rect_; 82 }; 83 84 } // namespace RkCam 85 86 #endif // __COMMON_HWI_ISP_PARAMS_SPLITTER_H__ 87