Table of Contents

Class ProjectiveTransformBuilder

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

A helper class for constructing Matrix4x4 instances for use in projective transforms.

public class ProjectiveTransformBuilder
Inheritance
ProjectiveTransformBuilder
Inherited Members

Constructors

ProjectiveTransformBuilder()

public ProjectiveTransformBuilder()

Methods

AppendMatrix(Matrix4x4)

Appends a raw matrix.

public ProjectiveTransformBuilder AppendMatrix(Matrix4x4 matrix)

Parameters

matrix Matrix4x4

The matrix to append.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

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 centered rotation matrix using the given rotation in degrees.

public ProjectiveTransformBuilder AppendRotationDegrees(float degrees)

Parameters

degrees float

The amount of rotation, in degrees.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

AppendRotationRadians(float)

Appends a centered rotation matrix using the given rotation in radians.

public ProjectiveTransformBuilder AppendRotationRadians(float radians)

Parameters

radians float

The amount of rotation, in radians.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

AppendScale(SizeF)

Appends a scale matrix from the given vector scale.

public ProjectiveTransformBuilder AppendScale(SizeF scales)

Parameters

scales SizeF

The horizontal and vertical scale.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

AppendScale(Vector2)

Appends a scale matrix from the given vector scale.

public ProjectiveTransformBuilder AppendScale(Vector2 scales)

Parameters

scales Vector2

The horizontal and vertical scale.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

AppendScale(float)

Appends a scale matrix from the given uniform scale.

public ProjectiveTransformBuilder AppendScale(float scale)

Parameters

scale float

The uniform scale.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

AppendSkewDegrees(float, float, Vector2)

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

public ProjectiveTransformBuilder 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

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

AppendSkewRadians(float, float)

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

public ProjectiveTransformBuilder AppendSkewRadians(float radiansX, float radiansY)

Parameters

radiansX float

The X angle, in radians.

radiansY float

The Y angle, in radians.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

AppendSkewRadians(float, float, Vector2)

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

public ProjectiveTransformBuilder 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

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

AppendTaper(TaperSide, TaperCorner, float)

Appends a matrix that performs a tapering projective transform.

public ProjectiveTransformBuilder AppendTaper(TaperSide side, TaperCorner corner, float fraction)

Parameters

side TaperSide

An enumeration that indicates the side of the rectangle that tapers.

corner TaperCorner

An enumeration that indicates on which corners to taper the rectangle.

fraction float

The amount to taper.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

AppendTranslation(PointF)

Appends a translation matrix from the given vector.

public ProjectiveTransformBuilder AppendTranslation(PointF position)

Parameters

position PointF

The translation position.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

AppendTranslation(Vector2)

Appends a translation matrix from the given vector.

public ProjectiveTransformBuilder AppendTranslation(Vector2 position)

Parameters

position Vector2

The translation position.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

BuildMatrix(Rectangle)

Returns the combined matrix for a given source rectangle.

public Matrix4x4 BuildMatrix(Rectangle sourceRectangle)

Parameters

sourceRectangle Rectangle

The rectangle in the source image.

Returns

Matrix4x4

The Matrix4x4.

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 Matrix4x4 BuildMatrix(Size sourceSize)

Parameters

sourceSize Size

The source image size.

Returns

Matrix4x4

The Matrix4x4.

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(Matrix4x4)

Prepends a raw matrix.

public ProjectiveTransformBuilder PrependMatrix(Matrix4x4 matrix)

Parameters

matrix Matrix4x4

The matrix to prepend.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

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 centered rotation matrix using the given rotation in degrees.

public ProjectiveTransformBuilder PrependRotationDegrees(float degrees)

Parameters

degrees float

The amount of rotation, in degrees.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

PrependRotationRadians(float)

Prepends a centered rotation matrix using the given rotation in radians.

public ProjectiveTransformBuilder PrependRotationRadians(float radians)

Parameters

radians float

The amount of rotation, in radians.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

PrependScale(SizeF)

Prepends a scale matrix from the given vector scale.

public ProjectiveTransformBuilder PrependScale(SizeF scale)

Parameters

scale SizeF

The horizontal and vertical scale.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

PrependScale(Vector2)

Prepends a scale matrix from the given vector scale.

public ProjectiveTransformBuilder PrependScale(Vector2 scales)

Parameters

scales Vector2

The horizontal and vertical scale.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

PrependScale(float)

Prepends a scale matrix from the given uniform scale.

public ProjectiveTransformBuilder PrependScale(float scale)

Parameters

scale float

The uniform scale.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

PrependSkewDegrees(float, float, Vector2)

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

public ProjectiveTransformBuilder 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

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

PrependSkewRadians(float, float)

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

public ProjectiveTransformBuilder PrependSkewRadians(float radiansX, float radiansY)

Parameters

radiansX float

The X angle, in radians.

radiansY float

The Y angle, in radians.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

PrependSkewRadians(float, float, Vector2)

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

public ProjectiveTransformBuilder 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

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

PrependTaper(TaperSide, TaperCorner, float)

Prepends a matrix that performs a tapering projective transform.

public ProjectiveTransformBuilder PrependTaper(TaperSide side, TaperCorner corner, float fraction)

Parameters

side TaperSide

An enumeration that indicates the side of the rectangle that tapers.

corner TaperCorner

An enumeration that indicates on which corners to taper the rectangle.

fraction float

The amount to taper.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

PrependTranslation(PointF)

Prepends a translation matrix from the given vector.

public ProjectiveTransformBuilder PrependTranslation(PointF position)

Parameters

position PointF

The translation position.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.

PrependTranslation(Vector2)

Prepends a translation matrix from the given vector.

public ProjectiveTransformBuilder PrependTranslation(Vector2 position)

Parameters

position Vector2

The translation position.

Returns

ProjectiveTransformBuilder

The ProjectiveTransformBuilder.