Skip to content

Commit 1af0996

Browse files
Process -> Apply
1 parent 8935070 commit 1af0996

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

src/ImageSharp.Drawing/Processing/DrawingCanvas{TPixel}.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,18 +317,18 @@ public void Fill(Brush brush, IPath path)
317317
}
318318

319319
/// <inheritdoc />
320-
public void Process(Rectangle region, Action<IImageProcessingContext> operation)
321-
=> this.Process(new RectangularPolygon(region.X, region.Y, region.Width, region.Height), operation);
320+
public void Apply(Rectangle region, Action<IImageProcessingContext> operation)
321+
=> this.Apply(new RectangularPolygon(region.X, region.Y, region.Width, region.Height), operation);
322322

323323
/// <inheritdoc />
324-
public void Process(PathBuilder pathBuilder, Action<IImageProcessingContext> operation)
324+
public void Apply(PathBuilder pathBuilder, Action<IImageProcessingContext> operation)
325325
{
326326
Guard.NotNull(pathBuilder, nameof(pathBuilder));
327-
this.Process(pathBuilder.Build(), operation);
327+
this.Apply(pathBuilder.Build(), operation);
328328
}
329329

330330
/// <inheritdoc />
331-
public void Process(IPath path, Action<IImageProcessingContext> operation)
331+
public void Apply(IPath path, Action<IImageProcessingContext> operation)
332332
{
333333
this.EnsureNotDisposed();
334334
Guard.NotNull(path, nameof(path));

src/ImageSharp.Drawing/Processing/IDrawingCanvas.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@ public interface IDrawingCanvas : IDisposable
151151
/// </summary>
152152
/// <param name="region">The local region to process.</param>
153153
/// <param name="operation">The image-processing operation to apply to the region.</param>
154-
public void Process(Rectangle region, Action<IImageProcessingContext> operation);
154+
public void Apply(Rectangle region, Action<IImageProcessingContext> operation);
155155

156156
/// <summary>
157157
/// Applies an image-processing operation to a region described by a path builder.
158158
/// </summary>
159159
/// <param name="pathBuilder">The path builder describing the region to process.</param>
160160
/// <param name="operation">The image-processing operation to apply to the region.</param>
161-
public void Process(PathBuilder pathBuilder, Action<IImageProcessingContext> operation);
161+
public void Apply(PathBuilder pathBuilder, Action<IImageProcessingContext> operation);
162162

163163
/// <summary>
164164
/// Applies an image-processing operation to a path region.
@@ -168,7 +168,7 @@ public interface IDrawingCanvas : IDisposable
168168
/// </remarks>
169169
/// <param name="path">The path region to process.</param>
170170
/// <param name="operation">The image-processing operation to apply to the region.</param>
171-
public void Process(IPath path, Action<IImageProcessingContext> operation);
171+
public void Apply(IPath path, Action<IImageProcessingContext> operation);
172172

173173
/// <summary>
174174
/// Draws a polyline outline using the provided pen and drawing options.

tests/ImageSharp.Drawing.Tests/Processing/Backends/WebGPUDrawingBackendTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ public void Process_WithWebGPUBackend_MatchesDefaultOutput<TPixel>(TestImageProv
443443
void DrawAction(DrawingCanvas<TPixel> canvas)
444444
{
445445
DrawProcessScenario(canvas);
446-
canvas.Process(blurPath, ctx => ctx.GaussianBlur(6F));
447-
canvas.Process(pixelatePath, ctx => ctx.Pixelate(10));
446+
canvas.Apply(blurPath, ctx => ctx.GaussianBlur(6F));
447+
canvas.Apply(pixelatePath, ctx => ctx.Pixelate(10));
448448
}
449449

450450
using Image<TPixel> defaultImage = provider.GetImage();

tests/ImageSharp.Drawing.Tests/Processing/DrawingCanvasTests.Process.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public void Process_PathBuilder_MatchesReference<TPixel>(TestImageProvider<TPixe
3232
using (DrawingCanvas<TPixel> canvas = CreateCanvas(provider, target, new DrawingOptions()))
3333
{
3434
DrawProcessScenario(canvas);
35-
canvas.Process(blurBuilder, ctx => ctx.GaussianBlur(6F));
36-
canvas.Process(pixelateBuilder, ctx => ctx.Pixelate(10));
35+
canvas.Apply(blurBuilder, ctx => ctx.GaussianBlur(6F));
36+
canvas.Apply(pixelateBuilder, ctx => ctx.Pixelate(10));
3737
canvas.Flush();
3838
}
3939

@@ -53,8 +53,8 @@ public void Process_Path_MatchesReference<TPixel>(TestImageProvider<TPixel> prov
5353
using (DrawingCanvas<TPixel> canvas = CreateCanvas(provider, target, new DrawingOptions()))
5454
{
5555
DrawProcessScenario(canvas);
56-
canvas.Process(blurPath, ctx => ctx.GaussianBlur(6F));
57-
canvas.Process(pixelatePath, ctx => ctx.Pixelate(10));
56+
canvas.Apply(blurPath, ctx => ctx.GaussianBlur(6F));
57+
canvas.Apply(pixelatePath, ctx => ctx.Pixelate(10));
5858
canvas.Flush();
5959
}
6060

@@ -85,8 +85,8 @@ public void Process_NoCpuFrame_WithReadbackCapability_MatchesReference<TPixel>(T
8585
new DrawingOptions()))
8686
{
8787
DrawProcessScenario(canvas);
88-
canvas.Process(blurPath, ctx => ctx.GaussianBlur(6F));
89-
canvas.Process(pixelatePath, ctx => ctx.Pixelate(10));
88+
canvas.Apply(blurPath, ctx => ctx.GaussianBlur(6F));
89+
canvas.Apply(pixelatePath, ctx => ctx.Pixelate(10));
9090
canvas.Flush();
9191
}
9292

@@ -108,7 +108,7 @@ public void Process_UsesCanvasConfigurationForOperationContext()
108108
bool sameConfiguration = false;
109109

110110
canvas.Fill(Brushes.Solid(Color.CornflowerBlue));
111-
canvas.Process(new Rectangle(8, 6, 28, 20), ctx =>
111+
canvas.Apply(new Rectangle(8, 6, 28, 20), ctx =>
112112
{
113113
callbackInvoked = true;
114114
sameConfiguration = ReferenceEquals(configuration, ctx.Configuration);

tests/ImageSharp.Drawing.Tests/Processing/ProcessWithDrawingCanvasTests.Clip.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void ClipOffset<TPixel>(TestImageProvider<TPixel> provider, float dx, flo
2828
int outerRadii = (int)(Math.Min(bounds.Width, bounds.Height) * sizeMult);
2929
Star star = new(new PointF(bounds.Width / 2F, bounds.Height / 2F), 5, outerRadii / 2F, outerRadii);
3030
Matrix4x4 builder = Matrix4x4.CreateTranslation(dx, dy, 0);
31-
canvas.Process(star.Transform(builder), ctx => ctx.DetectEdges());
31+
canvas.Apply(star.Transform(builder), ctx => ctx.DetectEdges());
3232
}),
3333
testOutputDetails: testDetails,
3434
appendPixelTypeToFileName: false,
@@ -45,7 +45,7 @@ public void ClipConstrainsOperationToClipBounds<TPixel>(TestImageProvider<TPixel
4545
Rectangle bounds = canvas.Bounds;
4646
RectangleF rect = new(0, 0, bounds.Width / 2F, bounds.Height / 2F);
4747
RectangularPolygon clipRect = new(rect);
48-
canvas.Process(clipRect, ctx => ctx.Flip(FlipMode.Vertical));
48+
canvas.Apply(clipRect, ctx => ctx.Flip(FlipMode.Vertical));
4949
}),
5050
appendPixelTypeToFileName: false,
5151
appendSourceFileOrDescription: false);

0 commit comments

Comments
 (0)