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
matrixMatrix4x4The matrix to append.
Returns
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
degreesfloatThe amount of rotation, in degrees.
Returns
AppendRotationRadians(float)
Appends a centered rotation matrix using the given rotation in radians.
public ProjectiveTransformBuilder AppendRotationRadians(float radians)
Parameters
radiansfloatThe amount of rotation, in radians.
Returns
AppendScale(SizeF)
Appends a scale matrix from the given vector scale.
public ProjectiveTransformBuilder AppendScale(SizeF scales)
Parameters
scalesSizeFThe horizontal and vertical scale.
Returns
AppendScale(Vector2)
Appends a scale matrix from the given vector scale.
public ProjectiveTransformBuilder AppendScale(Vector2 scales)
Parameters
scalesVector2The horizontal and vertical scale.
Returns
AppendScale(float)
Appends a scale matrix from the given uniform scale.
public ProjectiveTransformBuilder AppendScale(float scale)
Parameters
scalefloatThe uniform scale.
Returns
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
degreesXfloatThe X angle, in degrees.
degreesYfloatThe Y angle, in degrees.
originVector2The skew origin point.
Returns
AppendSkewRadians(float, float)
Appends a centered skew matrix from the give angles in radians.
public ProjectiveTransformBuilder AppendSkewRadians(float radiansX, float radiansY)
Parameters
Returns
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
radiansXfloatThe X angle, in radians.
radiansYfloatThe Y angle, in radians.
originVector2The skew origin point.
Returns
AppendTaper(TaperSide, TaperCorner, float)
Appends a matrix that performs a tapering projective transform.
public ProjectiveTransformBuilder AppendTaper(TaperSide side, TaperCorner corner, float fraction)
Parameters
sideTaperSideAn enumeration that indicates the side of the rectangle that tapers.
cornerTaperCornerAn enumeration that indicates on which corners to taper the rectangle.
fractionfloatThe amount to taper.
Returns
AppendTranslation(PointF)
Appends a translation matrix from the given vector.
public ProjectiveTransformBuilder AppendTranslation(PointF position)
Parameters
positionPointFThe translation position.
Returns
AppendTranslation(Vector2)
Appends a translation matrix from the given vector.
public ProjectiveTransformBuilder AppendTranslation(Vector2 position)
Parameters
positionVector2The translation position.
Returns
BuildMatrix(Rectangle)
Returns the combined matrix for a given source rectangle.
public Matrix4x4 BuildMatrix(Rectangle sourceRectangle)
Parameters
sourceRectangleRectangleThe rectangle in the source image.
Returns
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
sourceSizeSizeThe source image size.
Returns
GetTransformedSize(Rectangle)
Returns the size of a rectangle large enough to contain the transformed source rectangle.
public Size GetTransformedSize(Rectangle sourceRectangle)
Parameters
sourceRectangleRectangleThe rectangle in the source image.
Returns
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
matrixMatrix4x4The matrix to prepend.
Returns
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
degreesfloatThe amount of rotation, in degrees.
Returns
PrependRotationRadians(float)
Prepends a centered rotation matrix using the given rotation in radians.
public ProjectiveTransformBuilder PrependRotationRadians(float radians)
Parameters
radiansfloatThe amount of rotation, in radians.
Returns
PrependScale(SizeF)
Prepends a scale matrix from the given vector scale.
public ProjectiveTransformBuilder PrependScale(SizeF scale)
Parameters
scaleSizeFThe horizontal and vertical scale.
Returns
PrependScale(Vector2)
Prepends a scale matrix from the given vector scale.
public ProjectiveTransformBuilder PrependScale(Vector2 scales)
Parameters
scalesVector2The horizontal and vertical scale.
Returns
PrependScale(float)
Prepends a scale matrix from the given uniform scale.
public ProjectiveTransformBuilder PrependScale(float scale)
Parameters
scalefloatThe uniform scale.
Returns
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
degreesXfloatThe X angle, in degrees.
degreesYfloatThe Y angle, in degrees.
originVector2The skew origin point.
Returns
PrependSkewRadians(float, float)
Prepends a centered skew matrix from the give angles in radians.
public ProjectiveTransformBuilder PrependSkewRadians(float radiansX, float radiansY)
Parameters
Returns
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
radiansXfloatThe X angle, in radians.
radiansYfloatThe Y angle, in radians.
originVector2The skew origin point.
Returns
PrependTaper(TaperSide, TaperCorner, float)
Prepends a matrix that performs a tapering projective transform.
public ProjectiveTransformBuilder PrependTaper(TaperSide side, TaperCorner corner, float fraction)
Parameters
sideTaperSideAn enumeration that indicates the side of the rectangle that tapers.
cornerTaperCornerAn enumeration that indicates on which corners to taper the rectangle.
fractionfloatThe amount to taper.
Returns
PrependTranslation(PointF)
Prepends a translation matrix from the given vector.
public ProjectiveTransformBuilder PrependTranslation(PointF position)
Parameters
positionPointFThe translation position.
Returns
PrependTranslation(Vector2)
Prepends a translation matrix from the given vector.
public ProjectiveTransformBuilder PrependTranslation(Vector2 position)
Parameters
positionVector2The translation position.