OpenCV  3.2.0-dev
Open Source Computer Vision
cv::Scalar_< _Tp > Class Template Reference

Template class for a 4-element vector derived from Vec. More...

#include "types.hpp"

Inheritance diagram for cv::Scalar_< _Tp >:
Collaboration diagram for cv::Scalar_< _Tp >:

Public Types

enum  
 
enum  
 
typedef Matx< _Tp, shortdim, 1 > diag_type
 
typedef Matx< _Tp, m, n > mat_type
 
typedef _Tp value_type
 

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

_Tp val [m *n]
 

Detailed Description

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

Template class for a 4-element vector derived from Vec.

Being derived from Vec<Tp, 4> , Scalar and Scalar can be used just as typical 4-element vectors. In addition, they can be converted to/from CvScalar . The type Scalar is widely used in OpenCV to pass pixel values.

Member Typedef Documentation

typedef Matx<_Tp, shortdim, 1> cv::Matx< _Tp, m, n >::diag_type
inherited
typedef Matx<_Tp, m, n> cv::Matx< _Tp, m, n >::mat_type
inherited
typedef _Tp cv::Vec< _Tp, cn >::value_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_ ( _Tp  v0)
template<typename _Tp>
template<typename _Tp2 , int cn>
cv::Scalar_< _Tp >::Scalar_ ( const Vec< _Tp2, cn > &  v)

Member Function Documentation

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

returns a scalar with all elements set to v0

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

extract the matrix column

template<typename _Tp>
Scalar_<_Tp> cv::Scalar_< _Tp >::conj ( ) const
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

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

dot product computed in double-precision arithmetics

static Matx cv::Matx< _Tp, m, n >::diag ( const diag_type d)
staticinherited
diag_type cv::Matx< _Tp, m, n >::diag ( ) const
inherited

extract the matrix diagonal

Matx<_Tp, m, n> cv::Matx< _Tp, m, n >::div ( const Matx< _Tp, m, n > &  a) const
inherited

divide two matrices element-wise

_Tp cv::Matx< _Tp, m, n >::dot ( const Matx< _Tp, m, n > &  v) const
inherited

dot product computed with the default precision

static Matx cv::Matx< _Tp, m, n >::eye ( )
staticinherited
Matx<_Tp, m1, n1> cv::Matx< _Tp, m, n >::get_minor ( int  i,
int  j 
) const
inherited

extract part of the matrix

Matx<_Tp, n, m> cv::Matx< _Tp, m, n >::inv ( int  method = DECOMP_LU,
bool *  p_is_ok = NULL 
) const
inherited

invert the matrix

template<typename _Tp>
bool cv::Scalar_< _Tp >::isReal ( ) const
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 >::mul ( const Vec< _Tp, cn > &  v) const
inherited

per-element multiplication

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

per-element product

static Matx cv::Matx< _Tp, m, n >::ones ( )
staticinherited
cv::Matx< _Tp, m, n >::operator Matx< T2, m, n > ( ) const
inherited

conversion to another data type

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

conversion to another data type

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

conversion to another data type

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
const _Tp& cv::Vec< _Tp, cn >::operator() ( int  i) const
inherited
_Tp& cv::Vec< _Tp, cn >::operator() ( int  i)
inherited
const _Tp& cv::Vec< _Tp, cn >::operator[] ( int  i) const
inherited

element access

_Tp& cv::Vec< _Tp, cn >::operator[] ( int  i)
inherited
static Matx cv::Matx< _Tp, m, n >::randn ( _Tp  a,
_Tp  b 
)
staticinherited
static Matx cv::Matx< _Tp, m, n >::randu ( _Tp  a,
_Tp  b 
)
staticinherited
Matx<_Tp, m1, n1> cv::Matx< _Tp, m, n >::reshape ( ) const
inherited

change the matrix shape

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

extract the matrix row

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

Vec<_Tp, n> cv::Matx< _Tp, m, n >::solve ( const Vec< _Tp, m > &  rhs,
int  method 
) const
inherited
Matx<_Tp, n, m> cv::Matx< _Tp, m, n >::t ( ) const
inherited

transpose the matrix

static Matx cv::Matx< _Tp, m, n >::zeros ( )
staticinherited

Member Data Documentation


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