Table of Contents

Struct TransformationMatrix

Namespace
UglyToad.PdfPig.Core
Assembly
UglyToad.PdfPig.Core.dll

Specifies the conversion from the transformed coordinate space to the original untransformed coordinate space.

public struct TransformationMatrix
Inherited Members

Constructors

TransformationMatrix(double, double, double, double, double, double, double, double, double)

Create a new TransformationMatrix.

public TransformationMatrix(double a, double b, double r1, double c, double d, double r2, double e, double f, double r3)

Parameters

a double
b double
r1 double
c double
d double
r2 double
e double
f double
r3 double

TransformationMatrix(double[])

Create a new TransformationMatrix.

public TransformationMatrix(double[] value)

Parameters

value double[]

The 9 values of the matrix.

Fields

A

The value at (0, 0) - The scale for the X dimension.

public readonly double A

Field Value

double

B

The value at (0, 1).

public readonly double B

Field Value

double

C

The value at (1, 0).

public readonly double C

Field Value

double

Columns

The number of columns in the matrix.

public const int Columns = 3

Field Value

int

D

The value at (1, 1) - The scale for the Y dimension.

public readonly double D

Field Value

double

E

The value at (2, 0) - translation in X.

public readonly double E

Field Value

double

F

The value at (2, 1) - translation in Y.

public readonly double F

Field Value

double

Identity

The default TransformationMatrix.

public static TransformationMatrix Identity

Field Value

TransformationMatrix

Rows

The number of rows in the matrix.

public const int Rows = 3

Field Value

int

Properties

this[int, int]

Get the value at the specific row and column.

public double this[int row, int col] { get; }

Parameters

row int
col int

Property Value

double

Methods

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(TransformationMatrix, TransformationMatrix)

Determines whether 2 transformation matrices are equal.

public static bool Equals(TransformationMatrix a, TransformationMatrix b)

Parameters

a TransformationMatrix
b TransformationMatrix

Returns

bool

FromArray(decimal[])

Create a new TransformationMatrix from the values.

public static TransformationMatrix FromArray(decimal[] values)

Parameters

values decimal[]

Either all 9 values of the matrix, 6 values in the default PDF order or the 4 values of the top left square.

Returns

TransformationMatrix

FromArray(double[])

Create a new TransformationMatrix from the values.

public static TransformationMatrix FromArray(double[] values)

Parameters

values double[]

Either all 9 values of the matrix, 6 values in the default PDF order or the 4 values of the top left square.

Returns

TransformationMatrix

FromValues(double, double, double, double)

Create a new TransformationMatrix from the 4 values provided in the default PDF order.

public static TransformationMatrix FromValues(double a, double b, double c, double d)

Parameters

a double
b double
c double
d double

Returns

TransformationMatrix

FromValues(double, double, double, double, double, double)

Create a new TransformationMatrix from the 6 values provided in the default PDF order.

public static TransformationMatrix FromValues(double a, double b, double c, double d, double e, double f)

Parameters

a double
b double
c double
d double
e double
f double

Returns

TransformationMatrix

GetHashCode()

public override int GetHashCode()

Returns

int

GetRotationMatrix(double)

Create a new TransformationMatrix with the X and Y scaling values set.

public static TransformationMatrix GetRotationMatrix(double degreesCounterclockwise)

Parameters

degreesCounterclockwise double

Returns

TransformationMatrix

GetScaleMatrix(double, double)

Create a new TransformationMatrix with the X and Y scaling values set.

public static TransformationMatrix GetScaleMatrix(double scaleX, double scaleY)

Parameters

scaleX double
scaleY double

Returns

TransformationMatrix

GetTranslationMatrix(double, double)

Create a new TransformationMatrix with the X and Y translation values set.

public static TransformationMatrix GetTranslationMatrix(double x, double y)

Parameters

x double
y double

Returns

TransformationMatrix

Inverse()

Get the inverse of the current matrix.

public TransformationMatrix Inverse()

Returns

TransformationMatrix

Multiply(double)

Multiplies the matrix by a scalar value without modifying this matrix.

public TransformationMatrix Multiply(double scalar)

Parameters

scalar double

The value to multiply.

Returns

TransformationMatrix

A new matrix which is multiplied by the scalar value.

Multiply(TransformationMatrix)

Multiplies one transformation matrix by another without modifying either matrix. Order is: (this * matrix).

public TransformationMatrix Multiply(TransformationMatrix matrix)

Parameters

matrix TransformationMatrix

The matrix to multiply

Returns

TransformationMatrix

The resulting matrix.

ToString()

public override string ToString()

Returns

string

Transform(IEnumerable<PdfSubpath>)

Transform a path using this transformation matrix.

public IEnumerable<PdfSubpath> Transform(IEnumerable<PdfSubpath> path)

Parameters

path IEnumerable<PdfSubpath>

The original path.

Returns

IEnumerable<PdfSubpath>

A new path which is the result of applying this transformation matrix.

Transform(PdfPoint)

Transform a point using this transformation matrix.

public PdfPoint Transform(PdfPoint original)

Parameters

original PdfPoint

The original point.

Returns

PdfPoint

A new point which is the result of applying this transformation matrix.

Transform(PdfRectangle)

Transform a rectangle using this transformation matrix.

public PdfRectangle Transform(PdfRectangle original)

Parameters

original PdfRectangle

The original rectangle.

Returns

PdfRectangle

A new rectangle which is the result of applying this transformation matrix.

Transform(PdfSubpath)

Transform a subpath using this transformation matrix.

public PdfSubpath Transform(PdfSubpath subpath)

Parameters

subpath PdfSubpath

The original subpath.

Returns

PdfSubpath

A new subpath which is the result of applying this transformation matrix.

TransformX(double)

Transform an X coordinate using this transformation matrix.

public double TransformX(double x)

Parameters

x double

The X coordinate.

Returns

double

The transformed X coordinate.

Translate(double, double)

Generate a TransformationMatrix translated by the specified amount.

public TransformationMatrix Translate(double x, double y)

Parameters

x double
y double

Returns

TransformationMatrix