Table of Contents

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)

Initializes a new instance of the PointF struct from the given SizeF.

public PointF(SizeF size)

Parameters

size SizeF

The size.

PointF(float, float)

Initializes a new instance of the PointF struct.

public PointF(float x, float y)

Parameters

x float

The horizontal position of the point.

y float

The vertical position of the point.

Fields

Empty

Represents a PointF that has X and Y values set to zero.

public static readonly PointF Empty

Field Value

PointF

Properties

X

Gets or sets the x-coordinate of this PointF.

public float X { readonly get; set; }

Property Value

float

Y

Gets or sets the y-coordinate of this PointF.

public float Y { readonly get; set; }

Property Value

float

Methods

Add(PointF, PointF)

Translates a PointF by the given PointF.

public static PointF Add(PointF point, PointF pointb)

Parameters

point PointF

The point on the left hand of the operand.

pointb PointF

The point on the right hand of the operand.

Returns

PointF

The PointF.

Add(PointF, SizeF)

Translates a PointF by the given SizeF.

public static PointF Add(PointF point, SizeF size)

Parameters

point PointF

The point on the left hand of the operand.

size SizeF

The size on the right hand of the operand.

Returns

PointF

The PointF.

Deconstruct(out float, out float)

Deconstructs this point into two floats.

public void Deconstruct(out float x, out float y)

Parameters

x float

The out value for X.

y float

The out value for Y.

Equals(PointF)

public bool Equals(PointF other)

Parameters

other PointF

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

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 PointF

The point on the left hand of the operand.

right float

The value on the right hand of the operand.

Returns

PointF

The PointF.

Offset(PointF)

Translates this PointF by the specified amount.

public void Offset(PointF point)

Parameters

point PointF

The PointF used offset this PointF.

Offset(float, float)

Translates this PointF by the specified amount.

public void Offset(float dx, float dy)

Parameters

dx float

The amount to offset the x-coordinate.

dy float

The amount to offset the y-coordinate.

Subtract(PointF, PointF)

Translates a PointF by the negative of a given PointF.

public static PointF Subtract(PointF point, PointF pointb)

Parameters

point PointF

The point on the left hand of the operand.

pointb PointF

The point on the right hand of the operand.

Returns

PointF

The PointF.

Subtract(PointF, SizeF)

Translates a PointF by the negative of a given SizeF.

public static PointF Subtract(PointF point, SizeF size)

Parameters

point PointF

The point on the left hand of the operand.

size SizeF

The size on the right hand of the operand.

Returns

PointF

The PointF.

ToString()

public override string ToString()

Returns

string

Transform(PointF, Matrix3x2)

Transforms a point by a specified 3x2 matrix.

public static PointF Transform(PointF point, Matrix3x2 matrix)

Parameters

point PointF

The point to transform.

matrix Matrix3x2

The transformation matrix used.

Returns

PointF

The transformed PointF.

Operators

operator +(PointF, PointF)

Translates a PointF by a given SizeF.

public static PointF operator +(PointF point, PointF size)

Parameters

point PointF

The point on the left hand of the operand.

size PointF

The size on the right hand of the operand.

Returns

PointF

The PointF.

operator +(PointF, SizeF)

Translates a PointF by a given SizeF.

public static PointF operator +(PointF point, SizeF size)

Parameters

point PointF

The point on the left hand of the operand.

size SizeF

The size on the right hand of the operand.

Returns

PointF

The PointF.

operator /(PointF, float)

Divides PointF by a float producing SizeF.

public static PointF operator /(PointF left, float right)

Parameters

left PointF

Dividend of type PointF.

right float

Divisor of type int.

Returns

PointF

Result of type PointF.

operator ==(PointF, PointF)

Compares two PointF objects for equality.

public static bool operator ==(PointF left, PointF right)

Parameters

left PointF

The PointF on the left side of the operand.

right PointF

The 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)

Creates a Point with the coordinates of the specified PointF by truncating each of the coordinates.

public static explicit operator Point(PointF point)

Parameters

point PointF

The point.

Returns

Point

The Point.

implicit operator Vector2(PointF)

Creates a Vector2 with the coordinates of the specified PointF.

public static implicit operator Vector2(PointF point)

Parameters

point PointF

The point.

Returns

Vector2

The Vector2.

implicit operator PointF(Vector2)

Creates a Vector2 with the coordinates of the specified PointF.

public static implicit operator PointF(Vector2 vector)

Parameters

vector Vector2

The vector.

Returns

PointF

The Vector2.

operator !=(PointF, PointF)

Compares two PointF objects for inequality.

public static bool operator !=(PointF left, PointF right)

Parameters

left PointF

The PointF on the left side of the operand.

right PointF

The 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)

Multiplies PointF by a float producing SizeF.

public static PointF operator *(PointF left, float right)

Parameters

left PointF

Multiplicand of type PointF.

right float

Multiplier of type float.

Returns

PointF

Product of type SizeF.

operator *(float, PointF)

Multiplies PointF by a float producing SizeF.

public static PointF operator *(float left, PointF right)

Parameters

left float

Multiplier of type float.

right PointF

Multiplicand of type SizeF.

Returns

PointF

Product of type SizeF.

operator -(PointF, PointF)

Translates a PointF by the negative of a given SizeF.

public static PointF operator -(PointF point, PointF size)

Parameters

point PointF

The point on the left hand of the operand.

size PointF

The size on the right hand of the operand.

Returns

PointF

The PointF.

operator -(PointF, SizeF)

Translates a PointF by the negative of a given SizeF.

public static PointF operator -(PointF point, SizeF size)

Parameters

point PointF

The point on the left hand of the operand.

size SizeF

The size on the right hand of the operand.

Returns

PointF

The PointF.

operator -(PointF)

Negates the given point by multiplying all values by -1.

public static PointF operator -(PointF value)

Parameters

value PointF

The source point.

Returns

PointF

The negated point.