PdfMatrix Struct

A transformation matrix [a b c d e f] (ISO 32000-2, 8.3.4): a point (x, y) becomes (a\*x + c\*y + e, b\*x + d\*y + f).

public readonly struct PdfMatrix : IEquatable<PdfMatrix>
Implements

Constructors

NameDescription
PdfMatrix(double, double, double, double, double, double)Initializes a new instance of the PdfMatrix struct.

PdfMatrix(double, double, double, double, double, double)

PdfMatrix.cs

Initializes a new instance of the PdfMatrix struct.

public PdfMatrix(double a, double b, double c, double d, double e, double f)

Parameters

a double
The a value.
b double
The b value.
c double
The c value.
d double
The d value.
e double
The e value (horizontal translation).
f double
The f value (vertical translation).

Properties

NameDescription
AGets the a value.
BGets the b value.
CGets the c value.
DGets the d value.
EGets the e value (horizontal translation).
FGets the f value (vertical translation).
IdentityGets the identity matrix.

Gets the a value.

public double A { get; }

Property value

double

Gets the b value.

public double B { get; }

Property value

double

Gets the c value.

public double C { get; }

Property value

double

Gets the d value.

public double D { get; }

Property value

double

Gets the e value (horizontal translation).

public double E { get; }

Property value

double

Gets the f value (vertical translation).

public double F { get; }

Property value

double

Identity

PdfMatrix.cs

Gets the identity matrix.

public static PdfMatrix Identity { get; }

Property value

PdfMatrix

Methods

NameDescription
CreateRotation(double)Creates a counterclockwise rotation.
CreateScale(double, double)Creates a scaling.
CreateTranslation(double, double)Creates a translation.
Equals(PdfMatrix)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
GetHashCode()Returns the hash code for this instance.
Multiply(PdfMatrix, PdfMatrix)Multiplies two matrices: the result applies left first, then right.
ToString()Returns the fully qualified type name of this instance.
Transform(double, double)Transforms a point.
TransformVector(double, double)Transforms a vector: the translation is not applied.
TryInvert(PdfMatrix)Inverts the matrix.

CreateRotation(double)

PdfMatrix.cs

Creates a counterclockwise rotation.

public static PdfMatrix CreateRotation(double degrees)

Parameters

degrees double
The angle in degrees.

Returns

PdfMatrix The matrix.

CreateScale(double, double)

PdfMatrix.cs

Creates a scaling.

public static PdfMatrix CreateScale(double x, double y)

Parameters

x double
The horizontal scale.
y double
The vertical scale.

Returns

PdfMatrix The matrix.

CreateTranslation(double, double)

PdfMatrix.cs

Creates a translation.

public static PdfMatrix CreateTranslation(double x, double y)

Parameters

x double
The horizontal translation.
y double
The vertical translation.

Returns

PdfMatrix The matrix.

Equals overloads

Equals(PdfMatrix)

PdfMatrix.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(PdfMatrix other)
Parameters
other PdfMatrix
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

PdfMatrix.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

PdfMatrix.cs

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

Multiply(PdfMatrix, PdfMatrix)

PdfMatrix.cs

Multiplies two matrices: the result applies left first, then right.

public static PdfMatrix Multiply(PdfMatrix left, PdfMatrix right)

Parameters

left PdfMatrix
The first transformation.
right PdfMatrix
The second transformation.

Returns

PdfMatrix The product.

ToString()

PdfMatrix.cs

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string The fully qualified type name.

Transform(double, double)

PdfMatrix.cs

Transforms a point.

public (double X, double Y) Transform(double x, double y)

Parameters

x double
The x coordinate.
y double
The y coordinate.

Returns

(double X, double Y) The transformed point.

TransformVector(double, double)

PdfMatrix.cs

Transforms a vector: the translation is not applied.

public (double X, double Y) TransformVector(double x, double y)

Parameters

x double
The x component.
y double
The y component.

Returns

(double X, double Y) The transformed vector.

TryInvert(PdfMatrix)

PdfMatrix.cs

Inverts the matrix.

public bool TryInvert(out PdfMatrix result)

Parameters

result PdfMatrix
The inverse.

Returns

bool true when the matrix can be inverted.

Operators

NameDescription
operator ==(PdfMatrix, PdfMatrix)Indicates whether two matrices are equal.
operator !=(PdfMatrix, PdfMatrix)Indicates whether two matrices are different.
operator *(PdfMatrix, PdfMatrix)Multiplies two matrices: the result applies left first, then right.

operator ==(PdfMatrix, PdfMatrix)

PdfMatrix.cs

Indicates whether two matrices are equal.

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

Parameters

left PdfMatrix
The first matrix.
right PdfMatrix
The second matrix.

Returns

bool true when the matrices are equal.

operator !=(PdfMatrix, PdfMatrix)

PdfMatrix.cs

Indicates whether two matrices are different.

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

Parameters

left PdfMatrix
The first matrix.
right PdfMatrix
The second matrix.

Returns

bool true when the matrices are different.

operator *(PdfMatrix, PdfMatrix)

PdfMatrix.cs

Multiplies two matrices: the result applies left first, then right.

public static PdfMatrix operator *(PdfMatrix left, PdfMatrix right)

Parameters

left PdfMatrix
The first transformation.
right PdfMatrix
The second transformation.

Returns

PdfMatrix The product.