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