Blame view

3rdparty/opencv-4.5.4/modules/imgproc/src/precomp.hpp 4.18 KB
f4334277   Hu Chunming   提交3rdparty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
  /*M///////////////////////////////////////////////////////////////////////////////////////
  //
  //  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
  //
  //  By downloading, copying, installing or using the software you agree to this license.
  //  If you do not agree to this license, do not download, install,
  //  copy or use the software.
  //
  //
  //                          License Agreement
  //                For Open Source Computer Vision Library
  //
  // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
  // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
  // Third party copyrights are property of their respective owners.
  //
  // Redistribution and use in source and binary forms, with or without modification,
  // are permitted provided that the following conditions are met:
  //
  //   * Redistribution's of source code must retain the above copyright notice,
  //     this list of conditions and the following disclaimer.
  //
  //   * Redistribution's in binary form must reproduce the above copyright notice,
  //     this list of conditions and the following disclaimer in the documentation
  //     and/or other materials provided with the distribution.
  //
  //   * The name of the copyright holders may not be used to endorse or promote products
  //     derived from this software without specific prior written permission.
  //
  // This software is provided by the copyright holders and contributors "as is" and
  // any express or implied warranties, including, but not limited to, the implied
  // warranties of merchantability and fitness for a particular purpose are disclaimed.
  // In no event shall the Intel Corporation or contributors be liable for any direct,
  // indirect, incidental, special, exemplary, or consequential damages
  // (including, but not limited to, procurement of substitute goods or services;
  // loss of use, data, or profits; or business interruption) however caused
  // and on any theory of liability, whether in contract, strict liability,
  // or tort (including negligence or otherwise) arising in any way out of
  // the use of this software, even if advised of the possibility of such damage.
  //
  //M*/
  
  #ifndef __OPENCV_PRECOMP_H__
  #define __OPENCV_PRECOMP_H__
  
  #include "opencv2/imgproc.hpp"
  #include "opencv2/core/utility.hpp"
  
  #include "opencv2/imgproc/imgproc_c.h"
  #include "opencv2/core/private.hpp"
  #include "opencv2/core/ocl.hpp"
  #include "opencv2/core/hal/hal.hpp"
  #include "opencv2/imgproc/hal/hal.hpp"
  #include "hal_replacement.hpp"
  
  #include <math.h>
  #include <assert.h>
  #include <string.h>
  #include <stdlib.h>
  #include <stdio.h>
  #include <limits.h>
  #include <float.h>
  
  #define GET_OPTIMIZED(func) (func)
  
  /* helper tables */
  extern const uchar icvSaturate8u_cv[];
  #define CV_FAST_CAST_8U(t)  ( (-256 <= (t) && (t) <= 512) ? icvSaturate8u_cv[(t)+256] : 0 )
  #define CV_CALC_MIN_8U(a,b) (a) -= CV_FAST_CAST_8U((a) - (b))
  #define CV_CALC_MAX_8U(a,b) (a) += CV_FAST_CAST_8U((b) - (a))
  
  // -256.f ... 511.f
  extern const float icv8x32fTab_cv[];
  #define CV_8TO32F(x)  icv8x32fTab_cv[(x)+256]
  
  // (-128.f)^2 ... (255.f)^2
  extern const float icv8x32fSqrTab[];
  #define CV_8TO32F_SQR(x)  icv8x32fSqrTab[(x)+128]
  
  #define  CV_COPY( dst, src, len, idx ) \
      for( (idx) = 0; (idx) < (len); (idx)++) (dst)[idx] = (src)[idx]
  
  #define  CV_SET( dst, val, len, idx )  \
      for( (idx) = 0; (idx) < (len); (idx)++) (dst)[idx] = (val)
  
  #undef   CV_CALC_MIN
  #define  CV_CALC_MIN(a, b) if((a) > (b)) (a) = (b)
  
  #undef   CV_CALC_MAX
  #define  CV_CALC_MAX(a, b) if((a) < (b)) (a) = (b)
  
  #ifdef HAVE_IPP
  static inline IppiInterpolationType ippiGetInterpolation(int inter)
  {
      inter &= cv::INTER_MAX;
      return inter == cv::INTER_NEAREST ? ippNearest :
          inter == cv::INTER_LINEAR ? ippLinear :
          inter == cv::INTER_CUBIC ? ippCubic :
          inter == cv::INTER_LANCZOS4 ? ippLanczos :
          inter == cv::INTER_AREA ? ippSuper :
          (IppiInterpolationType)-1;
  }
  #endif
  
  #include "_geom.h"
  #include "filterengine.hpp"
  
  #include "opencv2/core/sse_utils.hpp"
  
  inline bool isStorageOrMat(void * arr)
  {
      if (CV_IS_STORAGE( arr ))
          return true;
      else if (CV_IS_MAT( arr ))
          return false;
      CV_Error( CV_StsBadArg, "Destination is not CvMemStorage* nor CvMat*" );
  }
  
  #endif /*__OPENCV_CV_INTERNAL_H_*/