ConstrainPoint2D Struct

The ConstrainPoint2D typedef (https://w3c.github.io/mediacapture-image/#typedefdef-constrainpoint2d): a bare list of points, or an exact and an ideal list of points.

public readonly struct ConstrainPoint2D : IEquatable<ConstrainPoint2D>
Implements

Properties

NameDescription
BareGets the bare list of points when the union holds it, otherwise null.
ParametersGets the parameters when the union holds it, otherwise null.
ValueGets the value of the union: Point2D[] or ConstrainPoint2DParameters.

Gets the bare list of points when the union holds it, otherwise null.

public IReadOnlyList<Point2D>? Bare { get; }

Gets the parameters when the union holds it, otherwise null.

public ConstrainPoint2DParameters? Parameters { get; }

Gets the value of the union: Point2D[] or ConstrainPoint2DParameters.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(ConstrainPoint2D)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
FromConstrainPoint2DParameters(ConstrainPoint2DParameters)Creates the union from the parameters.
FromPoints(Point2D[])Creates the union from the bare list of points.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(ConstrainPoint2D)

MediaCaptureUnions.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ConstrainPoint2D other)
Parameters
other ConstrainPoint2D
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

MediaCaptureUnions.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

FromConstrainPoint2DParameters(ConstrainPoint2DParameters)

MediaCaptureUnions.cs

Creates the union from the parameters.

public static ConstrainPoint2D FromConstrainPoint2DParameters(ConstrainPoint2DParameters value)

FromPoints(Point2D[])

MediaCaptureUnions.cs

Creates the union from the bare list of points.

public static ConstrainPoint2D FromPoints(Point2D[] value)

Parameters

value Point2D[]

Returns

ConstrainPoint2D

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

Operators

NameDescription
operator ==(ConstrainPoint2D, ConstrainPoint2D)Returns whether the two unions hold the same value.
implicit operator ConstrainPoint2D(ConstrainPoint2DParameters)Creates the union from the parameters.
implicit operator ConstrainPoint2D(Point2D[])Creates the union from the bare list of points.
operator !=(ConstrainPoint2D, ConstrainPoint2D)Returns whether the two unions hold different values.

operator ==(ConstrainPoint2D, ConstrainPoint2D)

MediaCaptureUnions.cs

Returns whether the two unions hold the same value.

public static bool operator ==(ConstrainPoint2D left, ConstrainPoint2D right)

Parameters

left ConstrainPoint2D
right ConstrainPoint2D

Returns

bool

op_Implicit overloads

implicit operator ConstrainPoint2D(ConstrainPoint2DParameters)

MediaCaptureUnions.cs

Creates the union from the parameters.

public static implicit operator ConstrainPoint2D(ConstrainPoint2DParameters value)

implicit operator ConstrainPoint2D(Point2D[])

MediaCaptureUnions.cs

Creates the union from the bare list of points.

public static implicit operator ConstrainPoint2D(Point2D[] value)
Parameters
value Point2D[]
Returns

ConstrainPoint2D

operator !=(ConstrainPoint2D, ConstrainPoint2D)

MediaCaptureUnions.cs

Returns whether the two unions hold different values.

public static bool operator !=(ConstrainPoint2D left, ConstrainPoint2D right)

Parameters

left ConstrainPoint2D
right ConstrainPoint2D

Returns

bool