blob: da343244523b6301a97e73b75f341a075c4290a4 [file] [log] [blame]
wangfei98428352015-04-02 10:41:27 +08001/*
2 * cl_wb_handler.h - CL white balance handler
3 *
4 * Copyright (c) 2015 Intel Corporation
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: wangfei <feix.w.wang@intel.com>
19 */
20
21#ifndef XCAM_CL_WB_HANLDER_H
22#define XCAM_CL_WB_HANLDER_H
23
24#include "xcam_utils.h"
25#include "cl_image_handler.h"
26#include "base/xcam_3a_result.h"
27
28namespace XCam {
29
30typedef struct {
31 float r_gain;
32 float gr_gain;
33 float gb_gain;
34 float b_gain;
35} CLWBConfig;
36
37class CLWbImageKernel
38 : public CLImageKernel
39{
40public:
41 explicit CLWbImageKernel (SmartPtr<CLContext> &context);
42 bool set_wb (CLWBConfig wb);
43
44protected:
45 virtual XCamReturn prepare_arguments (
46 SmartPtr<DrmBoBuffer> &input, SmartPtr<DrmBoBuffer> &output,
47 CLArgument args[], uint32_t &arg_count,
48 CLWorkSize &work_size);
49
50private:
51 XCAM_DEAD_COPY (CLWbImageKernel);
52 CLWBConfig _wb_config;
53};
54
55class CLWbImageHandler
56 : public CLImageHandler
57{
58public:
59 explicit CLWbImageHandler (const char *name);
60 bool set_wb_config (XCam3aResultWhiteBalance wb);
61 bool set_wb_kernel(SmartPtr<CLWbImageKernel> &kernel);
62
63private:
64 XCAM_DEAD_COPY (CLWbImageHandler);
65 SmartPtr<CLWbImageKernel> _wb_kernel;
66};
67
68SmartPtr<CLImageHandler>
69create_cl_wb_image_handler (SmartPtr<CLContext> &context);
70
71};
72
73#endif //XCAM_CL_WB_HANLDER_H