Struct PointF
- Namespace
- SixLabors.ImageSharp
- Assembly
- SixLabors.ImageSharp.dll
Represents an ordered pair of single precision floating point x- and y-coordinates that defines a point in a two-dimensional plane.
public struct PointF : IEquatable<PointF>
- 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
PointF(SizeF)
public PointF(SizeF size)
Parameters
size
SizeFThe size.
PointF(float, float)
Initializes a new instance of the PointF struct.
public PointF(float x, float y)
Parameters
Fields
Empty
Represents a PointF that has X and Y values set to zero.
public static readonly PointF Empty
Field Value
Properties
X
Gets or sets the x-coordinate of this PointF.
public float X { readonly get; set; }
Property Value
Y
Gets or sets the y-coordinate of this PointF.
public float Y { readonly get; set; }
Property Value
Methods
Add(PointF, PointF)
public static PointF Add(PointF point, PointF pointb)
Parameters
point
PointFThe point on the left hand of the operand.
pointb
PointFThe point on the right hand of the operand.
Returns
Add(PointF, SizeF)
public static PointF Add(PointF point, SizeF size)
Parameters
point
PointFThe point on the left hand of the operand.
size
SizeFThe size on the right hand of the operand.
Returns
Deconstruct(out float, out float)
Deconstructs this point into two floats.
public void Deconstruct(out float x, out float y)
Parameters
Equals(PointF)
public bool Equals(PointF other)
Parameters
other
PointF
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
Multiply(PointF, float)
Translates a PointF by the multiplying the X and Y by the given value.
public static PointF Multiply(PointF point, float right)
Parameters
point
PointFThe point on the left hand of the operand.
right
floatThe value on the right hand of the operand.
Returns
Offset(PointF)
Translates this PointF by the specified amount.
public void Offset(PointF point)
Parameters
Offset(float, float)
Translates this PointF by the specified amount.
public void Offset(float dx, float dy)
Parameters
Subtract(PointF, PointF)
public static PointF Subtract(PointF point, PointF pointb)
Parameters
point
PointFThe point on the left hand of the operand.
pointb
PointFThe point on the right hand of the operand.
Returns
Subtract(PointF, SizeF)
public static PointF Subtract(PointF point, SizeF size)
Parameters
point
PointFThe point on the left hand of the operand.
size
SizeFThe size on the right hand of the operand.
Returns
ToString()
public override string ToString()
Returns
Transform(PointF, Matrix3x2)
Transforms a point by a specified 3x2 matrix.
public static PointF Transform(PointF point, Matrix3x2 matrix)
Parameters
Returns
Operators
operator +(PointF, PointF)
public static PointF operator +(PointF point, PointF size)
Parameters
point
PointFThe point on the left hand of the operand.
size
PointFThe size on the right hand of the operand.
Returns
operator +(PointF, SizeF)
public static PointF operator +(PointF point, SizeF size)
Parameters
point
PointFThe point on the left hand of the operand.
size
SizeFThe size on the right hand of the operand.
Returns
operator /(PointF, float)
public static PointF operator /(PointF left, float right)
Parameters
Returns
operator ==(PointF, PointF)
Compares two PointF objects for equality.
public static bool operator ==(PointF left, PointF right)
Parameters
left
PointFThe PointF on the left side of the operand.
right
PointFThe PointF on the right side of the operand.
Returns
- bool
True if the current left is equal to the
right
parameter; otherwise, false.
explicit operator Point(PointF)
public static explicit operator Point(PointF point)
Parameters
point
PointFThe point.
Returns
implicit operator Vector2(PointF)
public static implicit operator Vector2(PointF point)
Parameters
point
PointFThe point.
Returns
implicit operator PointF(Vector2)
public static implicit operator PointF(Vector2 vector)
Parameters
vector
Vector2The vector.
Returns
operator !=(PointF, PointF)
Compares two PointF objects for inequality.
public static bool operator !=(PointF left, PointF right)
Parameters
left
PointFThe PointF on the left side of the operand.
right
PointFThe PointF on the right side of the operand.
Returns
- bool
True if the current left is unequal to the
right
parameter; otherwise, false.
operator *(PointF, float)
public static PointF operator *(PointF left, float right)
Parameters
Returns
operator *(float, PointF)
public static PointF operator *(float left, PointF right)
Parameters
Returns
operator -(PointF, PointF)
public static PointF operator -(PointF point, PointF size)
Parameters
point
PointFThe point on the left hand of the operand.
size
PointFThe size on the right hand of the operand.
Returns
operator -(PointF, SizeF)
public static PointF operator -(PointF point, SizeF size)
Parameters
point
PointFThe point on the left hand of the operand.
size
SizeFThe size on the right hand of the operand.
Returns
operator -(PointF)
Negates the given point by multiplying all values by -1.
public static PointF operator -(PointF value)
Parameters
value
PointFThe source point.
Returns
- PointF
The negated point.