Struct PointF
Represents an ordered pair of single precision floating point x- and y-coordinates that defines a point in a two-dimensional plane.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp
Assembly: SixLabors.ImageSharp.dll
Syntax
public struct PointF : IEquatable<PointF>
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)
Declaration
public PointF(SizeF size)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeF | size | The size. |
PointF(float, float)
Initializes a new instance of the PointF struct.
Declaration
public PointF(float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The horizontal position of the point. |
| float | y | The vertical position of the point. |
Fields
Empty
Represents a PointF that has X and Y values set to zero.
Declaration
public static readonly PointF Empty
Field Value
| Type | Description |
|---|---|
| PointF |
Properties
X
Gets or sets the x-coordinate of this PointF.
Declaration
public float X { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Y
Gets or sets the y-coordinate of this PointF.
Declaration
public float Y { readonly get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
Add(PointF, PointF)
Declaration
public static PointF Add(PointF point, PointF pointb)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point on the left hand of the operand. |
| PointF | pointb | The point on the right hand of the operand. |
Returns
| Type | Description |
|---|---|
| PointF | The PointF. |
Add(PointF, SizeF)
Declaration
public static PointF Add(PointF point, SizeF size)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point on the left hand of the operand. |
| SizeF | size | The size on the right hand of the operand. |
Returns
| Type | Description |
|---|---|
| PointF | The PointF. |
Deconstruct(out float, out float)
Deconstructs this point into two floats.
Declaration
public void Deconstruct(out float x, out float y)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The out value for X. |
| float | y | The out value for Y. |
Equals(PointF)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(PointF other)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to the |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool | true if |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
Multiply(PointF, float)
Translates a PointF by the multiplying the X and Y by the given value.
Declaration
public static PointF Multiply(PointF point, float right)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point on the left hand of the operand. |
| float | right | The value on the right hand of the operand. |
Returns
| Type | Description |
|---|---|
| PointF | The PointF. |
Offset(PointF)
Translates this PointF by the specified amount.
Declaration
public void Offset(PointF point)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point |
Offset(float, float)
Translates this PointF by the specified amount.
Declaration
public void Offset(float dx, float dy)
Parameters
| Type | Name | Description |
|---|---|---|
| float | dx | The amount to offset the x-coordinate. |
| float | dy | The amount to offset the y-coordinate. |
Subtract(PointF, PointF)
Declaration
public static PointF Subtract(PointF point, PointF pointb)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point on the left hand of the operand. |
| PointF | pointb | The point on the right hand of the operand. |
Returns
| Type | Description |
|---|---|
| PointF | The PointF. |
Subtract(PointF, SizeF)
Declaration
public static PointF Subtract(PointF point, SizeF size)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point on the left hand of the operand. |
| SizeF | size | The size on the right hand of the operand. |
Returns
| Type | Description |
|---|---|
| PointF | The PointF. |
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The fully qualified type name. |
Overrides
Transform(PointF, Matrix3x2)
Transforms a point by a specified 3x2 matrix.
Declaration
public static PointF Transform(PointF point, Matrix3x2 matrix)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point to transform. |
| Matrix3x2 | matrix | The transformation matrix used. |
Returns
| Type | Description |
|---|---|
| PointF | The transformed PointF. |
Operators
operator +(PointF, PointF)
Declaration
public static PointF operator +(PointF point, PointF size)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point on the left hand of the operand. |
| PointF | size | The size on the right hand of the operand. |
Returns
| Type | Description |
|---|---|
| PointF | The PointF. |
operator +(PointF, SizeF)
Declaration
public static PointF operator +(PointF point, SizeF size)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point on the left hand of the operand. |
| SizeF | size | The size on the right hand of the operand. |
Returns
| Type | Description |
|---|---|
| PointF | The PointF. |
operator /(PointF, float)
Declaration
public static PointF operator /(PointF left, float right)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | left | Dividend of type PointF. |
| float | right | Divisor of type int. |
Returns
| Type | Description |
|---|---|
| PointF | Result of type PointF. |
operator ==(PointF, PointF)
Compares two PointF objects for equality.
Declaration
public static bool operator ==(PointF left, PointF right)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | left | The PointF on the left side of the operand. |
| PointF | right | The PointF on the right side of the operand. |
Returns
| Type | Description |
|---|---|
| bool | True if the current left is equal to the |
explicit operator Point(PointF)
Declaration
public static explicit operator Point(PointF point)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point. |
Returns
| Type | Description |
|---|---|
| Point | The Point. |
implicit operator Vector2(PointF)
Declaration
public static implicit operator Vector2(PointF point)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point. |
Returns
| Type | Description |
|---|---|
| Vector2 | The Vector2. |
implicit operator PointF(Vector2)
Declaration
public static implicit operator PointF(Vector2 vector)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | vector | The vector. |
Returns
| Type | Description |
|---|---|
| PointF | The Vector2. |
operator !=(PointF, PointF)
Compares two PointF objects for inequality.
Declaration
public static bool operator !=(PointF left, PointF right)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | left | The PointF on the left side of the operand. |
| PointF | right | The PointF on the right side of the operand. |
Returns
| Type | Description |
|---|---|
| bool | True if the current left is unequal to the |
operator *(PointF, float)
Declaration
public static PointF operator *(PointF left, float right)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | left | Multiplicand of type PointF. |
| float | right | Multiplier of type float. |
Returns
| Type | Description |
|---|---|
| PointF | Product of type SizeF. |
operator *(float, PointF)
Declaration
public static PointF operator *(float left, PointF right)
Parameters
| Type | Name | Description |
|---|---|---|
| float | left | Multiplier of type float. |
| PointF | right | Multiplicand of type SizeF. |
Returns
| Type | Description |
|---|---|
| PointF | Product of type SizeF. |
operator -(PointF, PointF)
Declaration
public static PointF operator -(PointF point, PointF size)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point on the left hand of the operand. |
| PointF | size | The size on the right hand of the operand. |
Returns
| Type | Description |
|---|---|
| PointF | The PointF. |
operator -(PointF, SizeF)
Declaration
public static PointF operator -(PointF point, SizeF size)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | point | The point on the left hand of the operand. |
| SizeF | size | The size on the right hand of the operand. |
Returns
| Type | Description |
|---|---|
| PointF | The PointF. |
operator -(PointF)
Negates the given point by multiplying all values by -1.
Declaration
public static PointF operator -(PointF value)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | value | The source point. |
Returns
| Type | Description |
|---|---|
| PointF | The negated point. |