Class AffineTransformBuilder
- Namespace
- SixLabors.ImageSharp.Processing
- Assembly
- SixLabors.ImageSharp.dll
A helper class for constructing Matrix3x2 instances for use in affine transforms.
public class AffineTransformBuilder
- Inheritance
-
AffineTransformBuilder
- Inherited Members
Constructors
AffineTransformBuilder()
public AffineTransformBuilder()
Methods
AppendMatrix(Matrix3x2)
Appends a raw matrix.
public AffineTransformBuilder AppendMatrix(Matrix3x2 matrix)
Parameters
matrix
Matrix3x2The 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 rotation matrix using the given rotation angle in degrees and the image center point as rotation center.
public AffineTransformBuilder AppendRotationDegrees(float degrees)
Parameters
degrees
floatThe amount of rotation, in degrees.
Returns
AppendRotationDegrees(float, Vector2)
Appends a rotation matrix using the given rotation in degrees at the given origin.
public AffineTransformBuilder AppendRotationDegrees(float degrees, Vector2 origin)
Parameters
Returns
AppendRotationRadians(float)
Appends a rotation matrix using the given rotation angle in radians and the image center point as rotation center.
public AffineTransformBuilder AppendRotationRadians(float radians)
Parameters
radians
floatThe amount of rotation, in radians.
Returns
AppendRotationRadians(float, Vector2)
Appends a rotation matrix using the given rotation in radians at the given origin.
public AffineTransformBuilder AppendRotationRadians(float radians, Vector2 origin)
Parameters
Returns
AppendScale(SizeF)
Appends a scale matrix from the given vector scale.
public AffineTransformBuilder AppendScale(SizeF scales)
Parameters
scales
SizeFThe horizontal and vertical scale.
Returns
AppendScale(Vector2)
Appends a scale matrix from the given vector scale.
public AffineTransformBuilder AppendScale(Vector2 scales)
Parameters
scales
Vector2The horizontal and vertical scale.
Returns
AppendScale(float)
Appends a scale matrix from the given uniform scale.
public AffineTransformBuilder AppendScale(float scale)
Parameters
scale
floatThe uniform scale.
Returns
AppendSkewDegrees(float, float)
Appends a centered skew matrix from the give angles in degrees.
public AffineTransformBuilder AppendSkewDegrees(float degreesX, float degreesY)
Parameters
Returns
AppendSkewDegrees(float, float, Vector2)
Appends a skew matrix using the given angles in degrees at the given origin.
public AffineTransformBuilder AppendSkewDegrees(float degreesX, float degreesY, Vector2 origin)
Parameters
degreesX
floatThe X angle, in degrees.
degreesY
floatThe Y angle, in degrees.
origin
Vector2The skew origin point.
Returns
AppendSkewRadians(float, float)
Appends a centered skew matrix from the give angles in radians.
public AffineTransformBuilder 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 AffineTransformBuilder AppendSkewRadians(float radiansX, float radiansY, Vector2 origin)
Parameters
radiansX
floatThe X angle, in radians.
radiansY
floatThe Y angle, in radians.
origin
Vector2The skew origin point.
Returns
AppendTranslation(PointF)
Appends a translation matrix from the given vector.
public AffineTransformBuilder AppendTranslation(PointF position)
Parameters
position
PointFThe translation position.
Returns
AppendTranslation(Vector2)
Appends a translation matrix from the given vector.
public AffineTransformBuilder AppendTranslation(Vector2 position)
Parameters
position
Vector2The translation position.
Returns
BuildMatrix(Rectangle)
Returns the combined transform matrix for a given source rectangle.
public Matrix3x2 BuildMatrix(Rectangle sourceRectangle)
Parameters
sourceRectangle
RectangleThe 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 Matrix3x2 BuildMatrix(Size sourceSize)
Parameters
sourceSize
SizeThe 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
sourceRectangle
RectangleThe 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(Matrix3x2)
Prepends a raw matrix.
public AffineTransformBuilder PrependMatrix(Matrix3x2 matrix)
Parameters
matrix
Matrix3x2The 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 rotation matrix using the given rotation angle in degrees and the image center point as rotation center.
public AffineTransformBuilder PrependRotationDegrees(float degrees)
Parameters
degrees
floatThe amount of rotation, in degrees.
Returns
PrependRotationDegrees(float, Vector2)
Prepends a rotation matrix using the given rotation in degrees at the given origin.
public AffineTransformBuilder PrependRotationDegrees(float degrees, Vector2 origin)
Parameters
Returns
PrependRotationRadians(float)
Prepends a rotation matrix using the given rotation angle in radians and the image center point as rotation center.
public AffineTransformBuilder PrependRotationRadians(float radians)
Parameters
radians
floatThe amount of rotation, in radians.
Returns
PrependRotationRadians(float, Vector2)
Prepends a rotation matrix using the given rotation in radians at the given origin.
public AffineTransformBuilder PrependRotationRadians(float radians, Vector2 origin)
Parameters
Returns
PrependScale(SizeF)
Prepends a scale matrix from the given vector scale.
public AffineTransformBuilder PrependScale(SizeF scale)
Parameters
scale
SizeFThe horizontal and vertical scale.
Returns
PrependScale(Vector2)
Prepends a scale matrix from the given vector scale.
public AffineTransformBuilder PrependScale(Vector2 scales)
Parameters
scales
Vector2The horizontal and vertical scale.
Returns
PrependScale(float)
Prepends a scale matrix from the given uniform scale.
public AffineTransformBuilder PrependScale(float scale)
Parameters
scale
floatThe uniform scale.
Returns
PrependSkewDegrees(float, float)
Prepends a centered skew matrix from the give angles in degrees.
public AffineTransformBuilder PrependSkewDegrees(float degreesX, float degreesY)
Parameters
Returns
PrependSkewDegrees(float, float, Vector2)
Prepends a skew matrix using the given angles in degrees at the given origin.
public AffineTransformBuilder PrependSkewDegrees(float degreesX, float degreesY, Vector2 origin)
Parameters
degreesX
floatThe X angle, in degrees.
degreesY
floatThe Y angle, in degrees.
origin
Vector2The skew origin point.
Returns
PrependSkewRadians(float, float)
Prepends a centered skew matrix from the give angles in radians.
public AffineTransformBuilder 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 AffineTransformBuilder PrependSkewRadians(float radiansX, float radiansY, Vector2 origin)
Parameters
radiansX
floatThe X angle, in radians.
radiansY
floatThe Y angle, in radians.
origin
Vector2The skew origin point.
Returns
PrependTranslation(PointF)
Prepends a translation matrix from the given vector.
public AffineTransformBuilder PrependTranslation(PointF position)
Parameters
position
PointFThe translation position.
Returns
PrependTranslation(Vector2)
Prepends a translation matrix from the given vector.
public AffineTransformBuilder PrependTranslation(Vector2 position)
Parameters
position
Vector2The translation position.