Skip to content

Commit 726794a

Browse files
Rename helper, fix docs.
1 parent 6dea233 commit 726794a

File tree

14 files changed

+39
-39
lines changed

14 files changed

+39
-39
lines changed

src/ImageSharp/Metadata/Profiles/Exif/ExifProfile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ internal void SyncSubject(int width, int height, Matrix4x4 matrix)
318318
{
319319
if (location.Value?.Length == 2)
320320
{
321-
Vector2 point = TransformUtils.ProjectiveTransform2D(location.Value[0], location.Value[1], matrix);
321+
Vector2 point = TransformUtilities.ProjectiveTransform2D(location.Value[0], location.Value[1], matrix);
322322

323323
// Ensure the point is within the image dimensions.
324324
point = Vector2.Clamp(point, Vector2.Zero, new Vector2(width - 1, height - 1));
@@ -340,7 +340,7 @@ internal void SyncSubject(int width, int height, Matrix4x4 matrix)
340340
if (area.Value?.Length == 4)
341341
{
342342
RectangleF rectangle = new(area.Value[0], area.Value[1], area.Value[2], area.Value[3]);
343-
if (!TransformUtils.TryGetTransformedRectangle(rectangle, matrix, out RectangleF bounds))
343+
if (!TransformUtilities.TryGetTransformedRectangle(rectangle, matrix, out RectangleF bounds))
344344
{
345345
return;
346346
}

src/ImageSharp/Processing/AffineTransformBuilder.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public AffineTransformBuilder PrependRotationDegrees(float degrees)
3737
/// <returns>The <see cref="AffineTransformBuilder"/>.</returns>
3838
public AffineTransformBuilder PrependRotationRadians(float radians)
3939
=> this.Prepend(
40-
size => TransformUtils.CreateRotationTransformMatrixRadians(radians, size));
40+
size => TransformUtilities.CreateRotationTransformMatrixRadians(radians, size));
4141

4242
/// <summary>
4343
/// Prepends a rotation matrix using the given rotation in degrees at the given origin.
@@ -73,7 +73,7 @@ public AffineTransformBuilder AppendRotationDegrees(float degrees)
7373
/// <param name="radians">The amount of rotation, in radians.</param>
7474
/// <returns>The <see cref="AffineTransformBuilder"/>.</returns>
7575
public AffineTransformBuilder AppendRotationRadians(float radians)
76-
=> this.Append(size => TransformUtils.CreateRotationTransformMatrixRadians(radians, size));
76+
=> this.Append(size => TransformUtilities.CreateRotationTransformMatrixRadians(radians, size));
7777

7878
/// <summary>
7979
/// Appends a rotation matrix using the given rotation in degrees at the given origin.
@@ -157,7 +157,7 @@ public AffineTransformBuilder PrependSkewDegrees(float degreesX, float degreesY)
157157
/// <param name="radiansY">The Y angle, in radians.</param>
158158
/// <returns>The <see cref="AffineTransformBuilder"/>.</returns>
159159
public AffineTransformBuilder PrependSkewRadians(float radiansX, float radiansY)
160-
=> this.Prepend(size => TransformUtils.CreateSkewTransformMatrixRadians(radiansX, radiansY, size));
160+
=> this.Prepend(size => TransformUtilities.CreateSkewTransformMatrixRadians(radiansX, radiansY, size));
161161

162162
/// <summary>
163163
/// Prepends a skew matrix using the given angles in degrees at the given origin.
@@ -195,7 +195,7 @@ public AffineTransformBuilder AppendSkewDegrees(float degreesX, float degreesY)
195195
/// <param name="radiansY">The Y angle, in radians.</param>
196196
/// <returns>The <see cref="AffineTransformBuilder"/>.</returns>
197197
public AffineTransformBuilder AppendSkewRadians(float radiansX, float radiansY)
198-
=> this.Append(size => TransformUtils.CreateSkewTransformMatrixRadians(radiansX, radiansY, size));
198+
=> this.Append(size => TransformUtilities.CreateSkewTransformMatrixRadians(radiansX, radiansY, size));
199199

200200
/// <summary>
201201
/// Appends a skew matrix using the given angles in degrees at the given origin.
@@ -347,11 +347,11 @@ public SizeF GetTransformedSize(Rectangle sourceRectangle)
347347
/// </exception>
348348
/// <returns>The <see cref="Size"/>.</returns>
349349
internal static SizeF GetTransformedSize(Rectangle sourceRectangle, Matrix3x2 matrix)
350-
=> TransformUtils.GetRawTransformedSize(matrix, sourceRectangle.Size);
350+
=> TransformUtilities.GetRawTransformedSize(matrix, sourceRectangle.Size);
351351

352352
private static void CheckDegenerate(Matrix3x2 matrix)
353353
{
354-
if (TransformUtils.IsDegenerate(matrix))
354+
if (TransformUtilities.IsDegenerate(matrix))
355355
{
356356
throw new DegenerateTransformException("Matrix is degenerate. Check input values.");
357357
}

src/ImageSharp/Processing/Extensions/Transforms/TransformExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static IImageProcessingContext Transform(
5151
IResampler sampler)
5252
{
5353
Matrix3x2 transform = builder.BuildMatrix(sourceRectangle);
54-
Size targetDimensions = TransformUtils.GetTransformedCanvasSize(transform, sourceRectangle.Size);
54+
Size targetDimensions = TransformUtilities.GetTransformedCanvasSize(transform, sourceRectangle.Size);
5555
return source.Transform(sourceRectangle, transform, targetDimensions, sampler);
5656
}
5757

@@ -113,7 +113,7 @@ public static IImageProcessingContext Transform(
113113
IResampler sampler)
114114
{
115115
Matrix4x4 transform = builder.BuildMatrix(sourceRectangle);
116-
Size targetDimensions = TransformUtils.GetTransformedCanvasSize(transform, sourceRectangle.Size);
116+
Size targetDimensions = TransformUtilities.GetTransformedCanvasSize(transform, sourceRectangle.Size);
117117
return source.Transform(sourceRectangle, transform, targetDimensions, sampler);
118118
}
119119

src/ImageSharp/Processing/Processors/Transforms/Linear/AffineTransformProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public AffineTransformProcessor(Matrix3x2 matrix, IResampler sampler, Size targe
2121
Guard.NotNull(sampler, nameof(sampler));
2222
Guard.MustBeValueType(sampler);
2323

24-
if (TransformUtils.IsDegenerate(matrix))
24+
if (TransformUtilities.IsDegenerate(matrix))
2525
{
2626
throw new DegenerateTransformException("Matrix is degenerate. Check input values.");
2727
}

src/ImageSharp/Processing/Processors/Transforms/Linear/AffineTransformProcessor{TPixel}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void ApplyTransform<TResampler>(in TResampler sampler)
7979

8080
// All matrices are defined in normalized coordinate space so we need to convert to pixel space.
8181
// After normalization we need to invert the matrix for correct sampling.
82-
matrix = TransformUtils.NormalizeToPixel(matrix);
82+
matrix = TransformUtilities.NormalizeToPixel(matrix);
8383
Matrix3x2.Invert(matrix, out matrix);
8484

8585
if (sampler is NearestNeighborResampler)

src/ImageSharp/Processing/Processors/Transforms/Linear/ProjectiveTransformProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public ProjectiveTransformProcessor(Matrix4x4 matrix, IResampler sampler, Size t
2121
Guard.NotNull(sampler, nameof(sampler));
2222
Guard.MustBeValueType(sampler);
2323

24-
if (TransformUtils.IsDegenerate(matrix))
24+
if (TransformUtilities.IsDegenerate(matrix))
2525
{
2626
throw new DegenerateTransformException("Matrix is degenerate. Check input values.");
2727
}

src/ImageSharp/Processing/Processors/Transforms/Linear/ProjectiveTransformProcessor{TPixel}.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void ApplyTransform<TResampler>(in TResampler sampler)
7777

7878
// All matrices are defined in normalized coordinate space so we need to convert to pixel space.
7979
// After normalization we need to invert the matrix for correct sampling.
80-
matrix = TransformUtils.NormalizeToPixel(matrix);
80+
matrix = TransformUtilities.NormalizeToPixel(matrix);
8181
Matrix4x4.Invert(matrix, out matrix);
8282

8383
if (sampler is NearestNeighborResampler)
@@ -137,7 +137,7 @@ public void Invoke(int y)
137137

138138
for (int x = 0; x < destinationRowSpan.Length; x++)
139139
{
140-
Vector2 point = TransformUtils.ProjectiveTransform2D(x, y, this.matrix);
140+
Vector2 point = TransformUtilities.ProjectiveTransform2D(x, y, this.matrix);
141141
int px = (int)MathF.Round(point.X);
142142
int py = (int)MathF.Round(point.Y);
143143

@@ -209,7 +209,7 @@ public void Invoke(in RowInterval rows, Span<Vector4> span)
209209

210210
for (int x = 0; x < span.Length; x++)
211211
{
212-
Vector2 point = TransformUtils.ProjectiveTransform2D(x, y, matrix);
212+
Vector2 point = TransformUtilities.ProjectiveTransform2D(x, y, matrix);
213213
float pY = point.Y;
214214
float pX = point.X;
215215

src/ImageSharp/Processing/Processors/Transforms/Linear/RotateProcessor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ public RotateProcessor(float degrees, Size sourceSize)
2828
/// <param name="sourceSize">The source image size</param>
2929
public RotateProcessor(float degrees, IResampler sampler, Size sourceSize)
3030
: this(
31-
TransformUtils.CreateRotationTransformMatrixDegrees(degrees, sourceSize),
31+
TransformUtilities.CreateRotationTransformMatrixDegrees(degrees, sourceSize),
3232
sampler,
3333
sourceSize)
3434
=> this.Degrees = degrees;
3535

3636
// Helper constructor
3737
private RotateProcessor(Matrix3x2 rotationMatrix, IResampler sampler, Size sourceSize)
38-
: base(rotationMatrix, sampler, TransformUtils.GetTransformedCanvasSize(rotationMatrix, sourceSize))
38+
: base(rotationMatrix, sampler, TransformUtilities.GetTransformedCanvasSize(rotationMatrix, sourceSize))
3939
{
4040
}
4141

src/ImageSharp/Processing/Processors/Transforms/Linear/SkewProcessor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public SkewProcessor(float degreesX, float degreesY, Size sourceSize)
3030
/// <param name="sourceSize">The source image size</param>
3131
public SkewProcessor(float degreesX, float degreesY, IResampler sampler, Size sourceSize)
3232
: this(
33-
TransformUtils.CreateSkewTransformMatrixDegrees(degreesX, degreesY, sourceSize),
33+
TransformUtilities.CreateSkewTransformMatrixDegrees(degreesX, degreesY, sourceSize),
3434
sampler,
3535
sourceSize)
3636
{
@@ -40,7 +40,7 @@ public SkewProcessor(float degreesX, float degreesY, IResampler sampler, Size so
4040

4141
// Helper constructor:
4242
private SkewProcessor(Matrix3x2 skewMatrix, IResampler sampler, Size sourceSize)
43-
: base(skewMatrix, sampler, TransformUtils.GetTransformedCanvasSize(skewMatrix, sourceSize))
43+
: base(skewMatrix, sampler, TransformUtilities.GetTransformedCanvasSize(skewMatrix, sourceSize))
4444
{
4545
}
4646

src/ImageSharp/Processing/Processors/Transforms/SwizzleProcessor{TSwizzler,TPixel}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public SwizzleProcessor(Configuration configuration, TSwizzler swizzler, Image<T
2424
// Calculate the transform matrix from the swizzle operation to allow us
2525
// to update any metadata that represents pixel coordinates in the source image.
2626
this.transformMatrix = new ProjectiveTransformBuilder()
27-
.AppendMatrix(TransformUtils.GetSwizzlerMatrix(swizzler, sourceRectangle))
27+
.AppendMatrix(TransformUtilities.GetSwizzlerMatrix(swizzler, sourceRectangle))
2828
.BuildMatrix(sourceRectangle);
2929
}
3030

0 commit comments

Comments
 (0)