Class AffineTransformBuilder
A helper class for constructing Matrix3x2 instances for use in affine transforms.
Inherited Members
Namespace: SixLabors.ImageSharp.Processing
Assembly: SixLabors.ImageSharp.dll
Syntax
public class AffineTransformBuilderMethods
| Improve this Doc View SourceAppendMatrix(Matrix3x2)
Appends a raw matrix.
Declaration
public AffineTransformBuilder AppendMatrix(Matrix3x2 matrix)Parameters
| Type | Name | Description | 
|---|---|---|
| Matrix3x2 | matrix | The matrix to append. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
Exceptions
| Type | Condition | 
|---|---|
| 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(Single)
Appends a rotation matrix using the given rotation angle in degrees and the image center point as rotation center.
Declaration
public AffineTransformBuilder AppendRotationDegrees(float degrees)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | degrees | The amount of rotation, in degrees. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendRotationDegrees(Single, Vector2)
Appends a rotation matrix using the given rotation in degrees at the given origin.
Declaration
public AffineTransformBuilder AppendRotationDegrees(float degrees, Vector2 origin)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | degrees | The amount of rotation, in degrees. | 
| Vector2 | origin | The rotation origin point. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendRotationRadians(Single)
Appends a rotation matrix using the given rotation angle in radians and the image center point as rotation center.
Declaration
public AffineTransformBuilder AppendRotationRadians(float radians)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | radians | The amount of rotation, in radians. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendRotationRadians(Single, Vector2)
Appends a rotation matrix using the given rotation in radians at the given origin.
Declaration
public AffineTransformBuilder AppendRotationRadians(float radians, Vector2 origin)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | radians | The amount of rotation, in radians. | 
| Vector2 | origin | The rotation origin point. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendScale(SizeF)
Appends a scale matrix from the given vector scale.
Declaration
public AffineTransformBuilder AppendScale(SizeF scales)Parameters
| Type | Name | Description | 
|---|---|---|
| SizeF | scales | The horizontal and vertical scale. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendScale(Vector2)
Appends a scale matrix from the given vector scale.
Declaration
public AffineTransformBuilder AppendScale(Vector2 scales)Parameters
| Type | Name | Description | 
|---|---|---|
| Vector2 | scales | The horizontal and vertical scale. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendScale(Single)
Appends a scale matrix from the given uniform scale.
Declaration
public AffineTransformBuilder AppendScale(float scale)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | scale | The uniform scale. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendSkewDegrees(Single, Single)
Appends a centered skew matrix from the give angles in degrees.
Declaration
public AffineTransformBuilder AppendSkewDegrees(float degreesX, float degreesY)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | degreesX | The X angle, in degrees. | 
| Single | degreesY | The Y angle, in degrees. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendSkewDegrees(Single, Single, Vector2)
Appends a skew matrix using the given angles in degrees at the given origin.
Declaration
public AffineTransformBuilder AppendSkewDegrees(float degreesX, float degreesY, Vector2 origin)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | degreesX | The X angle, in degrees. | 
| Single | degreesY | The Y angle, in degrees. | 
| Vector2 | origin | The skew origin point. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendSkewRadians(Single, Single)
Appends a centered skew matrix from the give angles in radians.
Declaration
public AffineTransformBuilder AppendSkewRadians(float radiansX, float radiansY)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | radiansX | The X angle, in radians. | 
| Single | radiansY | The Y angle, in radians. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendSkewRadians(Single, Single, Vector2)
Appends a skew matrix using the given angles in radians at the given origin.
Declaration
public AffineTransformBuilder AppendSkewRadians(float radiansX, float radiansY, Vector2 origin)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | radiansX | The X angle, in radians. | 
| Single | radiansY | The Y angle, in radians. | 
| Vector2 | origin | The skew origin point. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendTranslation(PointF)
Appends a translation matrix from the given vector.
Declaration
public AffineTransformBuilder AppendTranslation(PointF position)Parameters
| Type | Name | Description | 
|---|---|---|
| PointF | position | The translation position. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
AppendTranslation(Vector2)
Appends a translation matrix from the given vector.
Declaration
public AffineTransformBuilder AppendTranslation(Vector2 position)Parameters
| Type | Name | Description | 
|---|---|---|
| Vector2 | position | The translation position. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
BuildMatrix(Rectangle)
Returns the combined matrix for a given source rectangle.
Declaration
public Matrix3x2 BuildMatrix(Rectangle sourceRectangle)Parameters
| Type | Name | Description | 
|---|---|---|
| Rectangle | sourceRectangle | The rectangle in the source image. | 
Returns
| Type | Description | 
|---|---|
| Matrix3x2 | The Matrix3x2. | 
Exceptions
| Type | Condition | 
|---|---|
| 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.
Declaration
public Matrix3x2 BuildMatrix(Size sourceSize)Parameters
| Type | Name | Description | 
|---|---|---|
| Size | sourceSize | The source image size. | 
Returns
| Type | Description | 
|---|---|
| Matrix3x2 | The Matrix3x2. | 
PrependMatrix(Matrix3x2)
Prepends a raw matrix.
Declaration
public AffineTransformBuilder PrependMatrix(Matrix3x2 matrix)Parameters
| Type | Name | Description | 
|---|---|---|
| Matrix3x2 | matrix | The matrix to prepend. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
Exceptions
| Type | Condition | 
|---|---|
| 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(Single)
Prepends a rotation matrix using the given rotation angle in degrees and the image center point as rotation center.
Declaration
public AffineTransformBuilder PrependRotationDegrees(float degrees)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | degrees | The amount of rotation, in degrees. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependRotationDegrees(Single, Vector2)
Prepends a rotation matrix using the given rotation in degrees at the given origin.
Declaration
public AffineTransformBuilder PrependRotationDegrees(float degrees, Vector2 origin)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | degrees | The amount of rotation, in degrees. | 
| Vector2 | origin | The rotation origin point. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependRotationRadians(Single)
Prepends a rotation matrix using the given rotation angle in radians and the image center point as rotation center.
Declaration
public AffineTransformBuilder PrependRotationRadians(float radians)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | radians | The amount of rotation, in radians. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependRotationRadians(Single, Vector2)
Prepends a rotation matrix using the given rotation in radians at the given origin.
Declaration
public AffineTransformBuilder PrependRotationRadians(float radians, Vector2 origin)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | radians | The amount of rotation, in radians. | 
| Vector2 | origin | The rotation origin point. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependScale(SizeF)
Prepends a scale matrix from the given vector scale.
Declaration
public AffineTransformBuilder PrependScale(SizeF scale)Parameters
| Type | Name | Description | 
|---|---|---|
| SizeF | scale | The horizontal and vertical scale. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependScale(Vector2)
Prepends a scale matrix from the given vector scale.
Declaration
public AffineTransformBuilder PrependScale(Vector2 scales)Parameters
| Type | Name | Description | 
|---|---|---|
| Vector2 | scales | The horizontal and vertical scale. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependScale(Single)
Prepends a scale matrix from the given uniform scale.
Declaration
public AffineTransformBuilder PrependScale(float scale)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | scale | The uniform scale. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependSkewDegrees(Single, Single)
Prepends a centered skew matrix from the give angles in degrees.
Declaration
public AffineTransformBuilder PrependSkewDegrees(float degreesX, float degreesY)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | degreesX | The X angle, in degrees. | 
| Single | degreesY | The Y angle, in degrees. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependSkewDegrees(Single, Single, Vector2)
Prepends a skew matrix using the given angles in degrees at the given origin.
Declaration
public AffineTransformBuilder PrependSkewDegrees(float degreesX, float degreesY, Vector2 origin)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | degreesX | The X angle, in degrees. | 
| Single | degreesY | The Y angle, in degrees. | 
| Vector2 | origin | The skew origin point. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependSkewRadians(Single, Single)
Prepends a centered skew matrix from the give angles in radians.
Declaration
public AffineTransformBuilder PrependSkewRadians(float radiansX, float radiansY)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | radiansX | The X angle, in radians. | 
| Single | radiansY | The Y angle, in radians. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependSkewRadians(Single, Single, Vector2)
Prepends a skew matrix using the given angles in radians at the given origin.
Declaration
public AffineTransformBuilder PrependSkewRadians(float radiansX, float radiansY, Vector2 origin)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | radiansX | The X angle, in radians. | 
| Single | radiansY | The Y angle, in radians. | 
| Vector2 | origin | The skew origin point. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependTranslation(PointF)
Prepends a translation matrix from the given vector.
Declaration
public AffineTransformBuilder PrependTranslation(PointF position)Parameters
| Type | Name | Description | 
|---|---|---|
| PointF | position | The translation position. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder | 
PrependTranslation(Vector2)
Prepends a translation matrix from the given vector.
Declaration
public AffineTransformBuilder PrependTranslation(Vector2 position)Parameters
| Type | Name | Description | 
|---|---|---|
| Vector2 | position | The translation position. | 
Returns
| Type | Description | 
|---|---|
| AffineTransformBuilder |