Show / Hide Table of Contents

Struct Point

Represents a point consisting of a X- and a Y-position.

Implements
IEquatable<Point>
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public readonly struct Point : IEquatable<Point>

Constructors

| Edit this page View Source

Point(float, float)

Initializes a new instance of the Point class using the provided values.

Declaration
public Point(float x, float y)
Parameters
Type Name Description
float x

The value used for the X-position.

float y

The value used for the Y-position.

Properties

| Edit this page View Source

Invalid

Gets a [NaN,NaN]-Point.

Declaration
public static ref readonly Point Invalid { get; }
Property Value
Type Description
Point
| Edit this page View Source

X

Gets the X-position of this Point.

Declaration
public float X { get; }
Property Value
Type Description
float
| Edit this page View Source

Y

Gets the Y-position of this Point.

Declaration
public float Y { get; }
Property Value
Type Description
float

Methods

| Edit this page View Source

Equals(Point)

Tests whether the specified Point is equivalent to this Point.

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

The point to test.

Returns
Type Description
bool

true if other is equivalent to this Point; otherwise, false.

| Edit this page View Source

Equals(object?)

Tests whether the specified object is a Point and is equivalent to this Point.

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

The object to test.

Returns
Type Description
bool

true if obj is a Point equivalent to this Point; otherwise, false.

Overrides
ValueType.Equals(object)
| Edit this page View Source

GetHashCode()

Returns a hash code for this Point.

Declaration
public override int GetHashCode()
Returns
Type Description
int

An integer value that specifies the hash code for this Point.

Overrides
ValueType.GetHashCode()
| Edit this page View Source

ToString()

Converts the X- and Y-position of this Point to a human-readable string.

Declaration
public override string ToString()
Returns
Type Description
string

A string that contains the X and Y of this Point. For example "[X: 100, Y: 20]".

Overrides
ValueType.ToString()

Operators

| Edit this page View Source

operator +(in Point, in Point)

Returns a new Point representing the addition of the two provided Point.

Declaration
public static Point operator +(in Point point1, in Point point2)
Parameters
Type Name Description
Point point1

The first Point.

Point point2

The second Point.

Returns
Type Description
Point

A new Point representing the addition of the two provided Point.

| Edit this page View Source

operator +(in Point, in Size)

Returns a new Rectangle created from the provided Point and Size.

Declaration
public static Rectangle operator +(in Point point, in Size size)
Parameters
Type Name Description
Point point

The Point of the rectangle.

Size size

The Size of the rectangle.

Returns
Type Description
Rectangle

The rectangle created from the provided Point and Size.

| Edit this page View Source

operator /(in Point, in Point)

Returns a new Point representing the division of the two provided Point.

Declaration
public static Point operator /(in Point point1, in Point point2)
Parameters
Type Name Description
Point point1

The first Point.

Point point2

The second Point.

Returns
Type Description
Point

A new Point representing the division of the two provided Point.

| Edit this page View Source

operator ==(in Point, in Point)

Returns a value that indicates whether two specified Point are equal.

Declaration
public static bool operator ==(in Point point1, in Point point2)
Parameters
Type Name Description
Point point1

The first Point to compare.

Point point2

The second Point to compare.

Returns
Type Description
bool

true if point1 and point2 are equal; otherwise, false.

| Edit this page View Source

operator !=(in Point, in Point)

Returns a value that indicates whether two specified Point are equal.

Declaration
public static bool operator !=(in Point point1, in Point point2)
Parameters
Type Name Description
Point point1

The first Point to compare.

Point point2

The second Point to compare.

Returns
Type Description
bool

true if point1 and point2 are not equal; otherwise, false.

| Edit this page View Source

operator *(in Point, in Point)

Returns a new Point representing the multiplication of the two provided Point.

Declaration
public static Point operator *(in Point point1, in Point point2)
Parameters
Type Name Description
Point point1

The first Point.

Point point2

The second Point.

Returns
Type Description
Point

A new Point representing the multiplication of the two provided Point.

| Edit this page View Source

operator *(in Point, in Scale)

Returns a new Point representing the multiplication of the Point and the provided Scale.

Declaration
public static Point operator *(in Point point, in Scale scale)
Parameters
Type Name Description
Point point

The Point.

Scale scale

The Scale.

Returns
Type Description
Point

A new Point representing the multiplication of the Point and the provided Scale.

| Edit this page View Source

operator -(in Point, in Point)

Returns a new Point representing the subtraction of the two provided Point.

Declaration
public static Point operator -(in Point point1, in Point point2)
Parameters
Type Name Description
Point point1

The first Point.

Point point2

The second Point.

Returns
Type Description
Point

A new Point representing the subtraction of the two provided Point.

Implements

IEquatable<T>

Extension Methods

PointExtensions.Rotate(in Point, in Rotation, in Point)
PointExtensions.Translate(in Point, float, float)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX