1 /* 2 * cl_rgb_pipe_handler.h - CL rgb pipe 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: Shincy Tu <shincy.tu@intel.com> 19 * Author: Wei Zong <wei.zong@intel.com> 20 * Author: Wangfei <feix.w.wang@intel.com> 21 */ 22 23 #ifndef XCAM_CL_RGB_PIPE_HANLDER_H 24 #define XCAM_CL_RGB_PIPE_HANLDER_H 25 26 #include <xcam_std.h> 27 #include <ocl/cl_image_handler.h> 28 29 namespace XCam { 30 31 typedef struct { 32 float thr_r; 33 float thr_g; 34 float thr_b; 35 float gain; 36 } CLRgbPipeTnrConfig; 37 38 class CLRgbPipeImageKernel 39 : public CLImageKernel 40 { 41 public: 42 explicit CLRgbPipeImageKernel (const SmartPtr<CLContext> &context); 43 }; 44 45 class CLRgbPipeImageHandler 46 : public CLImageHandler 47 { 48 typedef std::list<SmartPtr<CLImage>> CLImagePtrList; 49 public: 50 explicit CLRgbPipeImageHandler (const SmartPtr<CLContext> &context, const char *name); 51 bool set_rgb_pipe_kernel (SmartPtr<CLRgbPipeImageKernel> &kernel); 52 bool set_tnr_config (const XCam3aResultTemporalNoiseReduction& config); 53 54 protected: 55 virtual XCamReturn prepare_parameters ( 56 SmartPtr<VideoBuffer> &input, SmartPtr<VideoBuffer> &output); 57 58 private: 59 SmartPtr<CLRgbPipeImageKernel> _rgb_pipe_kernel; 60 CLRgbPipeTnrConfig _tnr_config; 61 CLImagePtrList _image_in_list; 62 }; 63 64 SmartPtr<CLImageHandler> 65 create_cl_rgb_pipe_image_handler (const SmartPtr<CLContext> &context); 66 67 }; 68 69 #endif //XCAM_CL_RGB_PIPE_HANLDER_H 70