Table of Contents

Class AffineTransformBuilder

Namespace
SixLabors.ImageSharp.Processing
Assembly
SixLabors.ImageSharp.dll

A helper class for constructing Matrix3x2 instances for use in affine transforms.

public class AffineTransformBuilder
Inheritance
AffineTransformBuilder
Inherited Members

Constructors

AffineTransformBuilder()

public AffineTransformBuilder()

Methods

AppendMatrix(Matrix3x2)

Appends a raw matrix.

public AffineTransformBuilder AppendMatrix(Matrix3x2 matrix)

Parameters

matrix Matrix3x2

The matrix to append.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

Exceptions

DegenerateTransformException

The resultant matrix is degenerate containing one or more values equivalent to NaN or a zero determinant and therefore cannot be used for linear transforms.

AppendRotationDegrees(float)

Appends a rotation matrix using the given rotation angle in degrees and the image center point as rotation center.

public AffineTransformBuilder AppendRotationDegrees(float degrees)

Parameters

degrees float

The amount of rotation, in degrees.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendRotationDegrees(float, Vector2)

Appends a rotation matrix using the given rotation in degrees at the given origin.

public AffineTransformBuilder AppendRotationDegrees(float degrees, Vector2 origin)

Parameters

degrees float

The amount of rotation, in degrees.

origin Vector2

The rotation origin point.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendRotationRadians(float)

Appends a rotation matrix using the given rotation angle in radians and the image center point as rotation center.

public AffineTransformBuilder AppendRotationRadians(float radians)

Parameters

radians float

The amount of rotation, in radians.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendRotationRadians(float, Vector2)

Appends a rotation matrix using the given rotation in radians at the given origin.

public AffineTransformBuilder AppendRotationRadians(float radians, Vector2 origin)

Parameters

radians float

The amount of rotation, in radians.

origin Vector2

The rotation origin point.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendScale(SizeF)

Appends a scale matrix from the given vector scale.

public AffineTransformBuilder AppendScale(SizeF scales)

Parameters

scales SizeF

The horizontal and vertical scale.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendScale(Vector2)

Appends a scale matrix from the given vector scale.

public AffineTransformBuilder AppendScale(Vector2 scales)

Parameters

scales Vector2

The horizontal and vertical scale.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendScale(float)

Appends a scale matrix from the given uniform scale.

public AffineTransformBuilder AppendScale(float scale)

Parameters

scale float

The uniform scale.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendSkewDegrees(float, float)

Appends a centered skew matrix from the give angles in degrees.

public AffineTransformBuilder AppendSkewDegrees(float degreesX, float degreesY)

Parameters

degreesX float

The X angle, in degrees.

degreesY float

The Y angle, in degrees.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendSkewDegrees(float, float, Vector2)

Appends a skew matrix using the given angles in degrees at the given origin.

public AffineTransformBuilder AppendSkewDegrees(float degreesX, float degreesY, Vector2 origin)

Parameters

degreesX float

The X angle, in degrees.

degreesY float

The Y angle, in degrees.

origin Vector2

The skew origin point.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendSkewRadians(float, float)

Appends a centered skew matrix from the give angles in radians.

public AffineTransformBuilder AppendSkewRadians(float radiansX, float radiansY)

Parameters

radiansX float

The X angle, in radians.

radiansY float

The Y angle, in radians.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendSkewRadians(float, float, Vector2)

Appends a skew matrix using the given angles in radians at the given origin.

public AffineTransformBuilder AppendSkewRadians(float radiansX, float radiansY, Vector2 origin)

Parameters

radiansX float

The X angle, in radians.

radiansY float

The Y angle, in radians.

origin Vector2

The skew origin point.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendTranslation(PointF)

Appends a translation matrix from the given vector.

public AffineTransformBuilder AppendTranslation(PointF position)

Parameters

position PointF

The translation position.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

AppendTranslation(Vector2)

Appends a translation matrix from the given vector.

public AffineTransformBuilder AppendTranslation(Vector2 position)

Parameters

position Vector2

The translation position.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

BuildMatrix(Rectangle)

Returns the combined transform matrix for a given source rectangle.

public Matrix3x2 BuildMatrix(Rectangle sourceRectangle)

Parameters

sourceRectangle Rectangle

The rectangle in the source image.

Returns

Matrix3x2

The Matrix3x2.

Exceptions

DegenerateTransformException

The resultant matrix is degenerate containing one or more values equivalent to NaN or a zero determinant and therefore cannot be used for linear transforms.

BuildMatrix(Size)

Returns the combined matrix for a given source size.

public Matrix3x2 BuildMatrix(Size sourceSize)

Parameters

sourceSize Size

The source image size.

Returns

Matrix3x2

The Matrix3x2.

GetTransformedSize(Rectangle)

Returns the size of a rectangle large enough to contain the transformed source rectangle.

public Size GetTransformedSize(Rectangle sourceRectangle)

Parameters

sourceRectangle Rectangle

The rectangle in the source image.

Returns

Size

The Size.

Exceptions

DegenerateTransformException

The resultant matrix is degenerate containing one or more values equivalent to NaN or a zero determinant and therefore cannot be used for linear transforms.

PrependMatrix(Matrix3x2)

Prepends a raw matrix.

public AffineTransformBuilder PrependMatrix(Matrix3x2 matrix)

Parameters

matrix Matrix3x2

The matrix to prepend.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

Exceptions

DegenerateTransformException

The resultant matrix is degenerate containing one or more values equivalent to NaN or a zero determinant and therefore cannot be used for linear transforms.

PrependRotationDegrees(float)

Prepends a rotation matrix using the given rotation angle in degrees and the image center point as rotation center.

public AffineTransformBuilder PrependRotationDegrees(float degrees)

Parameters

degrees float

The amount of rotation, in degrees.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependRotationDegrees(float, Vector2)

Prepends a rotation matrix using the given rotation in degrees at the given origin.

public AffineTransformBuilder PrependRotationDegrees(float degrees, Vector2 origin)

Parameters

degrees float

The amount of rotation, in degrees.

origin Vector2

The rotation origin point.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependRotationRadians(float)

Prepends a rotation matrix using the given rotation angle in radians and the image center point as rotation center.

public AffineTransformBuilder PrependRotationRadians(float radians)

Parameters

radians float

The amount of rotation, in radians.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependRotationRadians(float, Vector2)

Prepends a rotation matrix using the given rotation in radians at the given origin.

public AffineTransformBuilder PrependRotationRadians(float radians, Vector2 origin)

Parameters

radians float

The amount of rotation, in radians.

origin Vector2

The rotation origin point.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependScale(SizeF)

Prepends a scale matrix from the given vector scale.

public AffineTransformBuilder PrependScale(SizeF scale)

Parameters

scale SizeF

The horizontal and vertical scale.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependScale(Vector2)

Prepends a scale matrix from the given vector scale.

public AffineTransformBuilder PrependScale(Vector2 scales)

Parameters

scales Vector2

The horizontal and vertical scale.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependScale(float)

Prepends a scale matrix from the given uniform scale.

public AffineTransformBuilder PrependScale(float scale)

Parameters

scale float

The uniform scale.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependSkewDegrees(float, float)

Prepends a centered skew matrix from the give angles in degrees.

public AffineTransformBuilder PrependSkewDegrees(float degreesX, float degreesY)

Parameters

degreesX float

The X angle, in degrees.

degreesY float

The Y angle, in degrees.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependSkewDegrees(float, float, Vector2)

Prepends a skew matrix using the given angles in degrees at the given origin.

public AffineTransformBuilder PrependSkewDegrees(float degreesX, float degreesY, Vector2 origin)

Parameters

degreesX float

The X angle, in degrees.

degreesY float

The Y angle, in degrees.

origin Vector2

The skew origin point.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependSkewRadians(float, float)

Prepends a centered skew matrix from the give angles in radians.

public AffineTransformBuilder PrependSkewRadians(float radiansX, float radiansY)

Parameters

radiansX float

The X angle, in radians.

radiansY float

The Y angle, in radians.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependSkewRadians(float, float, Vector2)

Prepends a skew matrix using the given angles in radians at the given origin.

public AffineTransformBuilder PrependSkewRadians(float radiansX, float radiansY, Vector2 origin)

Parameters

radiansX float

The X angle, in radians.

radiansY float

The Y angle, in radians.

origin Vector2

The skew origin point.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependTranslation(PointF)

Prepends a translation matrix from the given vector.

public AffineTransformBuilder PrependTranslation(PointF position)

Parameters

position PointF

The translation position.

Returns

AffineTransformBuilder

The AffineTransformBuilder.

PrependTranslation(Vector2)

Prepends a translation matrix from the given vector.

public AffineTransformBuilder PrependTranslation(Vector2 position)

Parameters

position Vector2

The translation position.

Returns

AffineTransformBuilder

The AffineTransformBuilder.