Public Types | Public Member Functions | Static Public Member Functions
cv::Scalar_< _Tp > Class Template Reference

The template scalar class. More...

#include <core.hpp>

Inherits cv::Vec< _Tp, 4 >.

List of all members.

Public Types

enum  
typedef _Tp value_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
 conjugation (makes sense for complex numbers and quaternions)
bool isReal () const
Vec mul (const Vec< _Tp, cn > &v) const
 per-element multiplication
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
_Tp & operator() (int i)

Static Public Member Functions

static Scalar_< _Tp > all (_Tp v0)
 returns a scalar with all elements set to v0

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 >.


Member Enumeration Documentation

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

conjugation (makes sense for complex numbers and quaternions)

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

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

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

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