1/*M///////////////////////////////////////////////////////////////////////////////////////
2//
3// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4//
5// By downloading, copying, installing or using the software you agree to this license.
6// If you do not agree to this license, do not download, install,
7// copy or use the software.
8//
9//
10// License Agreement
11// For Open Source Computer Vision Library
12//
13// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
16// Third party copyrights are property of their respective owners.
17//
18// Redistribution and use in source and binary forms, with or without modification,
19// are permitted provided that the following conditions are met:
20//
21// * Redistribution's of source code must retain the above copyright notice,
22// this list of conditions and the following disclaimer.
23//
24// * Redistribution's in binary form must reproduce the above copyright notice,
25// this list of conditions and the following disclaimer in the documentation
26// and/or other materials provided with the distribution.
27//
28// * The name of the copyright holders may not be used to endorse or promote products
29// derived from this software without specific prior written permission.
30//
31// This software is provided by the copyright holders and contributors "as is" and
32// any express or implied warranties, including, but not limited to, the implied
33// warranties of merchantability and fitness for a particular purpose are disclaimed.
34// In no event shall the Intel Corporation or contributors be liable for any direct,
35// indirect, incidental, special, exemplary, or consequential damages
36// (including, but not limited to, procurement of substitute goods or services;
37// loss of use, data, or profits; or business interruption) however caused
38// and on any theory of liability, whether in contract, strict liability,
39// or tort (including negligence or otherwise) arising in any way out of
40// the use of this software, even if advised of the possibility of such damage.
41//
42//M*/
43
44#ifndef OPENCV_CORE_MATX_HPP
45#define OPENCV_CORE_MATX_HPP
46
47#ifndef __cplusplus
48# error matx.hpp header must be compiled as C++
49#endif
50
51#include "opencv2/core/cvdef.h"
52#include "opencv2/core/base.hpp"
53#include "opencv2/core/traits.hpp"
54#include "opencv2/core/saturate.hpp"
55
56#include <initializer_list>
57
58namespace cv
59{
60
61//! @addtogroup core_basic
62//! @{
63
64//! @cond IGNORED
65// FIXIT Remove this (especially CV_EXPORTS modifier)
66struct CV_EXPORTS Matx_AddOp { Matx_AddOp() {} Matx_AddOp(const Matx_AddOp&) {} };
67struct CV_EXPORTS Matx_SubOp { Matx_SubOp() {} Matx_SubOp(const Matx_SubOp&) {} };
68struct CV_EXPORTS Matx_ScaleOp { Matx_ScaleOp() {} Matx_ScaleOp(const Matx_ScaleOp&) {} };
69struct CV_EXPORTS Matx_MulOp { Matx_MulOp() {} Matx_MulOp(const Matx_MulOp&) {} };
70struct CV_EXPORTS Matx_DivOp { Matx_DivOp() {} Matx_DivOp(const Matx_DivOp&) {} };
71struct CV_EXPORTS Matx_MatMulOp { Matx_MatMulOp() {} Matx_MatMulOp(const Matx_MatMulOp&) {} };
72struct CV_EXPORTS Matx_TOp { Matx_TOp() {} Matx_TOp(const Matx_TOp&) {} };
73//! @endcond
74
75////////////////////////////// Small Matrix ///////////////////////////
76
77/** @brief Template class for small matrices whose type and size are known at compilation time
78
79If you need a more flexible type, use Mat . The elements of the matrix M are accessible using the
80M(i,j) notation. Most of the common matrix operations (see also @ref MatrixExpressions ) are
81available. To do an operation on Matx that is not implemented, you can easily convert the matrix to
82Mat and backwards:
83@code{.cpp}
84 Matx33f m(1, 2, 3,
85 4, 5, 6,
86 7, 8, 9);
87 cout << sum(Mat(m*m.t())) << endl;
88@endcode
89Except of the plain constructor which takes a list of elements, Matx can be initialized from a C-array:
90@code{.cpp}
91 float values[] = { 1, 2, 3};
92 Matx31f m(values);
93@endcode
94In case if C++11 features are available, std::initializer_list can be also used to initialize Matx:
95@code{.cpp}
96 Matx31f m = { 1, 2, 3};
97@endcode
98 */
99template<typename _Tp, int m, int n> class Matx
100{
101public:
102 enum {
103 rows = m,
104 cols = n,
105 channels = rows*cols,
106#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
107 depth = traits::Type<_Tp>::value,
108 type = CV_MAKETYPE(depth, channels),
109#endif
110 shortdim = (m < n ? m : n)
111 };
112
113 typedef _Tp value_type;
114 typedef Matx<_Tp, m, n> mat_type;
115 typedef Matx<_Tp, shortdim, 1> diag_type;
116
117 //! default constructor
118 Matx();
119
120 explicit Matx(_Tp v0); //!< 1x1 matrix
121 Matx(_Tp v0, _Tp v1); //!< 1x2 or 2x1 matrix
122 Matx(_Tp v0, _Tp v1, _Tp v2); //!< 1x3 or 3x1 matrix
123 Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3); //!< 1x4, 2x2 or 4x1 matrix
124 Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4); //!< 1x5 or 5x1 matrix
125 Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5); //!< 1x6, 2x3, 3x2 or 6x1 matrix
126 Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6); //!< 1x7 or 7x1 matrix
127 Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7); //!< 1x8, 2x4, 4x2 or 8x1 matrix
128 Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8); //!< 1x9, 3x3 or 9x1 matrix
129 Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9); //!< 1x10, 2x5 or 5x2 or 10x1 matrix
130 Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3,
131 _Tp v4, _Tp v5, _Tp v6, _Tp v7,
132 _Tp v8, _Tp v9, _Tp v10, _Tp v11); //!< 1x12, 2x6, 3x4, 4x3, 6x2 or 12x1 matrix
133 Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3,
134 _Tp v4, _Tp v5, _Tp v6, _Tp v7,
135 _Tp v8, _Tp v9, _Tp v10, _Tp v11,
136 _Tp v12, _Tp v13); //!< 1x14, 2x7, 7x2 or 14x1 matrix
137 Matx(_Tp v0, _Tp v1, _Tp v2, _Tp v3,
138 _Tp v4, _Tp v5, _Tp v6, _Tp v7,
139 _Tp v8, _Tp v9, _Tp v10, _Tp v11,
140 _Tp v12, _Tp v13, _Tp v14, _Tp v15); //!< 1x16, 4x4 or 16x1 matrix
141 explicit Matx(const _Tp* vals); //!< initialize from a plain array
142
143 Matx(std::initializer_list<_Tp>); //!< initialize from an initializer list
144
145 CV_NODISCARD_STD static Matx all(_Tp alpha);
146 CV_NODISCARD_STD static Matx zeros();
147 CV_NODISCARD_STD static Matx ones();
148 CV_NODISCARD_STD static Matx eye();
149 CV_NODISCARD_STD static Matx diag(const diag_type& d);
150 /** @brief Generates uniformly distributed random numbers
151 @param a Range boundary.
152 @param b The other range boundary (boundaries don't have to be ordered, the lower boundary is inclusive,
153 the upper one is exclusive).
154 */
155 CV_NODISCARD_STD static Matx randu(_Tp a, _Tp b);
156 /** @brief Generates normally distributed random numbers
157 @param a Mean value.
158 @param b Standard deviation.
159 */
160 CV_NODISCARD_STD static Matx randn(_Tp a, _Tp b);
161
162 //! dot product computed with the default precision
163 _Tp dot(const Matx<_Tp, m, n>& v) const;
164
165 //! dot product computed in double-precision arithmetics
166 double ddot(const Matx<_Tp, m, n>& v) const;
167
168 //! conversion to another data type
169 template<typename T2> operator Matx<T2, m, n>() const;
170
171 //! change the matrix shape
172 template<int m1, int n1> Matx<_Tp, m1, n1> reshape() const;
173
174 //! extract part of the matrix
175 template<int m1, int n1> Matx<_Tp, m1, n1> get_minor(int base_row, int base_col) const;
176
177 //! extract the matrix row
178 Matx<_Tp, 1, n> row(int i) const;
179
180 //! extract the matrix column
181 Matx<_Tp, m, 1> col(int i) const;
182
183 //! extract the matrix diagonal
184 diag_type diag() const;
185
186 //! transpose the matrix
187 Matx<_Tp, n, m> t() const;
188
189 //! invert the matrix
190 Matx<_Tp, n, m> inv(int method=DECOMP_LU, bool *p_is_ok = NULL) const;
191
192 //! solve linear system
193 template<int l> Matx<_Tp, n, l> solve(const Matx<_Tp, m, l>& rhs, int flags=DECOMP_LU) const;
194 Vec<_Tp, n> solve(const Vec<_Tp, m>& rhs, int method) const;
195
196 //! multiply two matrices element-wise
197 Matx<_Tp, m, n> mul(const Matx<_Tp, m, n>& a) const;
198
199 //! divide two matrices element-wise
200 Matx<_Tp, m, n> div(const Matx<_Tp, m, n>& a) const;
201
202 //! element access
203 const _Tp& operator ()(int row, int col) const;
204 _Tp& operator ()(int row, int col);
205
206 //! 1D element access
207 const _Tp& operator ()(int i) const;
208 _Tp& operator ()(int i);
209
210 Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_AddOp);
211 Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_SubOp);
212 template<typename _T2> Matx(const Matx<_Tp, m, n>& a, _T2 alpha, Matx_ScaleOp);
213 Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_MulOp);
214 Matx(const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b, Matx_DivOp);
215 template<int l> Matx(const Matx<_Tp, m, l>& a, const Matx<_Tp, l, n>& b, Matx_MatMulOp);
216 Matx(const Matx<_Tp, n, m>& a, Matx_TOp);
217
218 _Tp val[m*n]; ///< matrix elements
219};
220
221typedef Matx<float, 1, 2> Matx12f;
222typedef Matx<double, 1, 2> Matx12d;
223typedef Matx<float, 1, 3> Matx13f;
224typedef Matx<double, 1, 3> Matx13d;
225typedef Matx<float, 1, 4> Matx14f;
226typedef Matx<double, 1, 4> Matx14d;
227typedef Matx<float, 1, 6> Matx16f;
228typedef Matx<double, 1, 6> Matx16d;
229
230typedef Matx<float, 2, 1> Matx21f;
231typedef Matx<double, 2, 1> Matx21d;
232typedef Matx<float, 3, 1> Matx31f;
233typedef Matx<double, 3, 1> Matx31d;
234typedef Matx<float, 4, 1> Matx41f;
235typedef Matx<double, 4, 1> Matx41d;
236typedef Matx<float, 6, 1> Matx61f;
237typedef Matx<double, 6, 1> Matx61d;
238
239typedef Matx<float, 2, 2> Matx22f;
240typedef Matx<double, 2, 2> Matx22d;
241typedef Matx<float, 2, 3> Matx23f;
242typedef Matx<double, 2, 3> Matx23d;
243typedef Matx<float, 3, 2> Matx32f;
244typedef Matx<double, 3, 2> Matx32d;
245
246typedef Matx<float, 3, 3> Matx33f;
247typedef Matx<double, 3, 3> Matx33d;
248
249typedef Matx<float, 3, 4> Matx34f;
250typedef Matx<double, 3, 4> Matx34d;
251typedef Matx<float, 4, 3> Matx43f;
252typedef Matx<double, 4, 3> Matx43d;
253
254typedef Matx<float, 4, 4> Matx44f;
255typedef Matx<double, 4, 4> Matx44d;
256typedef Matx<float, 6, 6> Matx66f;
257typedef Matx<double, 6, 6> Matx66d;
258
259template<typename _Tp, int m> static inline
260double determinant(const Matx<_Tp, m, m>& a);
261
262template<typename _Tp, int m, int n> static inline
263double trace(const Matx<_Tp, m, n>& a);
264
265template<typename _Tp, int m, int n> static inline
266double norm(const Matx<_Tp, m, n>& M);
267
268template<typename _Tp, int m, int n> static inline
269double norm(const Matx<_Tp, m, n>& M, int normType);
270
271template<typename _Tp1, typename _Tp2, int m, int n> static inline
272Matx<_Tp1, m, n>& operator += (Matx<_Tp1, m, n>& a, const Matx<_Tp2, m, n>& b);
273
274template<typename _Tp1, typename _Tp2, int m, int n> static inline
275Matx<_Tp1, m, n>& operator -= (Matx<_Tp1, m, n>& a, const Matx<_Tp2, m, n>& b);
276
277template<typename _Tp, int m, int n> static inline
278Matx<_Tp, m, n> operator + (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b);
279
280template<typename _Tp, int m, int n> static inline
281Matx<_Tp, m, n> operator - (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b);
282
283template<typename _Tp, int m, int n> static inline
284Matx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a, int alpha);
285
286template<typename _Tp, int m, int n> static inline
287Matx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a, float alpha);
288
289template<typename _Tp, int m, int n> static inline
290Matx<_Tp, m, n>& operator *= (Matx<_Tp, m, n>& a, double alpha);
291
292template<typename _Tp, int m, int n> static inline
293Matx<_Tp, m, n> operator * (const Matx<_Tp, m, n>& a, int alpha);
294
295template<typename _Tp, int m, int n> static inline
296Matx<_Tp, m, n> operator * (const Matx<_Tp, m, n>& a, float alpha);
297
298template<typename _Tp, int m, int n> static inline
299Matx<_Tp, m, n> operator * (const Matx<_Tp, m, n>& a, double alpha);
300
301template<typename _Tp, int m, int n> static inline
302Matx<_Tp, m, n> operator * (int alpha, const Matx<_Tp, m, n>& a);
303
304template<typename _Tp, int m, int n> static inline
305Matx<_Tp, m, n> operator * (float alpha, const Matx<_Tp, m, n>& a);
306
307template<typename _Tp, int m, int n> static inline
308Matx<_Tp, m, n> operator * (double alpha, const Matx<_Tp, m, n>& a);
309
310template<typename _Tp, int m, int n> static inline
311Matx<_Tp, m, n>& operator /= (Matx<_Tp, m, n>& a, float alpha);
312
313template<typename _Tp, int m, int n> static inline
314Matx<_Tp, m, n>& operator /= (Matx<_Tp, m, n>& a, double alpha);
315
316template<typename _Tp, int m, int n> static inline
317Matx<_Tp, m, n> operator / (const Matx<_Tp, m, n>& a, float alpha);
318
319template<typename _Tp, int m, int n> static inline
320Matx<_Tp, m, n> operator / (const Matx<_Tp, m, n>& a, double alpha);
321
322template<typename _Tp, int m, int n> static inline
323Matx<_Tp, m, n> operator - (const Matx<_Tp, m, n>& a);
324
325template<typename _Tp, int m, int n, int l> static inline
326Matx<_Tp, m, n> operator * (const Matx<_Tp, m, l>& a, const Matx<_Tp, l, n>& b);
327
328template<typename _Tp, int m, int n> static inline
329Vec<_Tp, m> operator * (const Matx<_Tp, m, n>& a, const Vec<_Tp, n>& b);
330
331template<typename _Tp, int m, int n> static inline
332bool operator == (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b);
333
334template<typename _Tp, int m, int n> static inline
335bool operator != (const Matx<_Tp, m, n>& a, const Matx<_Tp, m, n>& b);
336
337
338/////////////////////// Vec (used as element of multi-channel images /////////////////////
339
340/** @brief Template class for short numerical vectors, a partial case of Matx
341
342This template class represents short numerical vectors (of 1, 2, 3, 4 ... elements) on which you
343can perform basic arithmetical operations, access individual elements using [] operator etc. The
344vectors are allocated on stack, as opposite to std::valarray, std::vector, cv::Mat etc., which
345elements are dynamically allocated in the heap.
346
347The template takes 2 parameters:
348@tparam _Tp element type
349@tparam cn the number of elements
350
351In addition to the universal notation like Vec<float, 3>, you can use shorter aliases
352for the most popular specialized variants of Vec, e.g. Vec3f ~ Vec<float, 3>.
353
354It is possible to convert Vec\<T,2\> to/from Point_, Vec\<T,3\> to/from Point3_ , and Vec\<T,4\>
355to CvScalar or Scalar_. Use operator[] to access the elements of Vec.
356
357All the expected vector operations are also implemented:
358- v1 = v2 + v3
359- v1 = v2 - v3
360- v1 = v2 \* scale
361- v1 = scale \* v2
362- v1 = -v2
363- v1 += v2 and other augmenting operations
364- v1 == v2, v1 != v2
365- norm(v1) (euclidean norm)
366The Vec class is commonly used to describe pixel types of multi-channel arrays. See Mat for details.
367*/
368template<typename _Tp, int cn> class Vec : public Matx<_Tp, cn, 1>
369{
370public:
371 typedef _Tp value_type;
372 enum {
373 channels = cn,
374#ifdef OPENCV_TRAITS_ENABLE_DEPRECATED
375 depth = Matx<_Tp, cn, 1>::depth,
376 type = CV_MAKETYPE(depth, channels),
377#endif
378 _dummy_enum_finalizer = 0
379 };
380
381 //! default constructor
382 Vec();
383
384 Vec(_Tp v0); //!< 1-element vector constructor
385 Vec(_Tp v0, _Tp v1); //!< 2-element vector constructor
386 Vec(_Tp v0, _Tp v1, _Tp v2); //!< 3-element vector constructor
387 Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3); //!< 4-element vector constructor
388 Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4); //!< 5-element vector constructor
389 Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5); //!< 6-element vector constructor
390 Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6); //!< 7-element vector constructor
391 Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7); //!< 8-element vector constructor
392 Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8); //!< 9-element vector constructor
393 Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9); //!< 10-element vector constructor
394 Vec(_Tp v0, _Tp v1, _Tp v2, _Tp v3, _Tp v4, _Tp v5, _Tp v6, _Tp v7, _Tp v8, _Tp v9, _Tp v10, _Tp v11, _Tp v12, _Tp v13); //!< 14-element vector constructor
395 explicit Vec(const _Tp* values);
396
397 Vec(std::initializer_list<_Tp>);
398
399 Vec(const Vec<_Tp, cn>& v);
400
401 static Vec all(_Tp alpha);
402 static Vec ones();
403 static Vec randn(_Tp a, _Tp b);
404 static Vec randu(_Tp a, _Tp b);
405 static Vec zeros();
406 static Vec diag(_Tp alpha) = delete;
407 static Vec eye() = delete;
408
409 //! per-element multiplication
410 Vec mul(const Vec<_Tp, cn>& v) const;
411
412 //! conjugation (makes sense for complex numbers and quaternions)
413 Vec conj() const;
414
415 /*!
416 cross product of the two 3D vectors.
417
418 For other dimensionalities the exception is raised
419 */
420 Vec cross(const Vec& v) const;
421 //! conversion to another data type
422 template<typename T2> operator Vec<T2, cn>() const;
423
424 /*! element access */
425 const _Tp& operator [](int i) const;
426 _Tp& operator[](int i);
427 const _Tp& operator ()(int i) const;
428 _Tp& operator ()(int i);
429
430 Vec<_Tp, cn>& operator=(const Vec<_Tp, cn>& rhs) = default;
431
432 Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_AddOp);
433 Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_SubOp);
434 template<typename _T2> Vec(const Matx<_Tp, cn, 1>& a, _T2 alpha, Matx_ScaleOp);
435};
436
437/** @name Shorter aliases for the most popular specializations of Vec<T,n>
438 @{
439*/
440typedef Vec<uchar, 2> Vec2b;
441typedef Vec<uchar, 3> Vec3b;
442typedef Vec<uchar, 4> Vec4b;
443
444typedef Vec<short, 2> Vec2s;
445typedef Vec<short, 3> Vec3s;
446typedef Vec<short, 4> Vec4s;
447
448typedef Vec<ushort, 2> Vec2w;
449typedef Vec<ushort, 3> Vec3w;
450typedef Vec<ushort, 4> Vec4w;
451
452typedef Vec<int, 2> Vec2i;
453typedef Vec<int, 3> Vec3i;
454typedef Vec<int, 4> Vec4i;
455typedef Vec<int, 6> Vec6i;
456typedef Vec<int, 8> Vec8i;
457
458typedef Vec<float, 2> Vec2f;
459typedef Vec<float, 3> Vec3f;
460typedef Vec<float, 4> Vec4f;
461typedef Vec<float, 6> Vec6f;
462
463typedef Vec<double, 2> Vec2d;
464typedef Vec<double, 3> Vec3d;
465typedef Vec<double, 4> Vec4d;
466typedef Vec<double, 6> Vec6d;
467/** @} */
468
469template<typename _Tp, int cn> inline
470Vec<_Tp, cn> normalize(const Vec<_Tp, cn>& v);
471
472template<typename _Tp1, typename _Tp2, int cn> static inline
473Vec<_Tp1, cn>& operator += (Vec<_Tp1, cn>& a, const Vec<_Tp2, cn>& b);
474
475template<typename _Tp1, typename _Tp2, int cn> static inline
476Vec<_Tp1, cn>& operator -= (Vec<_Tp1, cn>& a, const Vec<_Tp2, cn>& b);
477
478template<typename _Tp, int cn> static inline
479Vec<_Tp, cn> operator + (const Vec<_Tp, cn>& a, const Vec<_Tp, cn>& b);
480
481template<typename _Tp, int cn> static inline
482Vec<_Tp, cn> operator - (const Vec<_Tp, cn>& a, const Vec<_Tp, cn>& b);
483
484template<typename _Tp, int cn> static inline
485Vec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a, int alpha);
486
487template<typename _Tp, int cn> static inline
488Vec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a, float alpha);
489
490template<typename _Tp, int cn> static inline
491Vec<_Tp, cn>& operator *= (Vec<_Tp, cn>& a, double alpha);
492
493template<typename _Tp, int cn> static inline
494Vec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a, int alpha);
495
496template<typename _Tp, int cn> static inline
497Vec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a, float alpha);
498
499template<typename _Tp, int cn> static inline
500Vec<_Tp, cn>& operator /= (Vec<_Tp, cn>& a, double alpha);
501
502template<typename _Tp, int cn> static inline
503Vec<_Tp, cn> operator * (const Vec<_Tp, cn>& a, int alpha);
504
505template<typename _Tp, int cn> static inline
506Vec<_Tp, cn> operator * (int alpha, const Vec<_Tp, cn>& a);
507
508template<typename _Tp, int cn> static inline
509Vec<_Tp, cn> operator * (const Vec<_Tp, cn>& a, float alpha);
510
511template<typename _Tp, int cn> static inline
512Vec<_Tp, cn> operator * (float alpha, const Vec<_Tp, cn>& a);
513
514template<typename _Tp, int cn> static inline
515Vec<_Tp, cn> operator * (const Vec<_Tp, cn>& a, double alpha);
516
517template<typename _Tp, int cn> static inline
518Vec<_Tp, cn> operator * (double alpha, const Vec<_Tp, cn>& a);
519
520template<typename _Tp, int cn> static inline
521Vec<_Tp, cn> operator / (const Vec<_Tp, cn>& a, int alpha);
522
523template<typename _Tp, int cn> static inline
524Vec<_Tp, cn> operator / (const Vec<_Tp, cn>& a, float alpha);
525
526template<typename _Tp, int cn> static inline
527Vec<_Tp, cn> operator / (const Vec<_Tp, cn>& a, double alpha);
528
529template<typename _Tp, int cn> static inline
530Vec<_Tp, cn> operator - (const Vec<_Tp, cn>& a);
531
532template<typename _Tp> inline
533Vec<_Tp, 4> operator * (const Vec<_Tp, 4>& v1, const Vec<_Tp, 4>& v2);
534
535template<typename _Tp> inline
536Vec<_Tp, 4>& operator *= (Vec<_Tp, 4>& v1, const Vec<_Tp, 4>& v2);
537
538//! @} core_basic
539
540} // cv
541
542#include "opencv2/core/matx.inl.hpp"
543
544#endif // OPENCV_CORE_MATX_HPP
545

source code of opencv/modules/core/include/opencv2/core/matx.hpp