• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * cl_tonemapping_handler.h - CL tonemapping 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: Wu Junkai <junkai.wu@intel.com>
19  */
20 
21 #ifndef XCAM_CL_TONEMAPPING_HANLDER_H
22 #define XCAM_CL_TONEMAPPING_HANLDER_H
23 
24 #include <xcam_std.h>
25 #include <x3a_stats_pool.h>
26 #include <ocl/cl_image_handler.h>
27 #include <ocl/cl_bayer_basic_handler.h>
28 
29 namespace XCam {
30 
31 class CLTonemappingImageKernel
32     : public CLImageKernel
33 {
34 public:
35     explicit CLTonemappingImageKernel (
36         const SmartPtr<CLContext> &context, const char *name);
37 };
38 
39 class CLTonemappingImageHandler
40     : public CLImageHandler
41 {
42 public:
43     explicit CLTonemappingImageHandler (const SmartPtr<CLContext> &context, const char *name);
44     bool set_tonemapping_kernel(SmartPtr<CLTonemappingImageKernel> &kernel);
45     bool set_wb_config (const XCam3aResultWhiteBalance &wb);
46 
47 protected:
48     virtual XCamReturn prepare_buffer_pool_video_info (
49         const VideoBufferInfo &input, VideoBufferInfo &output);
50     virtual XCamReturn prepare_parameters (
51         SmartPtr<VideoBuffer> &input, SmartPtr<VideoBuffer> &output);
52 
53 private:
54     XCAM_DEAD_COPY (CLTonemappingImageHandler);
55     SmartPtr<CLTonemappingImageKernel>   _tonemapping_kernel;
56     int32_t                              _output_format;
57     CLWBConfig                           _wb_config;
58 };
59 
60 SmartPtr<CLImageHandler>
61 create_cl_tonemapping_image_handler (const SmartPtr<CLContext> &context);
62 
63 };
64 
65 #endif //XCAM_CL_TONEMAPPING_HANLDER_H
66