Search Results for

    Show / Hide Table of Contents

    Struct Scalar

    A container for one-,two-,three- or four-tuples of doubles. Scalar is always represented as a four-tuple.

    Implements
    IEquatable<Scalar>
    Namespace: OpenCV.Net
    Assembly: OpenCV.Net.dll
    Syntax
    public struct Scalar : IEquatable<Scalar>

    Constructors

    | Improve this Doc View Source

    Scalar(Double, Double, Double, Double)

    Initializes a new instance of the Scalar structure from the specified values.

    Declaration
    public Scalar(double val0, double val1 = null, double val2 = null, double val3 = null)
    Parameters
    Type Name Description
    Double val0

    The first value of the scalar tuple.

    Double val1

    The optional second value of the scalar tuple.

    Double val2

    The optional third value of the scalar tuple.

    Double val3

    The optional fourth value of the scalar tuple.

    Fields

    | Improve this Doc View Source

    Val0

    The first value of the scalar tuple.

    Declaration
    public double Val0
    Field Value
    Type Description
    Double
    | Improve this Doc View Source

    Val1

    The second value of the scalar tuple.

    Declaration
    public double Val1
    Field Value
    Type Description
    Double
    | Improve this Doc View Source

    Val2

    The third value of the scalar tuple.

    Declaration
    public double Val2
    Field Value
    Type Description
    Double
    | Improve this Doc View Source

    Val3

    The fourth value of the scalar tuple.

    Declaration
    public double Val3
    Field Value
    Type Description
    Double

    Methods

    | Improve this Doc View Source

    All(Double)

    Initializes a new Scalar instance where all the values of the tuple are initialized to the same scalar value.

    Declaration
    public static Scalar All(double val0123)
    Parameters
    Type Name Description
    Double val0123

    The scalar value from which to initialize all tuple scalars.

    Returns
    Type Description
    Scalar

    A new Scalar instance where all the values of the tuple are initialized to the specified scalar value.

    | Improve this Doc View Source

    Equals(Scalar)

    Returns a value indicating whether this instance has the same tuple values as a specified Scalar structure.

    Declaration
    public bool Equals(Scalar other)
    Parameters
    Type Name Description
    Scalar other

    The Scalar structure to compare to this instance.

    Returns
    Type Description
    Boolean

    true if other has the same Val0, Val1, Val2 and Val3 values as this instance; otherwise, false.

    | Improve this Doc View Source

    Equals(Object)

    Tests to see whether the specified object is a Scalar structure with the same tuple values as this Scalar structure.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The to test.

    Returns
    Type Description
    Boolean

    true if obj is a Scalar and has the same Val0, Val1, Val2 and Val3 values as this Scalar; otherwise, false.

    | Improve this Doc View Source

    GetHashCode()

    Returns a hash code for this Scalar structure.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    An integer value that specifies a hash value for this Scalar structure.

    | Improve this Doc View Source

    PackedColor(Double, Int32)

    Initializes a new Scalar instance from a packed color value.

    Declaration
    public static Scalar PackedColor(double color, int arrayType)
    Parameters
    Type Name Description
    Double color

    The packed color value.

    Int32 arrayType

    The type of array elements. If the depth of the elements is not 8-bit, the first channels of the returned Scalar are set to the same value as color.

    Returns
    Type Description
    Scalar

    A new Scalar instance where the values of the tuple are initialized to represent the unpacked color.

    | Improve this Doc View Source

    Real(Double)

    Initializes a new Scalar instance representing a single scalar value.

    Declaration
    public static Scalar Real(double val0)
    Parameters
    Type Name Description
    Double val0

    The scalar value.

    Returns
    Type Description
    Scalar

    A new Scalar instance representing a single scalar value.

    | Improve this Doc View Source

    Rgb(Double, Double, Double)

    Initializes a new Scalar instance representing a color pixel value.

    Declaration
    public static Scalar Rgb(double r, double g, double b)
    Parameters
    Type Name Description
    Double r

    The red component of the color.

    Double g

    The green component of the color.

    Double b

    The blue component of the color.

    Returns
    Type Description
    Scalar

    A new Scalar instance where the values of the tuple are initialized to the specified color components.

    | Improve this Doc View Source

    ToString()

    Creates a representation of this Scalar structure.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A containing the four tuple values of this Scalar structure.

    Operators

    | Improve this Doc View Source

    Equality(Scalar, Scalar)

    Tests whether two Scalar structures are equal.

    Declaration
    public static bool operator ==(Scalar left, Scalar right)
    Parameters
    Type Name Description
    Scalar left

    The Scalar structure on the left of the equality operator.

    Scalar right

    The Scalar structure on the right of the equality operator.

    Returns
    Type Description
    Boolean

    true if left and right have equal Val0, Val1, Val2 and Val3 values; otherwise, false.

    | Improve this Doc View Source

    Inequality(Scalar, Scalar)

    Tests whether two Scalar structures are different.

    Declaration
    public static bool operator !=(Scalar left, Scalar right)
    Parameters
    Type Name Description
    Scalar left

    The Scalar structure on the left of the inequality operator.

    Scalar right

    The Scalar structure on the right of the inequality operator.

    Returns
    Type Description
    Boolean

    true if left and right differ in Val0, Val1, Val2 or Val3 values; false if left and right are equal.

    Implements

    IEquatable<>
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX