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
| Edit this page 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(float)
Appends a centered rotation matrix using the given rotation in degrees.
Declaration
public ProjectiveTransformBuilder AppendRotationDegrees(float degrees)
Parameters
Type | Name | Description |
---|---|---|
float | degrees | The amount of rotation, in degrees. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendRotationRadians(float)
Appends a centered rotation matrix using the given rotation in radians.
Declaration
public ProjectiveTransformBuilder AppendRotationRadians(float radians)
Parameters
Type | Name | Description |
---|---|---|
float | 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(float)
Appends a scale matrix from the given uniform scale.
Declaration
public ProjectiveTransformBuilder AppendScale(float scale)
Parameters
Type | Name | Description |
---|---|---|
float | scale | The uniform scale. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendSkewDegrees(float, float, 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 |
---|---|---|
float | degreesX | The X angle, in degrees. |
float | degreesY | The Y angle, in degrees. |
Vector2 | origin | The skew origin point. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendSkewRadians(float, float)
Appends a centered skew matrix from the give angles in radians.
Declaration
public ProjectiveTransformBuilder AppendSkewRadians(float radiansX, float radiansY)
Parameters
Type | Name | Description |
---|---|---|
float | radiansX | The X angle, in radians. |
float | radiansY | The Y angle, in radians. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendSkewRadians(float, float, 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 |
---|---|---|
float | radiansX | The X angle, in radians. |
float | radiansY | The Y angle, in radians. |
Vector2 | origin | The skew origin point. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
AppendTaper(TaperSide, TaperCorner, float)
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. |
float | 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. |
GetTransformedSize(Rectangle)
Returns the size of a rectangle large enough to contain the transformed source rectangle.
Declaration
public Size GetTransformedSize(Rectangle sourceRectangle)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | sourceRectangle | The rectangle in the source image. |
Returns
Type | Description |
---|---|
Size | The Size. |
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. |
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(float)
Prepends a centered rotation matrix using the given rotation in degrees.
Declaration
public ProjectiveTransformBuilder PrependRotationDegrees(float degrees)
Parameters
Type | Name | Description |
---|---|---|
float | degrees | The amount of rotation, in degrees. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependRotationRadians(float)
Prepends a centered rotation matrix using the given rotation in radians.
Declaration
public ProjectiveTransformBuilder PrependRotationRadians(float radians)
Parameters
Type | Name | Description |
---|---|---|
float | 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(float)
Prepends a scale matrix from the given uniform scale.
Declaration
public ProjectiveTransformBuilder PrependScale(float scale)
Parameters
Type | Name | Description |
---|---|---|
float | scale | The uniform scale. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependSkewDegrees(float, float, 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 |
---|---|---|
float | degreesX | The X angle, in degrees. |
float | degreesY | The Y angle, in degrees. |
Vector2 | origin | The skew origin point. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependSkewRadians(float, float)
Prepends a centered skew matrix from the give angles in radians.
Declaration
public ProjectiveTransformBuilder PrependSkewRadians(float radiansX, float radiansY)
Parameters
Type | Name | Description |
---|---|---|
float | radiansX | The X angle, in radians. |
float | radiansY | The Y angle, in radians. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependSkewRadians(float, float, 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 |
---|---|---|
float | radiansX | The X angle, in radians. |
float | radiansY | The Y angle, in radians. |
Vector2 | origin | The skew origin point. |
Returns
Type | Description |
---|---|
ProjectiveTransformBuilder |
PrependTaper(TaperSide, TaperCorner, float)
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. |
float | 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 |