Home | History | Annotate | Download | only in xcore
      1 /*
      2  * xcam_utils.h - xcam utilities
      3  *
      4  *  Copyright (c) 2014-2017 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 (at) intel.com>
     19  */
     20 
     21 #ifndef XCAM_UTILS_H
     22 #define XCAM_UTILS_H
     23 
     24 #include <xcam_std.h>
     25 #include <interface/data_types.h>
     26 
     27 namespace XCam {
     28 
     29 PointFloat2 bowl_view_coords_to_image (
     30     const BowlDataConfig &config,
     31     const PointFloat3 &bowl_pos,
     32     const uint32_t img_width, const uint32_t img_height);
     33 
     34 PointFloat3 bowl_view_image_to_world (
     35     const BowlDataConfig &config,
     36     const uint32_t img_width, const uint32_t img_height,
     37     const PointFloat2 &img_pos);
     38 
     39 void centralize_bowl_coord_from_cameras (
     40     ExtrinsicParameter &front_cam, ExtrinsicParameter &right_cam,
     41     ExtrinsicParameter &rear_cam, ExtrinsicParameter &left_cam,
     42     PointFloat3 &bowl_coord_offset);
     43 
     44 double
     45 linear_interpolate_p2 (
     46     double value_start, double value_end,
     47     double ref_start, double ref_end,
     48     double ref_curr);
     49 
     50 double
     51 linear_interpolate_p4(
     52     double value_lt, double value_rt,
     53     double value_lb, double value_rb,
     54     double ref_lt_x, double ref_rt_x,
     55     double ref_lb_x, double ref_rb_x,
     56     double ref_lt_y, double ref_rt_y,
     57     double ref_lb_y, double ref_rb_y,
     58     double ref_curr_x, double ref_curr_y);
     59 
     60 void get_gauss_table (
     61     uint32_t radius, float sigma, std::vector<float> &table, bool normalize = true);
     62 
     63 class VideoBuffer;
     64 void dump_buf_perfix_path (const SmartPtr<VideoBuffer> buf, const char *prefix_name);
     65 bool dump_video_buf (const SmartPtr<VideoBuffer> buf, const char *file_name);
     66 
     67 };
     68 
     69 #endif //XCAM_UTILS_H
     70