Table of Contents

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

x int

The x-coordinate.

y int

The y-coordinate.

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

x int

Receives the x-coordinate.

y int

Receives the y-coordinate.

Equals(QrPoint)

Determines whether this point is equal to the specified point.

public bool Equals(QrPoint other)

Parameters

other QrPoint

The point to compare with.

Returns

bool

true if 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

obj object

The object to compare with.

Returns

bool

true if obj is a QrPoint with the same coordinates.

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

left QrPoint

The first point.

right QrPoint

The second point.

Returns

bool

true if 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

left QrPoint

The first point.

right QrPoint

The second point.

Returns

bool

true if the points differ in a coordinate.

See Also