OpenCV 2.4.8

org.opencv.core
Class Scalar

java.lang.Object
  extended by org.opencv.core.Scalar

public class Scalar
extends java.lang.Object

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

template class CV_EXPORTS Scalar_ : public Vec<_Tp, 4>

// C++ code:

public:

//! various constructors

Scalar_();

Scalar_(_Tp v0, _Tp v1, _Tp v2=0, _Tp v3=0);

Scalar_(const CvScalar& s);

Scalar_(_Tp v0);

//! returns a scalar with all elements set to v0

static Scalar_<_Tp> all(_Tp v0);

//! conversion to the old-style CvScalar

operator CvScalar() const;

//! conversion to another data type

template operator Scalar_() const;

//! per-element product

Scalar_<_Tp> mul(const Scalar_<_Tp>& t, double scale=1) const;

// returns (v0, -v1, -v2, -v3)

Scalar_<_Tp> conj() const;

// returns true iff v1 == v2 == v3 == 0

bool isReal() const;

};

typedef Scalar_ Scalar;

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.

See Also:
org.opencv.core.Scalar_

Field Summary
 double[] val
           
 
Constructor Summary
Scalar(double v0)
           
Scalar(double[] vals)
           
Scalar(double v0, double v1)
           
Scalar(double v0, double v1, double v2)
           
Scalar(double v0, double v1, double v2, double v3)
           
 
Method Summary
static Scalar all(double v)
           
 Scalar clone()
           
 Scalar conj()
           
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 boolean isReal()
           
 Scalar mul(Scalar it)
           
 Scalar mul(Scalar it, double scale)
           
 void set(double[] vals)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

val

public double[] val
Constructor Detail

Scalar

public Scalar(double v0)

Scalar

public Scalar(double[] vals)

Scalar

public Scalar(double v0,
              double v1)

Scalar

public Scalar(double v0,
              double v1,
              double v2)

Scalar

public Scalar(double v0,
              double v1,
              double v2,
              double v3)
Method Detail

all

public static Scalar all(double v)

clone

public Scalar clone()
Overrides:
clone in class java.lang.Object

conj

public Scalar conj()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isReal

public boolean isReal()

mul

public Scalar mul(Scalar it)

mul

public Scalar mul(Scalar it,
                  double scale)

set

public void set(double[] vals)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

OpenCV 2.4.8 Documentation