cv::Scalar_< _Tp > Class Template Reference

The template scalar class. More...

#include <core.hpp>

Inherits Vec< _Tp, 4 >.

List of all members.

Public Types

enum  
typedef _Tp value_type
enum  
typedef Matx< _Tp, MIN(m, n), 1 > diag_type
typedef Matx< _Tp, m, nmat_type

Public Member Functions

 Scalar_ ()
 various constructors
 Scalar_ (_Tp v0, _Tp v1, _Tp v2=0, _Tp v3=0)
 Scalar_ (const CvScalar &s)
 Scalar_ (_Tp v0)
 operator CvScalar () const
 conversion to the old-style CvScalar
template<typename T2 >
 operator Scalar_< T2 > () const
 conversion to another data type
Scalar_< _Tp > mul (const Scalar_< _Tp > &t, double scale=1) const
 per-element product
Scalar_< _Tp > conj () const
bool isReal () const
Vec mul (const Vec< _Tp, cn > &v) const
 per-element multiplication
Matx< _Tp, m, nmul (const Matx< _Tp, m, n > &a) const
 multiply two matrices element-wise
Vec cross (const Vec &v) const
 cross product of the two 3D vectors.
 operator Vec< T2, cn > () const
 convertion to another data type
const _Tp & operator[] (int i) const
 element access
_Tp & operator[] (int i)
const _Tp & operator() (int i) const
 1D element access
_Tp & operator() (int i)
const _Tp & operator() (int i, int j) const
 element access
_Tp & operator() (int i, int j)
Matx< _Tp, MIN(m, n), 1 > diag () const
 extract the matrix diagonal
_Tp dot (const Matx< _Tp, m, n > &v) const
 dot product computed with the default precision
double ddot (const Matx< _Tp, m, n > &v) const
 dot product computed in double-precision arithmetics
 operator Matx< T2, m, n > () const
 convertion to another data type
Matx< _Tp, m1, n1 > reshape () const
 change the matrix shape
Matx< _Tp, m1, n1 > get_minor (int i, int j) const
 extract part of the matrix
Matx< _Tp, 1, nrow (int i) const
 extract the matrix row
Matx< _Tp, m, 1 > col (int i) const
 extract the matrix column
Matx< _Tp, n, m > t () const
 transpose the matrix
Matx< _Tp, n, m > inv (int method=DECOMP_LU) const
 invert matrix the matrix
Matx< _Tp, n, l > solve (const Matx< _Tp, m, l > &rhs, int flags=DECOMP_LU) const
 solve linear system
Matx< _Tp, n, 1 > solve (const Matx< _Tp, m, 1 > &rhs, int method) const

Static Public Member Functions

static Scalar_< _Tp > all (_Tp v0)
 returns a scalar with all elements set to v0
static Matx zeros ()
static Matx ones ()
static Matx eye ()
static Matx diag (const diag_type &d)
static Matx randu (_Tp a, _Tp b)
static Matx randn (_Tp a, _Tp b)

Public Attributes

_Tp val [m *n]

Detailed Description

template<typename _Tp>
class cv::Scalar_< _Tp >

The template scalar class.

This is partially specialized cv::Vec class with the number of elements = 4, i.e. a short vector of four elements. Normally, cv::Scalar ~ cv::Scalar_<double> is used.


Member Typedef Documentation

typedef _Tp cv::Vec< _Tp, cn >::value_type [inherited]

Reimplemented from cv::Matx< _Tp, cn, 1 >.

typedef Matx<_Tp, MIN(m, n), 1> cv::Matx< _Tp, m, n >::diag_type [inherited]
typedef Matx<_Tp, m, n> cv::Matx< _Tp, m, n >::mat_type [inherited]

Member Enumeration Documentation

anonymous enum [inherited]
anonymous enum [inherited]

Constructor & Destructor Documentation

template<typename _Tp >
cv::Scalar_< _Tp >::Scalar_ (  ) 

various constructors

template<typename _Tp>
cv::Scalar_< _Tp >::Scalar_ ( _Tp  v0,
_Tp  v1,
_Tp  v2 = 0,
_Tp  v3 = 0 
)
template<typename _Tp>
cv::Scalar_< _Tp >::Scalar_ ( const CvScalar s  ) 
template<typename _Tp>
cv::Scalar_< _Tp >::Scalar_ ( _Tp  v0  ) 

Member Function Documentation

template<typename _Tp>
Scalar_< _Tp > cv::Scalar_< _Tp >::all ( _Tp  v0  )  [static]

returns a scalar with all elements set to v0

Reimplemented from cv::Vec< _Tp, 4 >.

template<typename _Tp >
cv::Scalar_< _Tp >::operator CvScalar (  )  const

conversion to the old-style CvScalar

Reimplemented from cv::Vec< _Tp, 4 >.

template<typename _Tp >
template<typename T2 >
cv::Scalar_< _Tp >::operator Scalar_< T2 > (  )  const

conversion to another data type

template<typename _Tp>
Scalar_< _Tp > cv::Scalar_< _Tp >::mul ( const Scalar_< _Tp > &  t,
double  scale = 1 
) const

per-element product

template<typename _Tp >
Scalar_< _Tp > cv::Scalar_< _Tp >::conj (  )  const
template<typename _Tp >
bool cv::Scalar_< _Tp >::isReal (  )  const
Vec cv::Vec< _Tp, cn >::mul ( const Vec< _Tp, cn > &  v  )  const [inherited]

per-element multiplication

Matx<_Tp, m, n> cv::Matx< _Tp, m, n >::mul ( const Matx< _Tp, m, n > &  a  )  const [inherited]

multiply two matrices element-wise

Vec cv::Vec< _Tp, cn >::cross ( const Vec< _Tp, 4 > &  v  )  const [inherited]

cross product of the two 3D vectors.

For other dimensionalities the exception is raised

cv::Vec< _Tp, cn >::operator Vec< T2, cn > (  )  const [inherited]

convertion to another data type

const _Tp& cv::Vec< _Tp, cn >::operator[] ( int  i  )  const [inherited]

element access

_Tp& cv::Vec< _Tp, cn >::operator[] ( int  i  )  [inherited]
const _Tp& cv::Vec< _Tp, cn >::operator() ( int  i  )  const [inherited]

1D element access

Reimplemented from cv::Matx< _Tp, cn, 1 >.

_Tp& cv::Vec< _Tp, cn >::operator() ( int  i  )  [inherited]

Reimplemented from cv::Matx< _Tp, cn, 1 >.

const _Tp& cv::Matx< _Tp, m, n >::operator() ( int  i,
int  j 
) const [inherited]

element access

_Tp& cv::Matx< _Tp, m, n >::operator() ( int  i,
int  j 
) [inherited]
static Matx cv::Matx< _Tp, m, n >::zeros (  )  [static, inherited]
static Matx cv::Matx< _Tp, m, n >::ones (  )  [static, inherited]
static Matx cv::Matx< _Tp, m, n >::eye (  )  [static, inherited]
static Matx cv::Matx< _Tp, m, n >::diag ( const diag_type d  )  [static, inherited]
Matx<_Tp, MIN(m,n), 1> cv::Matx< _Tp, m, n >::diag (  )  const [inherited]

extract the matrix diagonal

static Matx cv::Matx< _Tp, m, n >::randu ( _Tp  a,
_Tp  b 
) [static, inherited]
static Matx cv::Matx< _Tp, m, n >::randn ( _Tp  a,
_Tp  b 
) [static, inherited]
_Tp cv::Matx< _Tp, m, n >::dot ( const Matx< _Tp, m, n > &  v  )  const [inherited]

dot product computed with the default precision

double cv::Matx< _Tp, m, n >::ddot ( const Matx< _Tp, m, n > &  v  )  const [inherited]

dot product computed in double-precision arithmetics

cv::Matx< _Tp, m, n >::operator Matx< T2, m, n > (  )  const [inherited]

convertion to another data type

Matx<_Tp, m1, n1> cv::Matx< _Tp, m, n >::reshape (  )  const [inherited]

change the matrix shape

Matx<_Tp, m1, n1> cv::Matx< _Tp, m, n >::get_minor ( int  i,
int  j 
) const [inherited]

extract part of the matrix

Matx<_Tp, 1, n> cv::Matx< _Tp, m, n >::row ( int  i  )  const [inherited]

extract the matrix row

Matx<_Tp, m, 1> cv::Matx< _Tp, m, n >::col ( int  i  )  const [inherited]

extract the matrix column

Matx<_Tp, n, m> cv::Matx< _Tp, m, n >::t (  )  const [inherited]

transpose the matrix

Matx<_Tp, n, m> cv::Matx< _Tp, m, n >::inv ( int  method = DECOMP_LU  )  const [inherited]

invert matrix the matrix

Matx<_Tp, n, l> cv::Matx< _Tp, m, n >::solve ( const Matx< _Tp, m, l > &  rhs,
int  flags = DECOMP_LU 
) const [inherited]

solve linear system

Matx<_Tp, n, 1> cv::Matx< _Tp, m, n >::solve ( const Matx< _Tp, m, 1 > &  rhs,
int  method 
) const [inherited]

Member Data Documentation

_Tp cv::Matx< _Tp, m, n >::val[m *n] [inherited]

The documentation for this class was generated from the following files: