diff --git a/ImageSharp.ruleset b/ImageSharp.ruleset
index 2149364b1b..3567dc4b9e 100644
--- a/ImageSharp.ruleset
+++ b/ImageSharp.ruleset
@@ -7,5 +7,7 @@
temp remove the header requirement as stylecop is currently failing to read the stylecop.json file from 'dotnet build'
-->
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index d9d2628bb7..7e47e6b06f 100644
--- a/README.md
+++ b/README.md
@@ -4,31 +4,32 @@
ImageSharp
-
-
-
-
-
+
+
+
+
+
### **ImageSharp** is a new, fully featured, fully managed, cross-platform, 2D graphics API.
-Without the use of `System.Drawing` we have been able to develop something much more flexible, easier to code against, and much, much less prone to memory leaks. Gone are system-wide process-locks; ImageSharp images are thread-safe and fully supported in web environments.
+Designed to democratize image processing, ImageSharp brings you an incredibly powerful yet beautifully simple API.
-Built against .Net Standard 1.1 ImageSharp can be used in device, cloud, and embedded/IoT scenarios.
-
-### Questions?
+Compared to `System.Drawing` we have been able to develop something much more flexible, easier to code against, and much, much less prone to memory leaks. Gone are system-wide process-locks; ImageSharp images are thread-safe and fully supported in web environments.
-Do you have questions? We are happy to help! Please [join our gitter channel](https://gitter.im/ImageSharp/General), or ask them on [stackoverflow](https://stackoverflow.com) using the `ImageSharp` tag.
+Built against .Net Standard 1.1 ImageSharp can be used in device, cloud, and embedded/IoT scenarios.
### Installation
+Install stable releases via Nuget;evelopment releases are available via MyGet.
+
| Package Name | Release (NuGet) | Nightly (MyGet) |
|--------------------------------|-----------------|-----------------|
| `SixLabors.ImageSharp` | [](https://www.nuget.org/packages/SixLabors.ImageSharp/) | [](https://www.myget.org/feed/sixlabors/package/nuget/SixLabors.ImageSharp) |
| `SixLabors.ImageSharp.Drawing` | [](https://www.nuget.org/packages/SixLabors.ImageSharp.Drawing/) | [](https://www.myget.org/feed/sixlabors/package/nuget/SixLabors.ImageSharp.Drawing) |
### Packages
+
The **ImageSharp** library is made up of multiple packages:
- **SixLabors.ImageSharp**
- Contains the generic `Image` class, PixelFormats, Primitives, Configuration, and other core functionality.
@@ -48,31 +49,37 @@ The **ImageSharp** library is made up of multiple packages:
|**Linux/Mac**|[](https://travis-ci.org/SixLabors/ImageSharp)|[](https://codecov.io/gh/SixLabors/ImageSharp)|
|**Windows** |[](https://ci.appveyor.com/project/six-labors/imagesharp/branch/master)|[](https://codecov.io/gh/SixLabors/ImageSharp)|
-### Features
+### Questions?
-There's plenty there and more coming. Check out the [current features](features.md)!
+Do you have questions? We are happy to help! Please [join our gitter channel](https://gitter.im/ImageSharp/General), or ask them on [stackoverflow](https://stackoverflow.com) using the `ImageSharp` tag.
### API
-Here's an example of the code required to resize an image using the default Bicubic resampler then turn the colors into their grayscale equivalent using the BT709 standard matrix.
+API documentation is available at [https://sixlabors.github.io/docs/](https://sixlabors.github.io/docs/)
+
+Our API is designed to be simple to consume. Here's an example of the code required to resize an image using the default Bicubic resampler then turn the colors into their grayscale equivalent using the BT709 standard matrix.
On platforms supporting netstandard 1.3+
+
```csharp
-// Image.Load(string path) is a shortcut for our default type. Other pixel formats use Image.Load(string path))
+// Image.Load(string path) is a shortcut for our default type.
+// Other pixel formats use Image.Load(string path))
using (Image image = Image.Load("foo.jpg"))
{
image.Mutate(x => x
.Resize(image.Width / 2, image.Height / 2)
.Grayscale());
- image.Save("bar.jpg"); // automatic encoder selected based on extension.
+ image.Save("bar.jpg"); // Automatic encoder selected based on extension.
}
```
-on netstandard 1.1 - 1.2
+On netstandard 1.1 - 1.2
+
```csharp
-// Image.Load(Stream stream) is a shortcut for our default type. Other pixel formats use Image.Load(Stream stream))
+// Image.Load(Stream stream) is a shortcut for our default type.
+// Other pixel formats use Image.Load(Stream stream))
using (FileStream stream = File.OpenRead("foo.jpg"))
using (FileStream output = File.OpenWrite("bar.jpg"))
-using (Image image = Image.Load(stream))
+using (Image image = Image.Load(stream))
{
image.Mutate(x => x
.Resize(image.Width / 2, image.Height / 2)
@@ -81,7 +88,7 @@ using (Image image = Image.Load(stream))
}
```
-Setting individual pixel values can be perfomed as follows:
+Setting individual pixel values can be performed as follows:
```csharp
// Individual pixels
@@ -93,9 +100,7 @@ using (Image image = new Image(400, 400))
`Rgba32` is our default PixelFormat, equivalent to `System.Drawing Color`. For advanced pixel format usage there are multiple [PixelFormat implementations](https://github.com/SixLabors/ImageSharp/tree/master/src/ImageSharp/PixelFormats) available allowing developers to implement their own color models in the same manner as Microsoft XNA Game Studio and MonoGame.
-All in all this should allow image processing to be much more accessible to developers which has always been my goal from the start.
-
-**Check out [this blog post](https://sixlabors.com/blog/announcing-imagesharp-beta-1/) or our [Samples Repository](https://github.com/SixLabors/Samples/tree/master/ImageSharp) for more examples!**
+**Check out this [blog post](https://sixlabors.com/blog/announcing-imagesharp-beta-1/) or our [Samples Repository](https://github.com/SixLabors/Samples/tree/master/ImageSharp) for more examples!**
### Manual build
diff --git a/build/icons/imagesharp-logo-128.png b/build/icons/imagesharp-logo-128.png
index f825a4034e..5c2079144f 100644
--- a/build/icons/imagesharp-logo-128.png
+++ b/build/icons/imagesharp-logo-128.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e0f7d4c9396d4c7fe8173057c44cc2c0ecc24e52b52ce67c97dd11a7ac6e79ed
-size 8113
+oid sha256:148a268c589b628f5d0b5af0e86911a0b393c35b8b25233c71553657c88e0b96
+size 7568
diff --git a/build/icons/imagesharp-logo-256.png b/build/icons/imagesharp-logo-256.png
index 3ee8e026f2..e38807ae1e 100644
--- a/build/icons/imagesharp-logo-256.png
+++ b/build/icons/imagesharp-logo-256.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:7583dab9f399b7b9a7f69fc87086caa439249a705b058d6bfbd88238cfd95d4e
-size 16613
+oid sha256:7e4b2ff72aef1979500cd130c28490a00be116bb833bc96ca30c85dc0596099c
+size 15413
diff --git a/build/icons/imagesharp-logo-32.png b/build/icons/imagesharp-logo-32.png
index fd7cbfa9c3..273b171eb2 100644
--- a/build/icons/imagesharp-logo-32.png
+++ b/build/icons/imagesharp-logo-32.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:c2b4b7ede0bf2fb4a9d028c9c4e930ab092b8c45689dd288ed1e419b5207048b
-size 1904
+oid sha256:021c12313afbdc65f58bfea8c7b436d5c2102513bb63d9e64ee2b61a1344c56a
+size 1799
diff --git a/build/icons/imagesharp-logo-512.png b/build/icons/imagesharp-logo-512.png
index f1de1fb956..707dc9a35b 100644
--- a/build/icons/imagesharp-logo-512.png
+++ b/build/icons/imagesharp-logo-512.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:cd9c567ef861075fcaef709577e87017b5834556df5fc6ff51c4ded8972568a8
-size 35069
+oid sha256:3ae54ae0035df1f8f1459081e2f1d5cceda6f88cca6ec015d8c0209bf0d34edf
+size 32534
diff --git a/build/icons/imagesharp-logo-64.png b/build/icons/imagesharp-logo-64.png
index e326b9c3a8..17577772eb 100644
--- a/build/icons/imagesharp-logo-64.png
+++ b/build/icons/imagesharp-logo-64.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:28a0995e02d0535a13d08997d36cc7b4df95760f9499396b209ad2c7d73ccef6
-size 3962
+oid sha256:92896854265693f28f9a503b9093cb2c9a4a9b329f310732efdd9c6f6c3761bc
+size 3736
diff --git a/build/icons/imagesharp-logo-heading.png b/build/icons/imagesharp-logo-heading.png
deleted file mode 100644
index 0fe1322052..0000000000
--- a/build/icons/imagesharp-logo-heading.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:9480cb9ac66963e717b7e89666375e8bb23183e456067fd7d445ffb3c182b425
-size 11390
diff --git a/build/icons/imagesharp-logo.png b/build/icons/imagesharp-logo.png
index f1de1fb956..707dc9a35b 100644
--- a/build/icons/imagesharp-logo.png
+++ b/build/icons/imagesharp-logo.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:cd9c567ef861075fcaef709577e87017b5834556df5fc6ff51c4ded8972568a8
-size 35069
+oid sha256:3ae54ae0035df1f8f1459081e2f1d5cceda6f88cca6ec015d8c0209bf0d34edf
+size 32534
diff --git a/build/icons/imagesharp-logo.svg b/build/icons/imagesharp-logo.svg
index cd4dfa117d..620287457a 100644
--- a/build/icons/imagesharp-logo.svg
+++ b/build/icons/imagesharp-logo.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/features.md b/features.md
deleted file mode 100644
index 1e35b88e0d..0000000000
--- a/features.md
+++ /dev/null
@@ -1,149 +0,0 @@
-
-# Features
-
-### What works so far/ What is planned?
-
-We've achieved a lot so far and hope to do a lot more in the future. We're always looking for help so please pitch in!
-
-- **Encoding/decoding of image formats (plugable).**
- - [x] Jpeg (Includes Subsampling. Progressive writing required)
- - [x] Bmp (Read: 32bit, 24bit, 16 bit. Write: 32bit, 24bit just now)
- - [x] Png (Read: Rgb, Rgba, Grayscale, Grayscale + alpha, Palette. Write: Rgb, Rgba, Grayscale, Grayscale + alpha, Palette) Supports interlaced decoding
- - [x] Gif (Includes animated)
- - [ ] Tiff (Help needed)
-- **Metadata**
- - [x] EXIF Read/Write (Jpeg just now)
- - [ ] ICC (In Progress)
-- **Quantizers (IQuantizer with alpha channel support, dithering, and thresholding)**
- - [x] Octree
- - [x] Xiaolin Wu
- - [x] Palette
-- **DIthering (Error diffusion and Ordered)**
- - [x] Atkinson
- - [x] Burks
- - [x] FloydSteinburg
- - [x] JarvisJudiceNinke
- - [x] Sieera2
- - [x] Sierra3
- - [x] SerraLite
- - [x] Bayer
- - [x] Ordered
-- **Basic color structs with implicit operators.**
- - [x] Bgra32
- - [x] CIE Lab
- - [x] CIE XYZ
- - [x] CMYK
- - [x] HSV
- - [x] HSL
- - [x] YCbCr
-- **IPackedPixel representations of color models. Compatible with Microsoft XNA Game Studio and MonoGame IPackedVector\.**
- - [x] Alpha8
- - [x] Argb32
- - [x] Bgr565
- - [x] Bgra444
- - [x] Bgra565
- - [x] Byte4
- - [x] HalfSingle
- - [x] HalfVector2
- - [x] HalfVector4
- - [x] NormalizedByte2
- - [x] NormalizedByte4
- - [x] NormalizedShort2
- - [x] NormalizedShort4
- - [x] Rg32
- - [x] Rgba1010102
- - [x] Rgba32 - 32bit color in RGBA order - Our default pixel format.
- - [x] Rgba64
- - [x] RgbaVector
- - [x] Short2
- - [x] Short4
-- **Basic shape primitives.**
- - [x] Rectangle
- - [x] Size
- - [x] Point
- - [x] Ellipse
-- **Resampling algorithms. (Optional gamma correction, resize modes, Performance improvements?)**
- - [x] Box
- - [x] Bicubic
- - [x] Lanczos2
- - [x] Lanczos3
- - [x] Lanczos5
- - [x] Lanczos8
- - [x] MitchelNetravali
- - [x] Nearest Neighbour
- - [x] Robidoux
- - [x] Robidoux Sharp
- - [x] Spline
- - [x] Triangle
- - [x] Welch
-- **Padding**
- - [x] Pad
- - [x] ResizeMode.Pad
- - [x] ResizeMode.BoxPad
-- **Cropping**
- - [x] Rectangular Crop
- - [ ] Elliptical Crop
- - [x] Entropy Crop
- - [x] ResizeMode.Crop
-- **Rotation/Skew**
- - [x] Flip (90, 270, FlipType etc)
- - [x] Rotate by angle and center point (Expandable canvas).
- - [x] Skew by x/y angles and center point (Expandable canvas).
-- **ColorMatrix operations (Uses Matrix4x4)**
- - [x] BlackWhite
- - [x] Grayscale BT709
- - [x] Grayscale BT601
- - [x] Hue
- - [x] Saturation
- - [x] Lomograph
- - [x] Polaroid
- - [x] Kodachrome
- - [x] Sepia
- - [x] Achromatomaly
- - [x] Achromatopsia
- - [x] Deuteranomaly
- - [x] Deuteranopia
- - [x] Protanomaly
- - [x] Protanopia
- - [x] Tritanomaly
- - [x] Tritanopia
-- **Edge Detection**
- - [x] Kayyali
- - [x] Kirsch
- - [x] Laplacian3X3
- - [x] Laplacian5X5
- - [x] LaplacianOfGaussian
- - [x] Prewitt
- - [x] RobertsCross
- - [x] Robinson
- - [x] Scharr
- - [x] Sobel
-- **Blurring/Sharpening**
- - [x] Gaussian blur
- - [x] Gaussian sharpening
- - [x] Box Blur
-- **Filters**
- - [x] Alpha
- - [x] Contrast
- - [x] Invert
- - [x] BackgroundColor
- - [x] Brightness
- - [x] Pixelate
- - [ ] Mask
- - [x] Oil Painting
- - [x] Vignette
- - [x] Glow
- - [x] Threshold
-- **Drawing**
- - [x] Image brush
- - [x] Pattern brush
- - [x] Solid brush
- - [X] Hatch brush (Partial copy of System.Drawing brushes)
- - [x] Pen (Solid, Dash, Custom)
- - [x] Line drawing
- - [x] Complex Polygons (Fill, draw)
- - [x] DrawImage
- - [ ] Gradient brush (Need help)
-- **DrawingText**
- - [ ] DrawString (In-progress. Single variant support just now, no italic,bold)
-- Other stuff I haven't thought of.
\ No newline at end of file
diff --git a/input/about.md b/input/about.md
deleted file mode 100644
index 42739928ae..0000000000
--- a/input/about.md
+++ /dev/null
@@ -1,3 +0,0 @@
-Title: About This Project
----
-This project is awesome!
\ No newline at end of file
diff --git a/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj b/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj
index 3e320dccc7..2c4a286d63 100644
--- a/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj
+++ b/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj
@@ -46,7 +46,7 @@
..\..\ImageSharp.ruleset
- SixLabors.ImageSharp.Drawing
+ SixLabors.ImageSharptrue
diff --git a/src/ImageSharp.Drawing/Region.cs b/src/ImageSharp.Drawing/Primitives/Region.cs
similarity index 95%
rename from src/ImageSharp.Drawing/Region.cs
rename to src/ImageSharp.Drawing/Primitives/Region.cs
index c5e7c1cfd4..c85e373fb3 100644
--- a/src/ImageSharp.Drawing/Region.cs
+++ b/src/ImageSharp.Drawing/Primitives/Region.cs
@@ -1,10 +1,9 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-using System;
using SixLabors.Primitives;
-namespace SixLabors.ImageSharp.Drawing
+namespace SixLabors.ImageSharp.Primitives
{
///
/// Represents a region of an image.
diff --git a/src/ImageSharp.Drawing/Paths/ShapePath.cs b/src/ImageSharp.Drawing/Primitives/ShapePath.cs
similarity index 68%
rename from src/ImageSharp.Drawing/Paths/ShapePath.cs
rename to src/ImageSharp.Drawing/Primitives/ShapePath.cs
index 4c22787195..2a569f0616 100644
--- a/src/ImageSharp.Drawing/Paths/ShapePath.cs
+++ b/src/ImageSharp.Drawing/Primitives/ShapePath.cs
@@ -1,14 +1,10 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-using System;
-using System.Buffers;
-using System.Numerics;
-
-using SixLabors.ImageSharp.Memory;
+using SixLabors.ImageSharp.Processing.Drawing.Pens;
using SixLabors.Shapes;
-namespace SixLabors.ImageSharp.Drawing
+namespace SixLabors.ImageSharp.Primitives
{
///
/// A mapping between a and a region.
@@ -20,10 +16,10 @@ namespace SixLabors.ImageSharp.Drawing
///
/// The shape.
/// The pen to apply to the shape.
- // SixLabors.shape willbe moving to a Span/ReadOnlySpan based API shortly use ToArray for now.
- public ShapePath(IPath shape, Pens.IPen pen)
+ // TODO: SixLabors.shape will be moving to a Span/ReadOnlySpan based API shortly use ToArray for now.
+ public ShapePath(IPath shape, IPen pen)
: base(shape.GenerateOutline(pen.StrokeWidth, pen.StrokePattern.ToArray()))
{
}
}
-}
+}
\ No newline at end of file
diff --git a/src/ImageSharp.Drawing/Paths/ShapeRegion.cs b/src/ImageSharp.Drawing/Primitives/ShapeRegion.cs
similarity index 91%
rename from src/ImageSharp.Drawing/Paths/ShapeRegion.cs
rename to src/ImageSharp.Drawing/Primitives/ShapeRegion.cs
index cc27f7fbb8..cfd1945d08 100644
--- a/src/ImageSharp.Drawing/Paths/ShapeRegion.cs
+++ b/src/ImageSharp.Drawing/Primitives/ShapeRegion.cs
@@ -2,13 +2,10 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Buffers;
-using System.Numerics;
-using SixLabors.ImageSharp.Memory;
using SixLabors.Primitives;
using SixLabors.Shapes;
-namespace SixLabors.ImageSharp.Drawing
+namespace SixLabors.ImageSharp.Primitives
{
///
/// A mapping between a and a region.
@@ -48,7 +45,7 @@ namespace SixLabors.ImageSharp.Drawing
var end = new PointF(this.Bounds.Right + 1, y);
// TODO: This is a temporary workaround because of the lack of Span API-s on IPath. We should use MemoryManager.Allocate() here!
- PointF[] innerBuffer = new PointF[buffer.Length];
+ var innerBuffer = new PointF[buffer.Length];
int count = this.Shape.FindIntersections(start, end, innerBuffer, 0);
for (int i = 0; i < count; i++)
diff --git a/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/BrushApplicator.cs
similarity index 92%
rename from src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/Brushes/BrushApplicator.cs
index d8ea435586..f665e8408c 100644
--- a/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/BrushApplicator.cs
@@ -6,7 +6,7 @@ using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
-namespace SixLabors.ImageSharp.Drawing.Brushes.Processors
+namespace SixLabors.ImageSharp.Processing.Drawing.Brushes
{
///
/// primitive that converts a point in to a color for discovering the fill color based on an implementation
@@ -31,12 +31,12 @@ namespace SixLabors.ImageSharp.Drawing.Brushes.Processors
}
///
- /// Gets the blendder
+ /// Gets the blender
///
internal PixelBlender Blender { get; }
///
- /// Gets the destinaion
+ /// Gets the destination
///
protected ImageFrame Target { get; }
@@ -48,8 +48,8 @@ namespace SixLabors.ImageSharp.Drawing.Brushes.Processors
///
/// Gets the color for a single pixel.
///
- /// The x cordinate.
- /// The y cordinate.
+ /// The x coordinate.
+ /// The y coordinate.
/// The a that should be applied to the pixel.
internal abstract TPixel this[int x, int y] { get; }
@@ -57,7 +57,7 @@ namespace SixLabors.ImageSharp.Drawing.Brushes.Processors
public abstract void Dispose();
///
- /// Applies the opactiy weighting for each pixel in a scanline to the target based on the pattern contained in the brush.
+ /// Applies the opacity weighting for each pixel in a scanline to the target based on the pattern contained in the brush.
///
/// The a collection of opacity values between 0 and 1 to be merged with the brushed color value before being applied to the target.
/// The x position in the target pixel space that the start of the scanline data corresponds to.
diff --git a/src/ImageSharp.Drawing/Brushes/Brushes.cs b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/Brushes.cs
similarity index 99%
rename from src/ImageSharp.Drawing/Brushes/Brushes.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/Brushes/Brushes.cs
index 47e207e8c4..141ca403b3 100644
--- a/src/ImageSharp.Drawing/Brushes/Brushes.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/Brushes.cs
@@ -3,7 +3,7 @@
using SixLabors.ImageSharp.PixelFormats;
-namespace SixLabors.ImageSharp.Drawing.Brushes
+namespace SixLabors.ImageSharp.Processing.Drawing.Brushes
{
///
/// A collection of methods for creating generic brushes.
diff --git a/src/ImageSharp.Drawing/Brushes/IBrush.cs b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/IBrush.cs
similarity index 90%
rename from src/ImageSharp.Drawing/Brushes/IBrush.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/Brushes/IBrush.cs
index bb907281b0..93ecb7788c 100644
--- a/src/ImageSharp.Drawing/Brushes/IBrush.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/IBrush.cs
@@ -1,12 +1,10 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-using SixLabors.ImageSharp.Drawing.Brushes.Processors;
-using SixLabors.ImageSharp.Drawing.Processors;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;
-namespace SixLabors.ImageSharp.Drawing.Brushes
+namespace SixLabors.ImageSharp.Processing.Drawing.Brushes
{
///
/// Brush represents a logical configuration of a brush which can be used to source pixel colors
diff --git a/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/ImageBrush{TPixel}.cs
similarity index 95%
rename from src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/Brushes/ImageBrush{TPixel}.cs
index 320c94c96b..c2e3a16eff 100644
--- a/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/ImageBrush{TPixel}.cs
@@ -3,13 +3,11 @@
using System;
using SixLabors.ImageSharp.Advanced;
-using SixLabors.ImageSharp.Drawing.Brushes.Processors;
-using SixLabors.ImageSharp.Drawing.Processors;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;
-namespace SixLabors.ImageSharp.Drawing.Brushes
+namespace SixLabors.ImageSharp.Processing.Drawing.Brushes
{
///
/// Provides an implementation of an image brush for painting images within areas.
@@ -43,9 +41,7 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
///
public BrushApplicator CreateApplicator(ImageFrame source, RectangleF region, GraphicsOptions options)
- {
- return new ImageBrushApplicator(source, this.image, region, options);
- }
+ => new ImageBrushApplicator(source, this.image, region, options);
///
/// The image brush applicator.
diff --git a/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/PatternBrush{TPixel}.cs
similarity index 86%
rename from src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/Brushes/PatternBrush{TPixel}.cs
index cc22b26391..765f2a1326 100644
--- a/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/PatternBrush{TPixel}.cs
@@ -4,13 +4,12 @@
using System;
using System.Numerics;
using SixLabors.ImageSharp.Advanced;
-using SixLabors.ImageSharp.Drawing.Brushes.Processors;
-using SixLabors.ImageSharp.Drawing.Processors;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Primitives;
using SixLabors.Primitives;
-namespace SixLabors.ImageSharp.Drawing.Brushes
+namespace SixLabors.ImageSharp.Processing.Drawing.Brushes
{
///
/// Provides an implementation of a pattern brush for painting patterns.
@@ -40,8 +39,8 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
///
/// The pattern.
///
- private readonly Fast2DArray pattern;
- private readonly Fast2DArray patternVector;
+ private readonly DenseMatrix pattern;
+ private readonly DenseMatrix patternVector;
///
/// Initializes a new instance of the class.
@@ -50,7 +49,7 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
/// Color of the back.
/// The pattern.
public PatternBrush(TPixel foreColor, TPixel backColor, bool[,] pattern)
- : this(foreColor, backColor, new Fast2DArray(pattern))
+ : this(foreColor, backColor, new DenseMatrix(pattern))
{
}
@@ -60,12 +59,12 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
/// Color of the fore.
/// Color of the back.
/// The pattern.
- internal PatternBrush(TPixel foreColor, TPixel backColor, Fast2DArray pattern)
+ internal PatternBrush(TPixel foreColor, TPixel backColor, DenseMatrix pattern)
{
var foreColorVector = foreColor.ToVector4();
var backColorVector = backColor.ToVector4();
- this.pattern = new Fast2DArray(pattern.Width, pattern.Height);
- this.patternVector = new Fast2DArray(pattern.Width, pattern.Height);
+ this.pattern = new DenseMatrix(pattern.Columns, pattern.Rows);
+ this.patternVector = new DenseMatrix(pattern.Columns, pattern.Rows);
for (int i = 0; i < pattern.Data.Length; i++)
{
if (pattern.Data[i])
@@ -105,8 +104,8 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
///
/// The pattern.
///
- private readonly Fast2DArray pattern;
- private readonly Fast2DArray patternVector;
+ private readonly DenseMatrix pattern;
+ private readonly DenseMatrix patternVector;
///
/// Initializes a new instance of the class.
@@ -115,7 +114,7 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
/// The pattern.
/// The patternVector.
/// The options
- public PatternBrushApplicator(ImageFrame source, Fast2DArray pattern, Fast2DArray patternVector, GraphicsOptions options)
+ public PatternBrushApplicator(ImageFrame source, DenseMatrix pattern, DenseMatrix patternVector, GraphicsOptions options)
: base(source, options)
{
this.pattern = pattern;
@@ -134,8 +133,8 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
{
get
{
- x = x % this.pattern.Width;
- y = y % this.pattern.Height;
+ x = x % this.pattern.Columns;
+ y = y % this.pattern.Rows;
// 2d array index at row/column
return this.pattern[y, x];
@@ -151,7 +150,7 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
///
internal override void Apply(Span scanline, int x, int y)
{
- int patternY = y % this.pattern.Height;
+ int patternY = y % this.pattern.Rows;
MemoryManager memoryManager = this.Target.MemoryManager;
using (IBuffer amountBuffer = memoryManager.Allocate(scanline.Length))
@@ -164,7 +163,7 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
{
amountSpan[i] = (scanline[i] * this.Options.BlendPercentage).Clamp(0, 1);
- int patternX = (x + i) % this.pattern.Width;
+ int patternX = (x + i) % this.pattern.Columns;
overlaySpan[i] = this.pattern[patternY, patternX];
}
diff --git a/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/RecolorBrush{TPixel}.cs
similarity index 88%
rename from src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/Brushes/RecolorBrush{TPixel}.cs
index 39afd965c8..324c54e186 100644
--- a/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/RecolorBrush{TPixel}.cs
@@ -4,13 +4,11 @@
using System;
using System.Numerics;
using SixLabors.ImageSharp.Advanced;
-using SixLabors.ImageSharp.Drawing.Brushes.Processors;
-using SixLabors.ImageSharp.Drawing.Processors;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;
-namespace SixLabors.ImageSharp.Drawing.Brushes
+namespace SixLabors.ImageSharp.Processing.Drawing.Brushes
{
///
/// Provides an implementation of a brush that can recolor an image
@@ -23,21 +21,18 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
/// Initializes a new instance of the class.
///
/// Color of the source.
- /// Color of the target.
+ /// Color of the target.
/// The threshold as a value between 0 and 1.
- public RecolorBrush(TPixel sourceColor, TPixel targeTPixel, float threshold)
+ public RecolorBrush(TPixel sourceColor, TPixel targetColor, float threshold)
{
this.SourceColor = sourceColor;
this.Threshold = threshold;
- this.TargeTPixel = targeTPixel;
+ this.TargetColor = targetColor;
}
///
/// Gets the threshold.
///
- ///
- /// The threshold.
- ///
public float Threshold { get; }
///
@@ -51,15 +46,12 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
///
/// Gets the target color.
///
- ///
- /// The color of the target.
- ///
- public TPixel TargeTPixel { get; }
+ public TPixel TargetColor { get; }
///
public BrushApplicator CreateApplicator(ImageFrame source, RectangleF region, GraphicsOptions options)
{
- return new RecolorBrushApplicator(source, this.SourceColor, this.TargeTPixel, this.Threshold, options);
+ return new RecolorBrushApplicator(source, this.SourceColor, this.TargetColor, this.Threshold, options);
}
///
@@ -99,7 +91,7 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
this.targetColor = targetColor.ToVector4();
this.targetColorPixel = targetColor;
- // Lets hack a min max extreams for a color space by letting the IPackedPixel clamp our values to something in the correct spaces :)
+ // Lets hack a min max extremes for a color space by letting the IPackedPixel clamp our values to something in the correct spaces :)
var maxColor = default(TPixel);
maxColor.PackFromVector4(new Vector4(float.MaxValue));
var minColor = default(TPixel);
@@ -158,8 +150,8 @@ namespace SixLabors.ImageSharp.Drawing.Brushes
int offsetX = x + i;
- // no doubt this one can be optermised further but I can't imagine its
- // actually being used and can probably be removed/interalised for now
+ // No doubt this one can be optimized further but I can't imagine its
+ // actually being used and can probably be removed/internalized for now
overlaySpan[i] = this[offsetX, y];
}
diff --git a/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/SolidBrush{TPixel}.cs
similarity index 95%
rename from src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/Brushes/SolidBrush{TPixel}.cs
index 9630c707ef..826f5f60a7 100644
--- a/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/Brushes/SolidBrush{TPixel}.cs
@@ -2,15 +2,12 @@
// Licensed under the Apache License, Version 2.0.
using System;
-using System.Numerics;
using SixLabors.ImageSharp.Advanced;
-using SixLabors.ImageSharp.Drawing.Brushes.Processors;
-using SixLabors.ImageSharp.Drawing.Processors;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives;
-namespace SixLabors.ImageSharp.Drawing.Brushes
+namespace SixLabors.ImageSharp.Processing.Drawing.Brushes
{
///
/// Provides an implementation of a solid brush for painting solid color areas.
diff --git a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs b/src/ImageSharp.Drawing/Processing/Drawing/DrawBezierExtensions.cs
similarity index 70%
rename from src/ImageSharp.Drawing/Paths/DrawBeziers.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/DrawBezierExtensions.cs
index de4fdd003b..8f075d5c2c 100644
--- a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/DrawBezierExtensions.cs
@@ -1,23 +1,21 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-using System.Numerics;
-using SixLabors.ImageSharp.Drawing;
-using SixLabors.ImageSharp.Drawing.Brushes;
-using SixLabors.ImageSharp.Drawing.Pens;
using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Processing.Drawing.Brushes;
+using SixLabors.ImageSharp.Processing.Drawing.Pens;
using SixLabors.Primitives;
using SixLabors.Shapes;
-namespace SixLabors.ImageSharp
+namespace SixLabors.ImageSharp.Processing.Drawing
{
///
- /// Extension methods for the type.
+ /// Adds extensions that allow the drawing of Bezier paths to the type.
///
- public static partial class ImageExtensions
+ public static class DrawBezierExtensions
{
///
- /// Draws the provided Points as an open Bezier path at the provided thickness with the supplied brush
+ /// Draws the provided points as an open Bezier path at the provided thickness with the supplied brush
///
/// The type of the color.
/// The image this method extends.
@@ -27,13 +25,11 @@ namespace SixLabors.ImageSharp
/// The options.
/// The .
public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options)
- where TPixel : struct, IPixel
- {
- return source.Draw(new Pen(brush, thickness), new Path(new CubicBezierLineSegment(points)), options);
- }
+ where TPixel : struct, IPixel
+ => source.Draw(new Pen(brush, thickness), new Path(new CubicBezierLineSegment(points)), options);
///
- /// Draws the provided Points as an open Bezier path at the provided thickness with the supplied brush
+ /// Draws the provided points as an open Bezier path at the provided thickness with the supplied brush
///
/// The type of the color.
/// The image this method extends.
@@ -42,13 +38,11 @@ namespace SixLabors.ImageSharp
/// The points.
/// The .
public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, IBrush brush, float thickness, PointF[] points)
- where TPixel : struct, IPixel
- {
- return source.Draw(new Pen(brush, thickness), new Path(new CubicBezierLineSegment(points)));
- }
+ where TPixel : struct, IPixel
+ => source.Draw(new Pen(brush, thickness), new Path(new CubicBezierLineSegment(points)));
///
- /// Draws the provided Points as an open Bezier path at the provided thickness with the supplied brush
+ /// Draws the provided points as an open Bezier path at the provided thickness with the supplied brush
///
/// The type of the color.
/// The image this method extends.
@@ -57,13 +51,11 @@ namespace SixLabors.ImageSharp
/// The points.
/// The .
public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, TPixel color, float thickness, PointF[] points)
- where TPixel : struct, IPixel
- {
- return source.DrawBeziers(new SolidBrush(color), thickness, points);
- }
+ where TPixel : struct, IPixel
+ => source.DrawBeziers(new SolidBrush(color), thickness, points);
///
- /// Draws the provided Points as an open Bezier path at the provided thickness with the supplied brush
+ /// Draws the provided points as an open Bezier path at the provided thickness with the supplied brush
///
/// The type of the color.
/// The image this method extends.
@@ -73,13 +65,11 @@ namespace SixLabors.ImageSharp
/// The options.
/// The .
public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, TPixel color, float thickness, PointF[] points, GraphicsOptions options)
- where TPixel : struct, IPixel
- {
- return source.DrawBeziers(new SolidBrush(color), thickness, points, options);
- }
+ where TPixel : struct, IPixel
+ => source.DrawBeziers(new SolidBrush(color), thickness, points, options);
///
- /// Draws the provided Points as an open Bezier path with the supplied pen
+ /// Draws the provided points as an open Bezier path with the supplied pen
///
/// The type of the color.
/// The image this method extends.
@@ -88,13 +78,11 @@ namespace SixLabors.ImageSharp
/// The options.
/// The .
public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, IPen pen, PointF[] points, GraphicsOptions options)
- where TPixel : struct, IPixel
- {
- return source.Draw(pen, new Path(new CubicBezierLineSegment(points)), options);
- }
+ where TPixel : struct, IPixel
+ => source.Draw(pen, new Path(new CubicBezierLineSegment(points)), options);
///
- /// Draws the provided Points as an open Bezier path with the supplied pen
+ /// Draws the provided points as an open Bezier path with the supplied pen
///
/// The type of the color.
/// The image this method extends.
@@ -102,9 +90,7 @@ namespace SixLabors.ImageSharp
/// The points.
/// The .
public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, IPen pen, PointF[] points)
- where TPixel : struct, IPixel
- {
- return source.Draw(pen, new Path(new CubicBezierLineSegment(points)));
- }
+ where TPixel : struct, IPixel
+ => source.Draw(pen, new Path(new CubicBezierLineSegment(points)));
}
}
diff --git a/src/ImageSharp.Drawing/DrawImage.cs b/src/ImageSharp.Drawing/Processing/Drawing/DrawImageExtensions.cs
similarity index 79%
rename from src/ImageSharp.Drawing/DrawImage.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/DrawImageExtensions.cs
index f1db72db60..6187682067 100644
--- a/src/ImageSharp.Drawing/DrawImage.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/DrawImageExtensions.cs
@@ -1,33 +1,17 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-using SixLabors.ImageSharp.Drawing.Processors;
using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Processing.Drawing.Processors;
using SixLabors.Primitives;
-namespace SixLabors.ImageSharp
+namespace SixLabors.ImageSharp.Processing.Drawing
{
///
- /// Extension methods for the type.
+ /// Adds extensions that allow the drawing of images to the type.
///
- public static partial class ImageExtensions
+ public static class DrawImageExtensions
{
- ///
- /// Draws the given image together with the current one by blending their pixels.
- ///
- /// The image this method extends.
- /// The image to blend with the currently processing image.
- /// The pixel format.
- /// The location to draw the blended image.
- /// The options.
- /// The .
- public static IImageProcessingContext DrawImage(this IImageProcessingContext source, Image image, Point location, GraphicsOptions options)
- where TPixel : struct, IPixel
- {
- source.ApplyProcessor(new DrawImageProcessor(image, location, options));
- return source;
- }
-
///
/// Draws the given image together with the current one by blending their pixels.
///
@@ -38,11 +22,7 @@ namespace SixLabors.ImageSharp
/// The .
public static IImageProcessingContext Blend(this IImageProcessingContext source, Image image, float opacity)
where TPixel : struct, IPixel
- {
- GraphicsOptions options = GraphicsOptions.Default;
- options.BlendPercentage = opacity;
- return DrawImage(source, image, Point.Empty, options);
- }
+ => source.ApplyProcessor(new DrawImageProcessor(image, opacity));
///
/// Draws the given image together with the current one by blending their pixels.
@@ -55,12 +35,7 @@ namespace SixLabors.ImageSharp
/// The .
public static IImageProcessingContext Blend(this IImageProcessingContext source, Image image, PixelBlenderMode blender, float opacity)
where TPixel : struct, IPixel
- {
- GraphicsOptions options = GraphicsOptions.Default;
- options.BlendPercentage = opacity;
- options.BlenderMode = blender;
- return DrawImage(source, image, Point.Empty, options);
- }
+ => source.ApplyProcessor(new DrawImageProcessor(image, opacity, blender));
///
/// Draws the given image together with the current one by blending their pixels.
@@ -73,7 +48,7 @@ namespace SixLabors.ImageSharp
public static IImageProcessingContext Blend(this IImageProcessingContext source, Image image, GraphicsOptions options)
where TPixel : struct, IPixel
{
- return DrawImage(source, image, Point.Empty, options);
+ return source.ApplyProcessor(new DrawImageProcessor(image, options));
}
///
@@ -87,11 +62,7 @@ namespace SixLabors.ImageSharp
/// The .
public static IImageProcessingContext DrawImage(this IImageProcessingContext source, Image image, float opacity, Point location)
where TPixel : struct, IPixel
- {
- GraphicsOptions options = GraphicsOptions.Default;
- options.BlendPercentage = opacity;
- return source.DrawImage(image, location, options);
- }
+ => source.ApplyProcessor(new DrawImageProcessor(image, location, opacity));
///
/// Draws the given image together with the current one by blending their pixels.
@@ -105,11 +76,19 @@ namespace SixLabors.ImageSharp
/// The .
public static IImageProcessingContext DrawImage(this IImageProcessingContext source, Image image, PixelBlenderMode blender, float opacity, Point location)
where TPixel : struct, IPixel
- {
- GraphicsOptions options = GraphicsOptions.Default;
- options.BlenderMode = blender;
- options.BlendPercentage = opacity;
- return source.DrawImage(image, location, options);
- }
+ => source.ApplyProcessor(new DrawImageProcessor(image, location, opacity, blender));
+
+ ///
+ /// Draws the given image together with the current one by blending their pixels.
+ ///
+ /// The image this method extends.
+ /// The image to blend with the currently processing image.
+ /// The pixel format.
+ /// The location to draw the blended image.
+ /// The options containing the blend mode and opacity.
+ /// The .
+ public static IImageProcessingContext DrawImage(this IImageProcessingContext source, Image image, Point location, GraphicsOptions options)
+ where TPixel : struct, IPixel
+ => source.ApplyProcessor(new DrawImageProcessor(image, location, options));
}
}
\ No newline at end of file
diff --git a/src/ImageSharp.Drawing/Paths/DrawLines.cs b/src/ImageSharp.Drawing/Processing/Drawing/DrawLineExtensions.cs
similarity index 77%
rename from src/ImageSharp.Drawing/Paths/DrawLines.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/DrawLineExtensions.cs
index e5d9a1b3b4..9d2ea0c1d8 100644
--- a/src/ImageSharp.Drawing/Paths/DrawLines.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/DrawLineExtensions.cs
@@ -1,20 +1,18 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-using System.Numerics;
-using SixLabors.ImageSharp.Drawing;
-using SixLabors.ImageSharp.Drawing.Brushes;
-using SixLabors.ImageSharp.Drawing.Pens;
using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Processing.Drawing.Brushes;
+using SixLabors.ImageSharp.Processing.Drawing.Pens;
using SixLabors.Primitives;
using SixLabors.Shapes;
-namespace SixLabors.ImageSharp
+namespace SixLabors.ImageSharp.Processing.Drawing
{
///
- /// Extension methods for the type.
+ /// Adds extensions that allow the drawing of lines to the type.
///
- public static partial class ImageExtensions
+ public static class DrawLineExtensions
{
///
/// Draws the provided Points as an open Linear path at the provided thickness with the supplied brush
@@ -27,10 +25,8 @@ namespace SixLabors.ImageSharp
/// The options.
/// The .
public static IImageProcessingContext DrawLines(this IImageProcessingContext source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options)
- where TPixel : struct, IPixel
- {
- return source.Draw(new Pen(brush, thickness), new Path(new LinearLineSegment(points)), options);
- }
+ where TPixel : struct, IPixel
+ => source.Draw(new Pen(brush, thickness), new Path(new LinearLineSegment(points)), options);
///
/// Draws the provided Points as an open Linear path at the provided thickness with the supplied brush
@@ -42,10 +38,8 @@ namespace SixLabors.ImageSharp
/// The points.
/// The .
public static IImageProcessingContext DrawLines(this IImageProcessingContext source, IBrush brush, float thickness, PointF[] points)
- where TPixel : struct, IPixel
- {
- return source.Draw(new Pen(brush, thickness), new Path(new LinearLineSegment(points)));
- }
+ where TPixel : struct, IPixel
+ => source.Draw(new Pen(brush, thickness), new Path(new LinearLineSegment(points)));
///
/// Draws the provided Points as an open Linear path at the provided thickness with the supplied brush
@@ -57,10 +51,8 @@ namespace SixLabors.ImageSharp
/// The points.
/// The .
public static IImageProcessingContext DrawLines(this IImageProcessingContext source, TPixel color, float thickness, PointF[] points)
- where TPixel : struct, IPixel
- {
- return source.DrawLines(new SolidBrush(color), thickness, points);
- }
+ where TPixel : struct, IPixel
+ => source.DrawLines(new SolidBrush(color), thickness, points);
///
/// Draws the provided Points as an open Linear path at the provided thickness with the supplied brush
@@ -73,10 +65,8 @@ namespace SixLabors.ImageSharp
/// The options.
/// The .>
public static IImageProcessingContext DrawLines(this IImageProcessingContext source, TPixel color, float thickness, PointF[] points, GraphicsOptions options)
- where TPixel : struct, IPixel
- {
- return source.DrawLines(new SolidBrush(color), thickness, points, options);
- }
+ where TPixel : struct, IPixel
+ => source.DrawLines(new SolidBrush(color), thickness, points, options);
///
/// Draws the provided Points as an open Linear path with the supplied pen
@@ -88,10 +78,8 @@ namespace SixLabors.ImageSharp
/// The options.
/// The .
public static IImageProcessingContext DrawLines(this IImageProcessingContext source, IPen pen, PointF[] points, GraphicsOptions options)
- where TPixel : struct, IPixel
- {
- return source.Draw(pen, new Path(new LinearLineSegment(points)), options);
- }
+ where TPixel : struct, IPixel
+ => source.Draw(pen, new Path(new LinearLineSegment(points)), options);
///
/// Draws the provided Points as an open Linear path with the supplied pen
@@ -102,9 +90,7 @@ namespace SixLabors.ImageSharp
/// The points.
/// The .
public static IImageProcessingContext DrawLines(this IImageProcessingContext source, IPen pen, PointF[] points)
- where TPixel : struct, IPixel
- {
- return source.Draw(pen, new Path(new LinearLineSegment(points)));
- }
+ where TPixel : struct, IPixel
+ => source.Draw(pen, new Path(new LinearLineSegment(points)));
}
}
diff --git a/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs b/src/ImageSharp.Drawing/Processing/Drawing/DrawPathCollectionExtensions.cs
similarity index 81%
rename from src/ImageSharp.Drawing/Paths/DrawPathCollection.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/DrawPathCollectionExtensions.cs
index a126663b05..d148638ae1 100644
--- a/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/DrawPathCollectionExtensions.cs
@@ -1,18 +1,17 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-using SixLabors.ImageSharp.Drawing;
-using SixLabors.ImageSharp.Drawing.Brushes;
-using SixLabors.ImageSharp.Drawing.Pens;
using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Processing.Drawing.Brushes;
+using SixLabors.ImageSharp.Processing.Drawing.Pens;
using SixLabors.Shapes;
-namespace SixLabors.ImageSharp
+namespace SixLabors.ImageSharp.Processing.Drawing
{
///
- /// Extension methods for the type.
+ /// Adds extensions that allow the drawing of collections of polygon outlines to the type.
///
- public static partial class ImageExtensions
+ public static class DrawPathCollectionExtensions
{
///
/// Draws the outline of the polygon with the provided pen.
@@ -43,10 +42,8 @@ namespace SixLabors.ImageSharp
/// The paths.
/// The .
public static IImageProcessingContext Draw(this IImageProcessingContext source, IPen pen, IPathCollection paths)
- where TPixel : struct, IPixel
- {
- return source.Draw(pen, paths, GraphicsOptions.Default);
- }
+ where TPixel : struct, IPixel
+ => source.Draw(pen, paths, GraphicsOptions.Default);
///
/// Draws the outline of the polygon with the provided brush at the provided thickness.
@@ -59,10 +56,8 @@ namespace SixLabors.ImageSharp
/// The options.
/// The .
public static IImageProcessingContext Draw(this IImageProcessingContext source, IBrush brush, float thickness, IPathCollection paths, GraphicsOptions options)
- where TPixel : struct, IPixel
- {
- return source.Draw(new Pen(brush, thickness), paths, options);
- }
+ where TPixel : struct, IPixel
+ => source.Draw(new Pen(brush, thickness), paths, options);
///
/// Draws the outline of the polygon with the provided brush at the provided thickness.
@@ -74,10 +69,8 @@ namespace SixLabors.ImageSharp
/// The paths.
/// The .
public static IImageProcessingContext Draw(this IImageProcessingContext source, IBrush brush, float thickness, IPathCollection paths)
- where TPixel : struct, IPixel
- {
- return source.Draw(new Pen(brush, thickness), paths);
- }
+ where TPixel : struct, IPixel
+ => source.Draw(new Pen(brush, thickness), paths);
///
/// Draws the outline of the polygon with the provided brush at the provided thickness.
@@ -90,10 +83,8 @@ namespace SixLabors.ImageSharp
/// The options.
/// The .
public static IImageProcessingContext Draw(this IImageProcessingContext source, TPixel color, float thickness, IPathCollection paths, GraphicsOptions options)
- where TPixel : struct, IPixel
- {
- return source.Draw(new SolidBrush(color), thickness, paths, options);
- }
+ where TPixel : struct, IPixel
+ => source.Draw(new SolidBrush(color), thickness, paths, options);
///
/// Draws the outline of the polygon with the provided brush at the provided thickness.
@@ -105,9 +96,7 @@ namespace SixLabors.ImageSharp
/// The paths.
/// The .
public static IImageProcessingContext Draw(this IImageProcessingContext source, TPixel color, float thickness, IPathCollection paths)
- where TPixel : struct, IPixel
- {
- return source.Draw(new SolidBrush(color), thickness, paths);
- }
+ where TPixel : struct, IPixel
+ => source.Draw(new SolidBrush(color), thickness, paths);
}
-}
+}
\ No newline at end of file
diff --git a/src/ImageSharp.Drawing/Paths/DrawPath.cs b/src/ImageSharp.Drawing/Processing/Drawing/DrawPathExtensions.cs
similarity index 78%
rename from src/ImageSharp.Drawing/Paths/DrawPath.cs
rename to src/ImageSharp.Drawing/Processing/Drawing/DrawPathExtensions.cs
index b6c821a60b..a795ee295b 100644
--- a/src/ImageSharp.Drawing/Paths/DrawPath.cs
+++ b/src/ImageSharp.Drawing/Processing/Drawing/DrawPathExtensions.cs
@@ -1,18 +1,18 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-using SixLabors.ImageSharp.Drawing;
-using SixLabors.ImageSharp.Drawing.Brushes;
-using SixLabors.ImageSharp.Drawing.Pens;
using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Primitives;
+using SixLabors.ImageSharp.Processing.Drawing.Brushes;
+using SixLabors.ImageSharp.Processing.Drawing.Pens;
using SixLabors.Shapes;
-namespace SixLabors.ImageSharp
+namespace SixLabors.ImageSharp.Processing.Drawing
{
///
- /// Extension methods for the type.
+ /// Adds extensions that allow the drawing of polygon outlines to the type.
///
- public static partial class ImageExtensions
+ public static class DrawPathExtensions
{
///
/// Draws the outline of the polygon with the provided pen.
@@ -24,10 +24,8 @@ namespace SixLabors.ImageSharp
/// The options.
/// The .
public static IImageProcessingContext Draw(this IImageProcessingContext source, IPen pen, IPath path, GraphicsOptions options)
- where TPixel : struct, IPixel
- {
- return source.Fill(pen.StrokeFill, new ShapePath(path, pen), options);
- }
+ where TPixel : struct, IPixel
+ => source.Fill(pen.StrokeFill, new ShapePath(path, pen), options);
///
/// Draws the outline of the polygon with the provided pen.
@@ -38,10 +36,8 @@ namespace SixLabors.ImageSharp
/// The path.
/// The .
public static IImageProcessingContext Draw(this IImageProcessingContext source, IPen pen, IPath path)
- where TPixel : struct, IPixel
- {
- return source.Draw(pen, path, GraphicsOptions.Default);
- }
+ where TPixel : struct, IPixel
+ => source.Draw(pen, path, GraphicsOptions.Default);
///
/// Draws the outline of the polygon with the provided brush at the provided thickness.
@@ -54,10 +50,8 @@ namespace SixLabors.ImageSharp
/// The options.
/// The .
public static IImageProcessingContext Draw(this IImageProcessingContext