Struct QrPoint
- Namespace
- Net.Codecrete.QrCodeGenerator
- Assembly
- QrCodeGenerator.dll
A corner point of a QrPolygon.
The point lies on the grid of module corners: the top-left corner of the QR code is at (x=0, y=0), x extends to the right and y extends downwards. Each unit is one module (QR code pixel); no border is included. A coordinate therefore ranges from 0 to the size of the QR code — one more than the largest module coordinate, as a point names a corner, not a module.
public readonly struct QrPoint : IEquatable<QrPoint>
- Implements
- Inherited Members
Constructors
QrPoint(int, int)
Initializes a new point with the specified coordinates.
public QrPoint(int x, int y)
Parameters
Properties
X
The x-coordinate of this point.
public int X { get; }
Property Value
- int
The x-coordinate, in modules.
Y
The y-coordinate of this point.
public int Y { get; }
Property Value
- int
The y-coordinate, in modules.
Methods
Deconstruct(out int, out int)
Deconstructs this point into its coordinates.
public void Deconstruct(out int x, out int y)
Parameters
Equals(QrPoint)
Determines whether this point is equal to the specified point.
public bool Equals(QrPoint other)
Parameters
otherQrPointThe point to compare with.
Returns
- bool
trueif both points have the same coordinates.
Equals(object)
Determines whether this point is equal to the specified object.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with.
Returns
GetHashCode()
Returns the hash code for this point.
public override int GetHashCode()
Returns
- int
The hash code.
ToString()
Returns a string representation of this point.
public override string ToString()
Returns
- string
A string with the coordinates.
Operators
operator ==(QrPoint, QrPoint)
Determines whether two points are equal.
public static bool operator ==(QrPoint left, QrPoint right)
Parameters
Returns
- bool
trueif both points have the same coordinates.
operator !=(QrPoint, QrPoint)
Determines whether two points are not equal.
public static bool operator !=(QrPoint left, QrPoint right)
Parameters
Returns
- bool
trueif the points differ in a coordinate.