1 /* 2 * x3a_analyzer_simple.h - a simple 3a analyzer 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: Wind Yuan <feng.yuan@intel.com> 19 */ 20 21 #ifndef XCAM_3A_ANALYZER_SIMPLE_H 22 #define XCAM_3A_ANALYZER_SIMPLE_H 23 24 #include <xcam_std.h> 25 #include <x3a_analyzer.h> 26 #include <x3a_stats_pool.h> 27 28 namespace XCam { 29 30 class X3aAnalyzerSimple 31 : public X3aAnalyzer 32 { 33 public: 34 explicit X3aAnalyzerSimple (); 35 ~X3aAnalyzerSimple (); 36 37 private: 38 39 XCAM_DEAD_COPY (X3aAnalyzerSimple); 40 41 protected: 42 virtual SmartPtr<AeHandler> create_ae_handler (); 43 virtual SmartPtr<AwbHandler> create_awb_handler (); 44 virtual SmartPtr<AfHandler> create_af_handler (); 45 virtual SmartPtr<CommonHandler> create_common_handler (); 46 internal_init(uint32_t width,uint32_t height,double framerate)47 virtual XCamReturn internal_init (uint32_t width, uint32_t height, double framerate) { 48 XCAM_UNUSED (width); 49 XCAM_UNUSED (height); 50 XCAM_UNUSED (framerate); 51 return XCAM_RETURN_NO_ERROR; 52 } internal_deinit()53 virtual XCamReturn internal_deinit () { 54 _is_ae_started = false; 55 _ae_calculation_interval = 0; 56 return XCAM_RETURN_NO_ERROR; 57 } 58 virtual XCamReturn configure_3a (); 59 virtual XCamReturn pre_3a_analyze (SmartPtr<X3aStats> &stats); 60 virtual XCamReturn post_3a_analyze (X3aResultList &results); 61 62 public: 63 XCamReturn analyze_ae (X3aResultList &output); 64 XCamReturn analyze_awb (X3aResultList &output); 65 XCamReturn analyze_af (X3aResultList &output); 66 67 private: 68 SmartPtr<X3aStats> _current_stats; 69 double _last_target_exposure; 70 bool _is_ae_started; 71 uint32_t _ae_calculation_interval; 72 }; 73 74 }; 75 #endif //XCAM_3A_ANALYZER_SIMPLE_H 76 77