Class ProjectiveTransformBuilder
A helper class for constructing Matrix4x4 instances for use in projective transforms.
Inherited Members
Namespace: SixLabors.ImageSharp.Processing
Assembly: SixLabors.ImageSharp.dll
Syntax
public class ProjectiveTransformBuilder
Methods
| Improve this Doc View SourceAppendMatrix(Matrix4x4)
Appends a raw matrix.
Declaration
public ProjectiveTransformBuilder AppendMatrix(Matrix4x4 matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | matrix | The matrix to append. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
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 centered rotation matrix using the given rotation in degrees.
Declaration
public ProjectiveTransformBuilder AppendRotationDegrees(float degrees)
Parameters
Type | Name | Description |
---|---|---|
Single | degrees | The amount of rotation, in degrees. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendRotationRadians(Single)
Appends a centered rotation matrix using the given rotation in radians.
Declaration
public ProjectiveTransformBuilder AppendRotationRadians(float radians)
Parameters
Type | Name | Description |
---|---|---|
Single | radians | The amount of rotation, in radians. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendScale(SizeF)
Appends a scale matrix from the given vector scale.
Declaration
public ProjectiveTransformBuilder AppendScale(SizeF scales)
Parameters
Type | Name | Description |
---|---|---|
SizeF | scales | The horizontal and vertical scale. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendScale(Vector2)
Appends a scale matrix from the given vector scale.
Declaration
public ProjectiveTransformBuilder AppendScale(Vector2 scales)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | scales | The horizontal and vertical scale. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendScale(Single)
Appends a scale matrix from the given uniform scale.
Declaration
public ProjectiveTransformBuilder AppendScale(float scale)
Parameters
Type | Name | Description |
---|---|---|
Single | scale | The uniform scale. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendSkewDegrees(Single, Single, Vector2)
Appends a skew matrix using the given angles in degrees at the given origin.
Declaration
public ProjectiveTransformBuilder 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 |
---|---|
ProjectiveTransformBuilder |
AppendSkewRadians(Single, Single)
Appends a centered skew matrix from the give angles in radians.
Declaration
public ProjectiveTransformBuilder 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 |
---|---|
ProjectiveTransformBuilder |
AppendSkewRadians(Single, Single, Vector2)
Appends a skew matrix using the given angles in radians at the given origin.
Declaration
public ProjectiveTransformBuilder 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 |
---|---|
ProjectiveTransformBuilder |
AppendTaper(TaperSide, TaperCorner, Single)
Appends a matrix that performs a tapering projective transform.
Declaration
public ProjectiveTransformBuilder AppendTaper(TaperSide side, TaperCorner corner, float fraction)
Parameters
Type | Name | Description |
---|---|---|
TaperSide | side | An enumeration that indicates the side of the rectangle that tapers. |
TaperCorner | corner | An enumeration that indicates on which corners to taper the rectangle. |
Single | fraction | The amount to taper. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendTranslation(PointF)
Appends a translation matrix from the given vector.
Declaration
public ProjectiveTransformBuilder AppendTranslation(PointF position)
Parameters
Type | Name | Description |
---|---|---|
PointF | position | The translation position. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendTranslation(Vector2)
Appends a translation matrix from the given vector.
Declaration
public ProjectiveTransformBuilder AppendTranslation(Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The translation position. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
BuildMatrix(Rectangle)
Returns the combined matrix for a given source rectangle.
Declaration
public Matrix4x4 BuildMatrix(Rectangle sourceRectangle)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | sourceRectangle | The rectangle in the source image. |
Returns
Type | Description |
---|---|
Matrix4x4 | The Matrix4x4. |
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 Matrix4x4 BuildMatrix(Size sourceSize)
Parameters
Type | Name | Description |
---|---|---|
Size | sourceSize | The source image size. |
Returns
Type | Description |
---|---|
Matrix4x4 | The Matrix4x4. |
PrependMatrix(Matrix4x4)
Prepends a raw matrix.
Declaration
public ProjectiveTransformBuilder PrependMatrix(Matrix4x4 matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | matrix | The matrix to prepend. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
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 centered rotation matrix using the given rotation in degrees.
Declaration
public ProjectiveTransformBuilder PrependRotationDegrees(float degrees)
Parameters
Type | Name | Description |
---|---|---|
Single | degrees | The amount of rotation, in degrees. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependRotationRadians(Single)
Prepends a centered rotation matrix using the given rotation in radians.
Declaration
public ProjectiveTransformBuilder PrependRotationRadians(float radians)
Parameters
Type | Name | Description |
---|---|---|
Single | radians | The amount of rotation, in radians. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependScale(SizeF)
Prepends a scale matrix from the given vector scale.
Declaration
public ProjectiveTransformBuilder PrependScale(SizeF scale)
Parameters
Type | Name | Description |
---|---|---|
SizeF | scale | The horizontal and vertical scale. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependScale(Vector2)
Prepends a scale matrix from the given vector scale.
Declaration
public ProjectiveTransformBuilder PrependScale(Vector2 scales)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | scales | The horizontal and vertical scale. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependScale(Single)
Prepends a scale matrix from the given uniform scale.
Declaration
public ProjectiveTransformBuilder PrependScale(float scale)
Parameters
Type | Name | Description |
---|---|---|
Single | scale | The uniform scale. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependSkewDegrees(Single, Single, Vector2)
Prepends a skew matrix using the given angles in degrees at the given origin.
Declaration
public ProjectiveTransformBuilder 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 |
---|---|
ProjectiveTransformBuilder |
PrependSkewRadians(Single, Single)
Prepends a centered skew matrix from the give angles in radians.
Declaration
public ProjectiveTransformBuilder 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 |
---|---|
ProjectiveTransformBuilder |
PrependSkewRadians(Single, Single, Vector2)
Prepends a skew matrix using the given angles in radians at the given origin.
Declaration
public ProjectiveTransformBuilder 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 |
---|---|
ProjectiveTransformBuilder |
PrependTaper(TaperSide, TaperCorner, Single)
Prepends a matrix that performs a tapering projective transform.
Declaration
public ProjectiveTransformBuilder PrependTaper(TaperSide side, TaperCorner corner, float fraction)
Parameters
Type | Name | Description |
---|---|---|
TaperSide | side | An enumeration that indicates the side of the rectangle that tapers. |
TaperCorner | corner | An enumeration that indicates on which corners to taper the rectangle. |
Single | fraction | The amount to taper. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependTranslation(PointF)
Prepends a translation matrix from the given vector.
Declaration
public ProjectiveTransformBuilder PrependTranslation(PointF position)
Parameters
Type | Name | Description |
---|---|---|
PointF | position | The translation position. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependTranslation(Vector2)
Prepends a translation matrix from the given vector.
Declaration
public ProjectiveTransformBuilder PrependTranslation(Vector2 position)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | position | The translation position. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |