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
| Improve this Doc View SourcePointF(SizeF)
Declaration
public PointF(SizeF size)
Parameters
Type | Name | Description |
---|---|---|
SizeF | size | The size. |
PointF(Single, Single)
Initializes a new instance of the PointF struct.
Declaration
public PointF(float x, float y)
Parameters
Type | Name | Description |
---|---|---|
Single | x | The horizontal position of the point. |
Single | y | The vertical position of the point. |
Fields
| Improve this Doc View SourceEmpty
Represents a PointF that has X and Y values set to zero.
Declaration
public static readonly PointF Empty
Field Value
Type | Description |
---|---|
PointF |
Properties
| Improve this Doc View SourceX
Gets or sets the x-coordinate of this PointF.
Declaration
public float X { readonly get; set; }
Property Value
Type | Description |
---|---|
Single |
Y
Gets or sets the y-coordinate of this PointF.
Declaration
public float Y { readonly get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
| Improve this Doc View SourceAdd(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 Single, out Single)
Deconstructs this point into two floats.
Declaration
public void Deconstruct(out float x, out float y)
Parameters
Type | Name | Description |
---|---|---|
Single | x | The out value for X. |
Single | y | The out value for Y. |
Equals(PointF)
Declaration
public bool Equals(PointF other)
Parameters
Type | Name | Description |
---|---|---|
PointF | other |
Returns
Type | Description |
---|---|
Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceGetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceMultiply(PointF, Single)
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. |
Single | 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(Single, Single)
Translates this PointF by the specified amount.
Declaration
public void Offset(float dx, float dy)
Parameters
Type | Name | Description |
---|---|---|
Single | dx | The amount to offset the x-coordinate. |
Single | 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()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
| Improve this Doc View SourceTransform(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
| Improve this Doc View SourceAddition(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. |
Addition(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. |
Division(PointF, Single)
Declaration
public static PointF operator /(PointF left, float right)
Parameters
Type | Name | Description |
---|---|---|
PointF | left | Dividend of type PointF. |
Single | right | Divisor of type Int32. |
Returns
Type | Description |
---|---|
PointF | Result of type PointF. |
Equality(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 |
---|---|
Boolean | True if the current left is equal to the |
Explicit(PointF to Point)
Declaration
public static explicit operator Point(PointF point)
Parameters
Type | Name | Description |
---|---|---|
PointF | point | The point. |
Returns
Type | Description |
---|---|
Point | The Point. |
Implicit(PointF to Vector2)
Declaration
public static implicit operator Vector2(PointF point)
Parameters
Type | Name | Description |
---|---|---|
PointF | point | The point. |
Returns
Type | Description |
---|---|
Vector2 | The Vector2. |
Implicit(Vector2 to PointF)
Declaration
public static implicit operator PointF(Vector2 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | vector | The vector. |
Returns
Type | Description |
---|---|
PointF | The Vector2. |
Inequality(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 |
---|---|
Boolean | True if the current left is unequal to the |
Multiply(PointF, Single)
Declaration
public static PointF operator *(PointF left, float right)
Parameters
Type | Name | Description |
---|---|---|
PointF | left | Multiplicand of type PointF. |
Single | right | Multiplier of type Single. |
Returns
Type | Description |
---|---|
PointF | Product of type SizeF. |
Multiply(Single, PointF)
Declaration
public static PointF operator *(float left, PointF right)
Parameters
Type | Name | Description |
---|---|---|
Single | left | Multiplier of type Single. |
PointF | right | Multiplicand of type SizeF. |
Returns
Type | Description |
---|---|
PointF | Product of type SizeF. |
Subtraction(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. |
Subtraction(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. |
UnaryNegation(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. |