Struct Point
- Namespace
- SixLabors.ImageSharp
- Assembly
- SixLabors.ImageSharp.dll
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.
public struct Point : IEquatable<Point>
- Implements
- Inherited Members
Remarks
This struct is fully mutable. This is done (against the guidelines) for the sake of performance, as it avoids the need to create new values for modification operations.
Constructors
Point(Size)
public Point(Size size)
Parameters
size
SizeThe size.
Point(int)
Initializes a new instance of the Point struct.
public Point(int value)
Parameters
value
intThe horizontal and vertical position of the point.
Point(int, int)
Initializes a new instance of the Point struct.
public Point(int x, int y)
Parameters
Fields
Empty
Represents a Point that has X and Y values set to zero.
public static readonly Point Empty
Field Value
Properties
X
Gets or sets the x-coordinate of this Point.
public int X { readonly get; set; }
Property Value
Y
Gets or sets the y-coordinate of this Point.
public int Y { readonly get; set; }
Property Value
Methods
Add(Point, Size)
public static Point Add(Point point, Size size)
Parameters
point
PointThe point on the left hand of the operand.
size
SizeThe size on the right hand of the operand.
Returns
Ceiling(PointF)
public static Point Ceiling(PointF point)
Parameters
point
PointFThe point.
Returns
Deconstruct(out int, out int)
Deconstructs this point into two integers.
public void Deconstruct(out int x, out int y)
Parameters
Equals(Point)
public bool Equals(Point other)
Parameters
other
Point
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
Multiply(Point, int)
Translates a Point by the negative of a given value.
public static Point Multiply(Point point, int value)
Parameters
point
PointThe point on the left hand of the operand.
value
intThe value on the right hand of the operand.
Returns
Offset(Point)
Translates this Point by the specified amount.
public void Offset(Point point)
Parameters
Offset(int, int)
Translates this Point by the specified amount.
public void Offset(int dx, int dy)
Parameters
Round(PointF)
public static Point Round(PointF point)
Parameters
point
PointFThe point.
Returns
Round(Vector2)
public static Point Round(Vector2 vector)
Parameters
vector
Vector2The vector.
Returns
Subtract(Point, Size)
public static Point Subtract(Point point, Size size)
Parameters
point
PointThe point on the left hand of the operand.
size
SizeThe size on the right hand of the operand.
Returns
ToString()
public override string ToString()
Returns
Transform(Point, Matrix3x2)
Transforms a point by a specified 3x2 matrix.
public static Point Transform(Point point, Matrix3x2 matrix)
Parameters
Returns
Truncate(PointF)
public static Point Truncate(PointF point)
Parameters
point
PointFThe point.
Returns
Operators
operator +(Point, Size)
public static Point operator +(Point point, Size size)
Parameters
point
PointThe point on the left hand of the operand.
size
SizeThe size on the right hand of the operand.
Returns
operator /(Point, int)
public static Point operator /(Point left, int right)
Parameters
Returns
operator ==(Point, Point)
Compares two Point objects for equality.
public static bool operator ==(Point left, Point right)
Parameters
left
PointThe Point on the left side of the operand.
right
PointThe Point on the right side of the operand.
Returns
- bool
True if the current left is equal to the
right
parameter; otherwise, false.
explicit operator Size(Point)
public static explicit operator Size(Point point)
Parameters
point
PointThe point.
Returns
implicit operator PointF(Point)
public static implicit operator PointF(Point point)
Parameters
point
PointThe point.
Returns
implicit operator Vector2(Point)
public static implicit operator Vector2(Point point)
Parameters
point
PointThe point.
Returns
operator !=(Point, Point)
Compares two Point objects for inequality.
public static bool operator !=(Point left, Point right)
Parameters
left
PointThe Point on the left side of the operand.
right
PointThe Point on the right side of the operand.
Returns
- bool
True if the current left is unequal to the
right
parameter; otherwise, false.
operator *(Point, int)
public static Point operator *(Point left, int right)
Parameters
Returns
operator *(int, Point)
public static Point operator *(int left, Point right)
Parameters
Returns
operator -(Point, Size)
public static Point operator -(Point point, Size size)
Parameters
point
PointThe point on the left hand of the operand.
size
SizeThe size on the right hand of the operand.
Returns
operator -(Point)
Negates the given point by multiplying all values by -1.
public static Point operator -(Point value)
Parameters
value
PointThe source point.
Returns
- Point
The negated point.