Home | History | Annotate | Download | only in ocl
      1 /*
      2  * cl_wavelet_denoise_handler.h - CL wavelet denoise 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: Wei Zong <wei.zong (at) intel.com>
     19  */
     20 
     21 #ifndef XCAM_CL_WAVELET_DENOISE_HANLDER_H
     22 #define XCAM_CL_WAVELET_DENOISE_HANLDER_H
     23 
     24 #include <xcam_std.h>
     25 #include <ocl/cl_image_handler.h>
     26 #include <base/xcam_3a_result.h>
     27 
     28 namespace XCam {
     29 
     30 class CLWaveletDenoiseImageHandler;
     31 
     32 class CLWaveletDenoiseImageKernel
     33     : public CLImageKernel
     34 {
     35 
     36 private:
     37 
     38 public:
     39     explicit CLWaveletDenoiseImageKernel (
     40         const SmartPtr<CLContext> &context,
     41         const char *name,
     42         SmartPtr<CLWaveletDenoiseImageHandler> &handler,
     43         uint32_t channel,
     44         uint32_t layer);
     45 
     46     virtual ~CLWaveletDenoiseImageKernel () {
     47     }
     48 
     49 protected:
     50     virtual XCamReturn prepare_arguments (
     51         CLArgList &args, CLWorkSize &work_size);
     52 
     53 private:
     54     uint32_t  _channel;
     55     uint32_t  _current_layer;
     56 
     57     SmartPtr<CLWaveletDenoiseImageHandler> _handler;
     58 };
     59 
     60 class CLWaveletDenoiseImageHandler
     61     : public CLImageHandler
     62 {
     63 public:
     64     explicit CLWaveletDenoiseImageHandler (const SmartPtr<CLContext> &context, const char *name);
     65 
     66     bool set_denoise_config (const XCam3aResultWaveletNoiseReduction& config);
     67     XCam3aResultWaveletNoiseReduction& get_denoise_config () {
     68         return _config;
     69     };
     70 
     71     SmartPtr<CLMemory> &get_details_image () {
     72         return _details_image;
     73     };
     74 
     75     SmartPtr<CLMemory> &get_approx_image () {
     76         return _approx_image;
     77     };
     78 
     79 protected:
     80     virtual XCamReturn prepare_output_buf (SmartPtr<VideoBuffer> &input, SmartPtr<VideoBuffer> &output);
     81 
     82 private:
     83     XCam3aResultWaveletNoiseReduction _config;
     84     SmartPtr<CLMemory> _details_image;
     85     SmartPtr<CLMemory> _approx_image;
     86 };
     87 
     88 SmartPtr<CLImageHandler>
     89 create_cl_wavelet_denoise_image_handler (const SmartPtr<CLContext> &context, uint32_t channel);
     90 
     91 };
     92 
     93 #endif //XCAM_CL_WAVELET_DENOISE_HANLDER_H
     94