diff --git a/src/ImageSharp.Drawing.Paths/ShapePath.cs b/src/ImageSharp.Drawing.Paths/ShapePath.cs
index cd994515e..ee1f6e9d9 100644
--- a/src/ImageSharp.Drawing.Paths/ShapePath.cs
+++ b/src/ImageSharp.Drawing.Paths/ShapePath.cs
@@ -18,7 +18,7 @@ namespace ImageSharp.Drawing
///
/// A drawable mapping between a / and a drawable/fillable region.
///
- internal class ShapePath : ImageSharp.Drawing.Path
+ internal class ShapePath : ImageSharp.Drawing.Drawable
{
///
/// The fillable shape
@@ -92,8 +92,8 @@ namespace ImageSharp.Drawing
///
public override int ScanX(int x, float[] buffer, int length, int offset)
{
- var start = new Vector2(x, this.Bounds.Top - 1);
- var end = new Vector2(x, this.Bounds.Bottom + 1);
+ Vector2 start = new Vector2(x, this.Bounds.Top - 1);
+ Vector2 end = new Vector2(x, this.Bounds.Bottom + 1);
Vector2[] innerbuffer = ArrayPool.Shared.Rent(length);
try
{
@@ -104,7 +104,7 @@ namespace ImageSharp.Drawing
length,
0);
- for (var i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
buffer[i + offset] = innerbuffer[i].Y;
}
@@ -129,8 +129,8 @@ namespace ImageSharp.Drawing
///
public override int ScanY(int y, float[] buffer, int length, int offset)
{
- var start = new Vector2(float.MinValue, y);
- var end = new Vector2(float.MaxValue, y);
+ Vector2 start = new Vector2(float.MinValue, y);
+ Vector2 end = new Vector2(float.MaxValue, y);
Vector2[] innerbuffer = ArrayPool.Shared.Rent(length);
try
{
@@ -141,7 +141,7 @@ namespace ImageSharp.Drawing
length,
0);
- for (var i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
buffer[i + offset] = innerbuffer[i].X;
}
@@ -162,13 +162,13 @@ namespace ImageSharp.Drawing
/// Information about the the point
public override PointInfo GetPointInfo(int x, int y)
{
- var point = new Vector2(x, y);
+ Vector2 point = new Vector2(x, y);
SixLabors.Shapes.PointInfo result = default(SixLabors.Shapes.PointInfo);
float distance = float.MaxValue;
for (int i = 0; i < this.Paths.Length; i++)
{
- var p = this.Paths[i].Distance(point);
+ SixLabors.Shapes.PointInfo p = this.Paths[i].Distance(point);
if (p.DistanceFromPath < distance)
{
distance = p.DistanceFromPath;
diff --git a/src/ImageSharp.Drawing.Paths/ShapeRegion.cs b/src/ImageSharp.Drawing.Paths/ShapeRegion.cs
index b43ad26b4..b6921f16e 100644
--- a/src/ImageSharp.Drawing.Paths/ShapeRegion.cs
+++ b/src/ImageSharp.Drawing.Paths/ShapeRegion.cs
@@ -72,8 +72,8 @@ namespace ImageSharp.Drawing
///
public override int ScanX(int x, float[] buffer, int length, int offset)
{
- var start = new Vector2(x, this.Bounds.Top - 1);
- var end = new Vector2(x, this.Bounds.Bottom + 1);
+ Vector2 start = new Vector2(x, this.Bounds.Top - 1);
+ Vector2 end = new Vector2(x, this.Bounds.Bottom + 1);
Vector2[] innerbuffer = ArrayPool.Shared.Rent(length);
try
{
@@ -84,7 +84,7 @@ namespace ImageSharp.Drawing
length,
0);
- for (var i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
buffer[i + offset] = innerbuffer[i].Y;
}
@@ -109,8 +109,8 @@ namespace ImageSharp.Drawing
///
public override int ScanY(int y, float[] buffer, int length, int offset)
{
- var start = new Vector2(float.MinValue, y);
- var end = new Vector2(float.MaxValue, y);
+ Vector2 start = new Vector2(float.MinValue, y);
+ Vector2 end = new Vector2(float.MaxValue, y);
Vector2[] innerbuffer = ArrayPool.Shared.Rent(length);
try
{
@@ -121,7 +121,7 @@ namespace ImageSharp.Drawing
length,
0);
- for (var i = 0; i < count; i++)
+ for (int i = 0; i < count; i++)
{
buffer[i + offset] = innerbuffer[i].X;
}
diff --git a/src/ImageSharp.Drawing/DrawPath.cs b/src/ImageSharp.Drawing/DrawPath.cs
index 828d50fb3..fe833e3af 100644
--- a/src/ImageSharp.Drawing/DrawPath.cs
+++ b/src/ImageSharp.Drawing/DrawPath.cs
@@ -28,7 +28,7 @@ namespace ImageSharp
///
/// The Image
///
- public static Image Draw(this Image source, IPen pen, Path path, GraphicsOptions options)
+ public static Image Draw(this Image source, IPen pen, Drawable path, GraphicsOptions options)
where TColor : struct, IPackedPixel, IEquatable
{
return source.Apply(new DrawPathProcessor(pen, path, options));
@@ -44,7 +44,7 @@ namespace ImageSharp
///
/// The Image
///
- public static Image Draw(this Image source, IPen pen, Path path)
+ public static Image Draw(this Image source, IPen pen, Drawable path)
where TColor : struct, IPackedPixel, IEquatable
{
return source.Draw(pen, path, GraphicsOptions.Default);
@@ -62,7 +62,7 @@ namespace ImageSharp
///
/// The Image
///
- public static Image Draw(this Image source, IBrush brush, float thickness, Path path, GraphicsOptions options)
+ public static Image Draw(this Image source, IBrush brush, float thickness, Drawable path, GraphicsOptions options)
where TColor : struct, IPackedPixel, IEquatable
{
return source.Draw(new Pen(brush, thickness), path, options);
@@ -79,7 +79,7 @@ namespace ImageSharp
///
/// The Image
///
- public static Image Draw(this Image source, IBrush brush, float thickness, Path path)
+ public static Image Draw(this Image source, IBrush brush, float thickness, Drawable path)
where TColor : struct, IPackedPixel, IEquatable
{
return source.Draw(new Pen(brush, thickness), path);
@@ -97,7 +97,7 @@ namespace ImageSharp
///
/// The Image
///
- public static Image Draw(this Image source, TColor color, float thickness, Path path, GraphicsOptions options)
+ public static Image Draw(this Image source, TColor color, float thickness, Drawable path, GraphicsOptions options)
where TColor : struct, IPackedPixel, IEquatable
{
return source.Draw(new SolidBrush(color), thickness, path, options);
@@ -114,7 +114,7 @@ namespace ImageSharp
///
/// The Image
///
- public static Image Draw(this Image source, TColor color, float thickness, Path path)
+ public static Image Draw(this Image source, TColor color, float thickness, Drawable path)
where TColor : struct, IPackedPixel, IEquatable
{
return source.Draw(new SolidBrush(color), thickness, path);
diff --git a/src/ImageSharp.Drawing/Path.cs b/src/ImageSharp.Drawing/Drawable.cs
similarity index 91%
rename from src/ImageSharp.Drawing/Path.cs
rename to src/ImageSharp.Drawing/Drawable.cs
index a997fa18f..b81827331 100644
--- a/src/ImageSharp.Drawing/Path.cs
+++ b/src/ImageSharp.Drawing/Drawable.cs
@@ -1,4 +1,4 @@
-//
+//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
@@ -6,9 +6,9 @@
namespace ImageSharp.Drawing
{
///
- /// Represents a something that has knowledge about its outline.
+ /// Represents a path or set of paths that can be drawn as an outline.
///
- public abstract class Path
+ public abstract class Drawable
{
///
/// Gets the maximum number of intersections to could be returned.
diff --git a/src/ImageSharp.Drawing/Processors/DrawPathProcessor.cs b/src/ImageSharp.Drawing/Processors/DrawPathProcessor.cs
index 3fe557080..53f0408d4 100644
--- a/src/ImageSharp.Drawing/Processors/DrawPathProcessor.cs
+++ b/src/ImageSharp.Drawing/Processors/DrawPathProcessor.cs
@@ -31,7 +31,7 @@ namespace ImageSharp.Drawing.Processors
/// The pen.
/// The region.
/// The options.
- public DrawPathProcessor(IPen pen, Path region, GraphicsOptions options)
+ public DrawPathProcessor(IPen pen, Drawable region, GraphicsOptions options)
{
this.Path = region;
this.Pen = pen;
@@ -60,7 +60,7 @@ namespace ImageSharp.Drawing.Processors
///
/// The path.
///
- public Path Path { get; }
+ public Drawable Path { get; }
///
protected override void OnApply(ImageBase source, Rectangle sourceRectangle)
diff --git a/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs b/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs
index f4465027d..fc231a89d 100644
--- a/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs
+++ b/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs
@@ -33,13 +33,13 @@ namespace ImageSharp.Tests.Drawing
new Vector2(60, 10),
new Vector2(10, 400));
- ShapePath p = new ShapePath(linerSegemnt, bazierSegment);
+ ShapePath p = new ShapePath(linerSegemnt, bazierSegment);
using (FileStream output = File.OpenWrite($"{path}/Simple.png"))
{
image
.BackgroundColor(Color.Blue)
- .Draw(Color.HotPink, 5, p)
+ .Draw(Color.HotPink, 5, p)
.Save(output);
}
@@ -82,7 +82,7 @@ namespace ImageSharp.Tests.Drawing
{
image
.BackgroundColor(Color.Blue)
- .Draw(color, 10, p)
+ .Draw(color, 10, p)
.Save(output);
}
diff --git a/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs
index 0a4f2c4a0..6153cb310 100644
--- a/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs
+++ b/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs
@@ -37,8 +37,8 @@ namespace ImageSharp.Tests.Drawing
{
image
.BackgroundColor(Color.Blue)
- .Draw(Color.HotPink, 5, simplePath.Clip(hole1))
- .Save(output);
+ .Draw(Color.HotPink, 5, simplePath.Clip(hole1))
+ .Save(output);
}
using (PixelAccessor sourcePixels = image.Lock())
@@ -87,7 +87,7 @@ namespace ImageSharp.Tests.Drawing
{
image
.BackgroundColor(Color.Blue)
- .Draw(Color.HotPink, 5, simplePath.Clip(hole1))
+ .Draw(Color.HotPink, 5, simplePath.Clip(hole1))
.Save(output);
}
@@ -131,7 +131,6 @@ namespace ImageSharp.Tests.Drawing
new Vector2(37, 85),
new Vector2(130, 40),
new Vector2(65, 137)));
-
using (Image image = new Image(500, 500))
{
@@ -139,7 +138,7 @@ namespace ImageSharp.Tests.Drawing
{
image
.BackgroundColor(Color.Blue)
- .Draw(Color.HotPink, 5, simplePath.Clip(hole1))
+ .Draw(Color.HotPink, 5, simplePath.Clip(hole1))
.Save(output);
}
@@ -185,7 +184,7 @@ namespace ImageSharp.Tests.Drawing
{
image
.BackgroundColor(Color.Blue)
- .Draw(Pens.Dash(Color.HotPink, 5), simplePath.Clip(hole1))
+ .Draw(Pens.Dash(Color.HotPink, 5), simplePath.Clip(hole1))
.Save(output);
}
}
@@ -213,7 +212,7 @@ namespace ImageSharp.Tests.Drawing
{
image
.BackgroundColor(Color.Blue)
- .Draw(color, 5, simplePath.Clip(hole1))
+ .Draw(color, 5, simplePath.Clip(hole1))
.Save(output);
}
diff --git a/tests/ImageSharp.Tests/Drawing/PolygonTests.cs b/tests/ImageSharp.Tests/Drawing/PolygonTests.cs
index a166464c9..3e06ca918 100644
--- a/tests/ImageSharp.Tests/Drawing/PolygonTests.cs
+++ b/tests/ImageSharp.Tests/Drawing/PolygonTests.cs
@@ -97,7 +97,7 @@ namespace ImageSharp.Tests.Drawing
{
image
.BackgroundColor(Color.Blue)
- .Draw(Color.HotPink, 10, new Rectangle(10, 10, 190, 140))
+ .Draw(Color.HotPink, 10, new Rectangle(10, 10, 190, 140))
.Save(output);
}
diff --git a/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs
index 45ee59d66..98ec9ff83 100644
--- a/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs
+++ b/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs
@@ -35,7 +35,7 @@ namespace ImageSharp.Tests.Drawing
{
image
.BackgroundColor(Color.Blue)
- .Fill(Color.HotPink, simplePath.Clip(hole1))
+ .Fill(Color.HotPink, simplePath.Clip(hole1))
.Save(output);
}
@@ -78,7 +78,7 @@ namespace ImageSharp.Tests.Drawing
{
image
.BackgroundColor(Color.Blue)
- .Fill(Color.HotPink, simplePath.Clip(hole1))
+ .Fill(Color.HotPink, simplePath.Clip(hole1))
.Save(output);
}
@@ -121,8 +121,8 @@ namespace ImageSharp.Tests.Drawing
{
image
.BackgroundColor(Color.Blue)
- .Fill(color, simplePath.Clip(hole1))
- .Save(output);
+ .Fill(color, simplePath.Clip(hole1))
+ .Save(output);
}
//shift background color towards forground color by the opacity amount
diff --git a/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs
index d5b206723..5533fbc0a 100644
--- a/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs
+++ b/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs
@@ -71,7 +71,7 @@ namespace ImageSharp.Tests.Drawing
{
Assert.Equal(Color.HotPink, sourcePixels[11, 11]);
- Assert.Equal(Color.HotPink, sourcePixels[199, 150]);
+ Assert.Equal(Color.HotPink, sourcePixels[199, 150]);
Assert.Equal(Color.HotPink, sourcePixels[50, 50]);
@@ -144,14 +144,14 @@ namespace ImageSharp.Tests.Drawing
public void ImageShouldBeOverlayedByFilledRectangle()
{
string path = this.CreateOutputDirectory("Drawing", "FilledPolygons");
-
+
using (Image image = new Image(500, 500))
{
using (FileStream output = File.OpenWrite($"{path}/Rectangle.png"))
{
image
.BackgroundColor(Color.Blue)
- .Fill(Color.HotPink, new SixLabors.Shapes.Rectangle(10,10, 190, 140))
+ .Fill(Color.HotPink, new SixLabors.Shapes.Rectangle(10,10, 190, 140))
.Save(output);
}