diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 000000000..128265ff6
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,31 @@
+{
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
+ // for the documentation about the tasks.json format
+ "version": "0.1.0",
+ "command": "dotnet",
+ "isShellCommand": true,
+ "args": [],
+ "tasks": [
+ {
+ "taskName": "build",
+ "args": [ "src/*/project.json", "-f", "netstandard1.1" ],
+ "isBuildCommand": true,
+ "showOutput": "always",
+ "problemMatcher": "$msCompile"
+ },
+ {
+ "taskName": "build benchmark",
+ "suppressTaskName": true,
+ "args": [ "build", "tests/ImageSharp.Benchmarks/project.json", "-f", "netcoreapp1.1", "-c", "Release" ],
+ "showOutput": "always",
+ "problemMatcher": "$msCompile"
+ },
+ {
+ "taskName": "test",
+ "args": ["tests/ImageSharp.Tests/project.json", "-f", "netcoreapp1.1"],
+ "isTestCommand": true,
+ "showOutput": "always",
+ "problemMatcher": "$msCompile"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ImageSharp.ruleset b/ImageSharp.ruleset
index 554dc16dd..2daf6243a 100644
--- a/ImageSharp.ruleset
+++ b/ImageSharp.ruleset
@@ -1,6 +1,7 @@
+
diff --git a/ImageSharp.sln b/ImageSharp.sln
index 97021cffe..dec5cbc36 100644
--- a/ImageSharp.sln
+++ b/ImageSharp.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26127.0
+VisualStudioVersion = 15.0.26228.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}"
ProjectSection(SolutionItems) = preProject
@@ -55,15 +55,20 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageSharp.Sandbox46", "tes
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26} = {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}
{27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F} = {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}
{7213767C-0003-41CA-AB18-0223CFA7CE4B} = {7213767C-0003-41CA-AB18-0223CFA7CE4B}
+ {E5BD4F96-28A8-410C-8B63-1C5731948549} = {E5BD4F96-28A8-410C-8B63-1C5731948549}
{C77661B9-F793-422E-8E27-AC60ECC5F215} = {C77661B9-F793-422E-8E27-AC60ECC5F215}
{556ABDCF-ED93-4327-BE98-F6815F78B9B8} = {556ABDCF-ED93-4327-BE98-F6815F78B9B8}
{A623CFE9-9D2B-4528-AD1F-2E834B061134} = {A623CFE9-9D2B-4528-AD1F-2E834B061134}
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageSharp.Tests", "tests\ImageSharp.Tests\ImageSharp.Tests.csproj", "{EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Tests", "tests\ImageSharp.Tests\ImageSharp.Tests.csproj", "{EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Benchmarks", "tests\ImageSharp.Benchmarks\ImageSharp.Benchmarks.csproj", "{2BF743D8-2A06-412D-96D7-F448F00C5EA5}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Drawing.Paths", "src\ImageSharp.Drawing.Paths\ImageSharp.Drawing.Paths.csproj", "{E5BD4F96-28A8-410C-8B63-1C5731948549}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Drawing.Text", "src\ImageSharp.Drawing.Text\ImageSharp.Drawing.Text.csproj", "{329D7698-65BC-48AD-A16F-428682964493}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -76,100 +81,100 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Debug|x64.ActiveCfg = Debug|x64
- {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Debug|x64.Build.0 = Debug|x64
- {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Debug|x86.ActiveCfg = Debug|x86
- {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Debug|x86.Build.0 = Debug|x86
+ {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Debug|x64.Build.0 = Debug|Any CPU
+ {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Debug|x86.Build.0 = Debug|Any CPU
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|Any CPU.Build.0 = Release|Any CPU
- {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|x64.ActiveCfg = Release|x64
- {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|x64.Build.0 = Release|x64
- {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|x86.ActiveCfg = Release|x86
- {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|x86.Build.0 = Release|x86
+ {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|x64.ActiveCfg = Release|Any CPU
+ {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|x64.Build.0 = Release|Any CPU
+ {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|x86.ActiveCfg = Release|Any CPU
+ {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|x86.Build.0 = Release|Any CPU
{2E33181E-6E28-4662-A801-E2E7DC206029}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E33181E-6E28-4662-A801-E2E7DC206029}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2E33181E-6E28-4662-A801-E2E7DC206029}.Debug|x64.ActiveCfg = Debug|x64
- {2E33181E-6E28-4662-A801-E2E7DC206029}.Debug|x64.Build.0 = Debug|x64
- {2E33181E-6E28-4662-A801-E2E7DC206029}.Debug|x86.ActiveCfg = Debug|x86
- {2E33181E-6E28-4662-A801-E2E7DC206029}.Debug|x86.Build.0 = Debug|x86
+ {2E33181E-6E28-4662-A801-E2E7DC206029}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {2E33181E-6E28-4662-A801-E2E7DC206029}.Debug|x64.Build.0 = Debug|Any CPU
+ {2E33181E-6E28-4662-A801-E2E7DC206029}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2E33181E-6E28-4662-A801-E2E7DC206029}.Debug|x86.Build.0 = Debug|Any CPU
{2E33181E-6E28-4662-A801-E2E7DC206029}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E33181E-6E28-4662-A801-E2E7DC206029}.Release|Any CPU.Build.0 = Release|Any CPU
- {2E33181E-6E28-4662-A801-E2E7DC206029}.Release|x64.ActiveCfg = Release|x64
- {2E33181E-6E28-4662-A801-E2E7DC206029}.Release|x64.Build.0 = Release|x64
- {2E33181E-6E28-4662-A801-E2E7DC206029}.Release|x86.ActiveCfg = Release|x86
- {2E33181E-6E28-4662-A801-E2E7DC206029}.Release|x86.Build.0 = Release|x86
+ {2E33181E-6E28-4662-A801-E2E7DC206029}.Release|x64.ActiveCfg = Release|Any CPU
+ {2E33181E-6E28-4662-A801-E2E7DC206029}.Release|x64.Build.0 = Release|Any CPU
+ {2E33181E-6E28-4662-A801-E2E7DC206029}.Release|x86.ActiveCfg = Release|Any CPU
+ {2E33181E-6E28-4662-A801-E2E7DC206029}.Release|x86.Build.0 = Release|Any CPU
{575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x64.ActiveCfg = Debug|x64
- {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x64.Build.0 = Debug|x64
- {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x86.ActiveCfg = Debug|x86
- {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x86.Build.0 = Debug|x86
+ {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x64.Build.0 = Debug|Any CPU
+ {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x86.Build.0 = Debug|Any CPU
{575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|Any CPU.ActiveCfg = Release|Any CPU
{575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|Any CPU.Build.0 = Release|Any CPU
- {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x64.ActiveCfg = Release|x64
- {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x64.Build.0 = Release|x64
- {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x86.ActiveCfg = Release|x86
- {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x86.Build.0 = Release|x86
+ {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x64.ActiveCfg = Release|Any CPU
+ {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x64.Build.0 = Release|Any CPU
+ {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x86.ActiveCfg = Release|Any CPU
+ {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x86.Build.0 = Release|Any CPU
{C77661B9-F793-422E-8E27-AC60ECC5F215}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C77661B9-F793-422E-8E27-AC60ECC5F215}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C77661B9-F793-422E-8E27-AC60ECC5F215}.Debug|x64.ActiveCfg = Debug|x64
- {C77661B9-F793-422E-8E27-AC60ECC5F215}.Debug|x64.Build.0 = Debug|x64
- {C77661B9-F793-422E-8E27-AC60ECC5F215}.Debug|x86.ActiveCfg = Debug|x86
- {C77661B9-F793-422E-8E27-AC60ECC5F215}.Debug|x86.Build.0 = Debug|x86
+ {C77661B9-F793-422E-8E27-AC60ECC5F215}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {C77661B9-F793-422E-8E27-AC60ECC5F215}.Debug|x64.Build.0 = Debug|Any CPU
+ {C77661B9-F793-422E-8E27-AC60ECC5F215}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C77661B9-F793-422E-8E27-AC60ECC5F215}.Debug|x86.Build.0 = Debug|Any CPU
{C77661B9-F793-422E-8E27-AC60ECC5F215}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C77661B9-F793-422E-8E27-AC60ECC5F215}.Release|Any CPU.Build.0 = Release|Any CPU
- {C77661B9-F793-422E-8E27-AC60ECC5F215}.Release|x64.ActiveCfg = Release|x64
- {C77661B9-F793-422E-8E27-AC60ECC5F215}.Release|x64.Build.0 = Release|x64
- {C77661B9-F793-422E-8E27-AC60ECC5F215}.Release|x86.ActiveCfg = Release|x86
- {C77661B9-F793-422E-8E27-AC60ECC5F215}.Release|x86.Build.0 = Release|x86
+ {C77661B9-F793-422E-8E27-AC60ECC5F215}.Release|x64.ActiveCfg = Release|Any CPU
+ {C77661B9-F793-422E-8E27-AC60ECC5F215}.Release|x64.Build.0 = Release|Any CPU
+ {C77661B9-F793-422E-8E27-AC60ECC5F215}.Release|x86.ActiveCfg = Release|Any CPU
+ {C77661B9-F793-422E-8E27-AC60ECC5F215}.Release|x86.Build.0 = Release|Any CPU
{27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Debug|x64.ActiveCfg = Debug|x64
- {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Debug|x64.Build.0 = Debug|x64
- {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Debug|x86.ActiveCfg = Debug|x86
- {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Debug|x86.Build.0 = Debug|x86
+ {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Debug|x64.Build.0 = Debug|Any CPU
+ {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Debug|x86.Build.0 = Debug|Any CPU
{27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Release|Any CPU.Build.0 = Release|Any CPU
- {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Release|x64.ActiveCfg = Release|x64
- {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Release|x64.Build.0 = Release|x64
- {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Release|x86.ActiveCfg = Release|x86
- {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Release|x86.Build.0 = Release|x86
+ {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Release|x64.ActiveCfg = Release|Any CPU
+ {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Release|x64.Build.0 = Release|Any CPU
+ {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Release|x86.ActiveCfg = Release|Any CPU
+ {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}.Release|x86.Build.0 = Release|Any CPU
{7213767C-0003-41CA-AB18-0223CFA7CE4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7213767C-0003-41CA-AB18-0223CFA7CE4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Debug|x64.ActiveCfg = Debug|x64
- {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Debug|x64.Build.0 = Debug|x64
- {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Debug|x86.ActiveCfg = Debug|x86
- {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Debug|x86.Build.0 = Debug|x86
+ {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Debug|x64.Build.0 = Debug|Any CPU
+ {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Debug|x86.Build.0 = Debug|Any CPU
{7213767C-0003-41CA-AB18-0223CFA7CE4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7213767C-0003-41CA-AB18-0223CFA7CE4B}.Release|Any CPU.Build.0 = Release|Any CPU
- {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Release|x64.ActiveCfg = Release|x64
- {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Release|x64.Build.0 = Release|x64
- {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Release|x86.ActiveCfg = Release|x86
- {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Release|x86.Build.0 = Release|x86
+ {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Release|x64.ActiveCfg = Release|Any CPU
+ {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Release|x64.Build.0 = Release|Any CPU
+ {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Release|x86.ActiveCfg = Release|Any CPU
+ {7213767C-0003-41CA-AB18-0223CFA7CE4B}.Release|x86.Build.0 = Release|Any CPU
{556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Debug|x64.ActiveCfg = Debug|x64
- {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Debug|x64.Build.0 = Debug|x64
- {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Debug|x86.ActiveCfg = Debug|x86
- {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Debug|x86.Build.0 = Debug|x86
+ {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Debug|x64.Build.0 = Debug|Any CPU
+ {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Debug|x86.Build.0 = Debug|Any CPU
{556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|Any CPU.Build.0 = Release|Any CPU
- {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|x64.ActiveCfg = Release|x64
- {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|x64.Build.0 = Release|x64
- {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|x86.ActiveCfg = Release|x86
- {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|x86.Build.0 = Release|x86
+ {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|x64.ActiveCfg = Release|Any CPU
+ {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|x64.Build.0 = Release|Any CPU
+ {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|x86.ActiveCfg = Release|Any CPU
+ {556ABDCF-ED93-4327-BE98-F6815F78B9B8}.Release|x86.Build.0 = Release|Any CPU
{A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|x64.ActiveCfg = Debug|x64
- {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|x64.Build.0 = Debug|x64
- {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|x86.ActiveCfg = Debug|x86
- {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|x86.Build.0 = Debug|x86
+ {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|x64.Build.0 = Debug|Any CPU
+ {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|x86.Build.0 = Debug|Any CPU
{A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|Any CPU.Build.0 = Release|Any CPU
- {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|x64.ActiveCfg = Release|x64
- {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|x64.Build.0 = Release|x64
- {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|x86.ActiveCfg = Release|x86
- {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|x86.Build.0 = Release|x86
+ {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|x64.ActiveCfg = Release|Any CPU
+ {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|x64.Build.0 = Release|Any CPU
+ {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|x86.ActiveCfg = Release|Any CPU
+ {A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|x86.Build.0 = Release|Any CPU
{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -184,28 +189,52 @@ Global
{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|x86.Build.0 = Release|Any CPU
{EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|x64.ActiveCfg = Debug|x64
- {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|x64.Build.0 = Debug|x64
- {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|x86.ActiveCfg = Debug|x86
- {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|x86.Build.0 = Debug|x86
+ {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|x64.Build.0 = Debug|Any CPU
+ {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|x86.Build.0 = Debug|Any CPU
{EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Release|Any CPU.Build.0 = Release|Any CPU
- {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Release|x64.ActiveCfg = Release|x64
- {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Release|x64.Build.0 = Release|x64
- {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Release|x86.ActiveCfg = Release|x86
- {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Release|x86.Build.0 = Release|x86
+ {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Release|x64.ActiveCfg = Release|Any CPU
+ {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Release|x64.Build.0 = Release|Any CPU
+ {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Release|x86.ActiveCfg = Release|Any CPU
+ {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Release|x86.Build.0 = Release|Any CPU
{2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Debug|x64.ActiveCfg = Debug|x64
- {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Debug|x64.Build.0 = Debug|x64
- {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Debug|x86.ActiveCfg = Debug|x86
- {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Debug|x86.Build.0 = Debug|x86
+ {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Debug|x64.Build.0 = Debug|Any CPU
+ {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Debug|x86.Build.0 = Debug|Any CPU
{2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|Any CPU.Build.0 = Release|Any CPU
- {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|x64.ActiveCfg = Release|x64
- {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|x64.Build.0 = Release|x64
- {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|x86.ActiveCfg = Release|x86
- {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|x86.Build.0 = Release|x86
+ {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|x64.ActiveCfg = Release|Any CPU
+ {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|x64.Build.0 = Release|Any CPU
+ {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|x86.ActiveCfg = Release|Any CPU
+ {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|x86.Build.0 = Release|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Debug|x64.Build.0 = Debug|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Debug|x86.Build.0 = Debug|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Release|x64.ActiveCfg = Release|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Release|x64.Build.0 = Release|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Release|x86.ActiveCfg = Release|Any CPU
+ {E5BD4F96-28A8-410C-8B63-1C5731948549}.Release|x86.Build.0 = Release|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Debug|x64.Build.0 = Debug|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Debug|x86.Build.0 = Debug|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Release|Any CPU.Build.0 = Release|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Release|x64.ActiveCfg = Release|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Release|x64.Build.0 = Release|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Release|x86.ActiveCfg = Release|Any CPU
+ {329D7698-65BC-48AD-A16F-428682964493}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -223,5 +252,7 @@ Global
{96188137-5FA6-4924-AB6E-4EFF79C6E0BB} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
{EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
{2BF743D8-2A06-412D-96D7-F448F00C5EA5} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
+ {E5BD4F96-28A8-410C-8B63-1C5731948549} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
+ {329D7698-65BC-48AD-A16F-428682964493} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
EndGlobalSection
EndGlobal
diff --git a/README.md b/README.md
index 4d499fa35..9d5c9788a 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-# ImageSharp
+#
**ImageSharp** is a new cross-platform 2D graphics API designed to allow the processing of images without the use of `System.Drawing`.
@@ -45,7 +45,9 @@ Packages include:
Contains methods like Resize, Crop, Skew, Rotate - Anything that alters the dimensions of the image.
Contains methods like Gaussian Blur, Pixelate, Edge Detection - Anything that maintains the original image dimensions.
- **ImageSharp.Drawing**
- Brushes and various drawing algorithms.
+ Brushes and various drawing algorithms, including drawing Images
+ - **ImageSharp.Drawing.Paths**
+ Various vector drawing methods for drawing paths, polygons etc.
### Manual build
@@ -54,6 +56,11 @@ If you prefer, you can compile ImageSharp yourself (please do and help!), you'll
- [Visual Studio 2015 with Update 3 (or above)](https://www.visualstudio.com/news/releasenotes/vs2015-update3-vs)
- The [.NET Core 1.0 SDK Installer](https://www.microsoft.com/net/core#windows) - Non VSCode link.
+Alternatively on Linux you can use:
+
+- [Visual Studio Code](https://code.visualstudio.com/) with [C# Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp)
+- [.Net Core 1.1](https://www.microsoft.com/net/core#linuxubuntu)
+
To clone it locally click the "Clone in Windows" button above or run the following git commands.
```bash
@@ -72,11 +79,21 @@ Many `Image` methods are also fluent.
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
+using (Image image = new Image("foo.jpg"))
+{
+ image.Resize(image.Width / 2, image.Height / 2)
+ .Grayscale()
+ .Save("bar.jpg"); // automatic encoder selected based on extension.
+}
+```
+on netstandard 1.1 - 1.2
```csharp
using (FileStream stream = File.OpenRead("foo.jpg"))
using (FileStream output = File.OpenWrite("bar.jpg"))
+using (Image image = new Image(stream))
{
- Image image = new Image(stream);
image.Resize(image.Width / 2, image.Height / 2)
.Grayscale()
.Save(output);
@@ -92,7 +109,7 @@ new BrightnessProcessor(50).Apply(sourceImage, sourceImage.Bounds);
Setting individual pixel values is perfomed as follows:
```csharp
-Image image = new Image(400, 400);
+using (image = new Image(400, 400)
using (var pixels = image.Lock())
{
pixels[200, 200] = Color.White;
diff --git a/build/icons/imagesharp-logo-128.png b/build/icons/imagesharp-logo-128.png
index 81e29fee5..d9ae997ba 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:01f79400a4a77c764273a97fbc76982546e88510fa4cc64a7b2e83e265b0e141
-size 2490
+oid sha256:47f14bb7d24f7228cd8833d8d1881a72750b2c7813f391bd2a0dd0eeea936841
+size 6569
diff --git a/build/icons/imagesharp-logo-256.png b/build/icons/imagesharp-logo-256.png
index 5b78542cb..f1e67dd78 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:5598d4cb5bad33aefc1084c4f389b071143a59505f00f7b7831c81254f1140f8
-size 4225
+oid sha256:757ec2f45cc5f9c2083fc65a236100f1a7776eee16bd1095a550e05783106a9f
+size 13949
diff --git a/build/icons/imagesharp-logo-32.png b/build/icons/imagesharp-logo-32.png
index 31e32300d..80435989a 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:536e75abeaa2c35f34a95d34bee4f8bd13cf5514a979960566945da4ec8827d1
-size 979
+oid sha256:0f3a5375ce20321c2cfdc888a21dcb629d3e6a85641df5cca7c66e5b2a5f70f6
+size 1439
diff --git a/build/icons/imagesharp-logo-512.png b/build/icons/imagesharp-logo-512.png
index ee02fb650..a5f880e3a 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:c8288a69f4182b25e04ba6419b452c6cdbca0013856352c0aeb08abc67f67e4d
-size 7951
+oid sha256:0e4cd18406375999c2bee1c39ad439b37f9524485d6e247ab0f14d2eb90a65f3
+size 31256
diff --git a/build/icons/imagesharp-logo-64.png b/build/icons/imagesharp-logo-64.png
index 9919f97d6..f59e202bf 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:6ab6d98a7a55caf570016a62a2f4d72842e22cbe03460ad60a4dc196b7b1d303
-size 1698
+oid sha256:fa25e5dbe84f942107a1c29f4f68ff2a73f497412ae91b6e60fc5464bc9b5f05
+size 3132
diff --git a/build/icons/imagesharp-logo-heading.png b/build/icons/imagesharp-logo-heading.png
new file mode 100644
index 000000000..20779215f
--- /dev/null
+++ b/build/icons/imagesharp-logo-heading.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bf2335642c6fd291befa0b203dbfb3387d99434369399b35aeea037c0f9eba45
+size 10474
diff --git a/build/icons/imagesharp-logo.png b/build/icons/imagesharp-logo.png
index 0f80ceeaa..e0f1854cc 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:2f20a3b2613811efa3455ee65b532284d88636d8796ee2279c08a584aa01744e
-size 19129
+oid sha256:e4217fe820af06a593903441f0719cab1ca650fd4de795f0e6808c4240a89819
+size 59646
diff --git a/build/icons/imagesharp-logo.svg b/build/icons/imagesharp-logo.svg
index 9638e9785..2df3cc80c 100644
--- a/build/icons/imagesharp-logo.svg
+++ b/build/icons/imagesharp-logo.svg
@@ -1,59 +1 @@
-
+
\ No newline at end of file
diff --git a/dotnet-latest.ps1 b/dotnet-latest.ps1
index 32c53d7e1..2a77d2ec9 100644
--- a/dotnet-latest.ps1
+++ b/dotnet-latest.ps1
@@ -17,8 +17,8 @@ if (Get-Command "dotnet.exe" -ErrorAction SilentlyContinue) {
Write-Host "dotnet SDK already installed"
$version = dotnet --version 2>&1
- if($version -ne "1.0.0-rc3-004530"){
- Write-Host "$version installed but require 1.0.0-rc3-004530"
+ if($version -ne "1.0.1"){
+ Write-Host "$version installed but require 1.0.1"
$installRequired = $TRUE
}else{
Write-Host "$version already installed"
@@ -34,8 +34,8 @@ if($installRequired -eq $TRUE)
Write-Host $installScript
- Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-rc3/scripts/obtain/dotnet-install.ps1" `
+ Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.1/scripts/obtain/dotnet-install.ps1" `
-OutFile $installScript
& $installScript
-}
+}
\ No newline at end of file
diff --git a/features.md b/features.md
index 764d7c4a6..6bc5630ee 100644
--- a/features.md
+++ b/features.md
@@ -10,13 +10,23 @@ We've achieved a lot so far and hope to do a lot more in the future. We're alway
- [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
+ - [ ] Tiff (Help needed)
- **Metadata**
- [x] EXIF Read/Write (Jpeg just now)
-- **Quantizers (IQuantizer with alpha channel support + thresholding)**
+- **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] Color - 32bit color in RGBA order (IPackedPixel\).
- [x] Bgra32
@@ -133,5 +143,5 @@ We've achieved a lot so far and hope to do a lot more in the future. We're alway
- [x] DrawImage
- [ ] Gradient brush (Need help)
- **DrawingText**
- - [x] DrawString (Single variant support just now, no italic,bold)
+ - [ ] 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/src/ImageSharp.Drawing.Paths/DrawBeziers.cs b/src/ImageSharp.Drawing.Paths/DrawBeziers.cs
new file mode 100644
index 000000000..936d5a9ce
--- /dev/null
+++ b/src/ImageSharp.Drawing.Paths/DrawBeziers.cs
@@ -0,0 +1,112 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageSharp
+{
+ using System;
+ using System.Numerics;
+ using Drawing;
+ using Drawing.Brushes;
+ using Drawing.Pens;
+
+ using SixLabors.Shapes;
+
+ ///
+ /// Extension methods for the type.
+ ///
+ public static partial class ImageExtensions
+ {
+ ///
+ /// 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.
+ /// The brush.
+ /// The thickness.
+ /// The points.
+ /// The options.
+ /// The .
+ public static Image DrawBeziers(this Image source, IBrush brush, float thickness, Vector2[] points, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(new Pen(brush, thickness), new Path(new BezierLineSegment(points)), options);
+ }
+
+ ///
+ /// 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.
+ /// The brush.
+ /// The thickness.
+ /// The points.
+ /// The .
+ public static Image DrawBeziers(this Image source, IBrush brush, float thickness, Vector2[] points)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(new Pen(brush, thickness), new Path(new BezierLineSegment(points)));
+ }
+
+ ///
+ /// 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.
+ /// The color.
+ /// The thickness.
+ /// The points.
+ /// The .
+ public static Image DrawBeziers(this Image source, TColor color, float thickness, Vector2[] points)
+ where TColor : struct, IPixel
+ {
+ return source.DrawBeziers(new SolidBrush(color), thickness, points);
+ }
+
+ ///
+ /// 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.
+ /// The color.
+ /// The thickness.
+ /// The points.
+ /// The options.
+ /// The .
+ public static Image DrawBeziers(this Image source, TColor color, float thickness, Vector2[] points, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.DrawBeziers(new SolidBrush(color), thickness, points, options);
+ }
+
+ ///
+ /// Draws the provided Points as an open Bezier path with the supplied pen
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The pen.
+ /// The points.
+ /// The options.
+ /// The .
+ public static Image DrawBeziers(this Image source, IPen pen, Vector2[] points, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(pen, new Path(new BezierLineSegment(points)), options);
+ }
+
+ ///
+ /// Draws the provided Points as an open Bezier path with the supplied pen
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The pen.
+ /// The points.
+ /// The .
+ public static Image DrawBeziers(this Image source, IPen pen, Vector2[] points)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(pen, new Path(new BezierLineSegment(points)));
+ }
+ }
+}
diff --git a/src/ImageSharp.Drawing.Paths/DrawLines.cs b/src/ImageSharp.Drawing.Paths/DrawLines.cs
new file mode 100644
index 000000000..42f4406e8
--- /dev/null
+++ b/src/ImageSharp.Drawing.Paths/DrawLines.cs
@@ -0,0 +1,112 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageSharp
+{
+ using System;
+ using System.Numerics;
+ using Drawing;
+ using Drawing.Brushes;
+ using Drawing.Pens;
+
+ using SixLabors.Shapes;
+
+ ///
+ /// Extension methods for the type.
+ ///
+ public static partial class ImageExtensions
+ {
+ ///
+ /// Draws the provided Points as an open Linear path at the provided thickness with the supplied brush
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The brush.
+ /// The thickness.
+ /// The points.
+ /// The options.
+ /// The .
+ public static Image DrawLines(this Image source, IBrush brush, float thickness, Vector2[] points, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return 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
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The brush.
+ /// The thickness.
+ /// The points.
+ /// The .
+ public static Image DrawLines(this Image source, IBrush brush, float thickness, Vector2[] points)
+ where TColor : struct, IPixel
+ {
+ return 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
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The color.
+ /// The thickness.
+ /// The points.
+ /// The .
+ public static Image DrawLines(this Image source, TColor color, float thickness, Vector2[] points)
+ where TColor : struct, IPixel
+ {
+ return source.DrawLines(new SolidBrush(color), thickness, points);
+ }
+
+ ///
+ /// Draws the provided Points as an open Linear path at the provided thickness with the supplied brush
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The color.
+ /// The thickness.
+ /// The points.
+ /// The options.
+ /// The .>
+ public static Image DrawLines(this Image source, TColor color, float thickness, Vector2[] points, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.DrawLines(new SolidBrush(color), thickness, points, options);
+ }
+
+ ///
+ /// Draws the provided Points as an open Linear path with the supplied pen
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The pen.
+ /// The points.
+ /// The options.
+ /// The .
+ public static Image DrawLines(this Image source, IPen pen, Vector2[] points, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(pen, new Path(new LinearLineSegment(points)), options);
+ }
+
+ ///
+ /// Draws the provided Points as an open Linear path with the supplied pen
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The pen.
+ /// The points.
+ /// The .
+ public static Image DrawLines(this Image source, IPen pen, Vector2[] points)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(pen, new Path(new LinearLineSegment(points)));
+ }
+ }
+}
diff --git a/src/ImageSharp.Drawing.Paths/DrawPath.cs b/src/ImageSharp.Drawing.Paths/DrawPath.cs
new file mode 100644
index 000000000..e2c1442de
--- /dev/null
+++ b/src/ImageSharp.Drawing.Paths/DrawPath.cs
@@ -0,0 +1,112 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageSharp
+{
+ using System;
+
+ using Drawing;
+ using Drawing.Brushes;
+ using Drawing.Pens;
+
+ using SixLabors.Shapes;
+
+ ///
+ /// Extension methods for the type.
+ ///
+ public static partial class ImageExtensions
+ {
+ ///
+ /// Draws the outline of the polygon with the provided pen.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The pen.
+ /// The path.
+ /// The options.
+ /// The .
+ public static Image Draw(this Image source, IPen pen, IPath path, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(pen, new ShapePath(path), options);
+ }
+
+ ///
+ /// Draws the outline of the polygon with the provided pen.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The pen.
+ /// The path.
+ /// The .
+ public static Image Draw(this Image source, IPen pen, IPath path)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(pen, path, GraphicsOptions.Default);
+ }
+
+ ///
+ /// Draws the outline of the polygon with the provided brush at the provided thickness.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The brush.
+ /// The thickness.
+ /// The shape.
+ /// The options.
+ /// The .
+ public static Image Draw(this Image source, IBrush brush, float thickness, IPath path, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(new Pen(brush, thickness), path, options);
+ }
+
+ ///
+ /// Draws the outline of the polygon with the provided brush at the provided thickness.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The brush.
+ /// The thickness.
+ /// The path.
+ /// The .
+ public static Image Draw(this Image source, IBrush brush, float thickness, IPath path)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(new Pen(brush, thickness), path);
+ }
+
+ ///
+ /// Draws the outline of the polygon with the provided brush at the provided thickness.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The color.
+ /// The thickness.
+ /// The path.
+ /// The options.
+ /// The .
+ public static Image Draw(this Image source, TColor color, float thickness, IPath path, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(new SolidBrush(color), thickness, path, options);
+ }
+
+ ///
+ /// Draws the outline of the polygon with the provided brush at the provided thickness.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The color.
+ /// The thickness.
+ /// The path.
+ /// The .
+ public static Image Draw(this Image source, TColor color, float thickness, IPath path)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(new SolidBrush(color), thickness, path);
+ }
+ }
+}
diff --git a/src/ImageSharp.Drawing.Paths/DrawPolygon.cs b/src/ImageSharp.Drawing.Paths/DrawPolygon.cs
new file mode 100644
index 000000000..8043d18e5
--- /dev/null
+++ b/src/ImageSharp.Drawing.Paths/DrawPolygon.cs
@@ -0,0 +1,112 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageSharp
+{
+ using System;
+ using System.Numerics;
+ using Drawing;
+ using Drawing.Brushes;
+ using Drawing.Pens;
+
+ using SixLabors.Shapes;
+
+ ///
+ /// Extension methods for the type.
+ ///
+ public static partial class ImageExtensions
+ {
+ ///
+ /// Draws the provided Points as a closed Linear Polygon with the provided brush at the provided thickness.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The brush.
+ /// The thickness.
+ /// The points.
+ /// The options.
+ /// The .
+ public static Image DrawPolygon(this Image source, IBrush brush, float thickness, Vector2[] points, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(new Pen(brush, thickness), new Polygon(new LinearLineSegment(points)), options);
+ }
+
+ ///
+ /// Draws the provided Points as a closed Linear Polygon with the provided brush at the provided thickness.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The brush.
+ /// The thickness.
+ /// The points.
+ /// The .
+ public static Image DrawPolygon(this Image source, IBrush brush, float thickness, Vector2[] points)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(new Pen(brush, thickness), new Polygon(new LinearLineSegment(points)));
+ }
+
+ ///
+ /// Draws the provided Points as a closed Linear Polygon with the provided brush at the provided thickness.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The color.
+ /// The thickness.
+ /// The points.
+ /// The .
+ public static Image DrawPolygon(this Image source, TColor color, float thickness, Vector2[] points)
+ where TColor : struct, IPixel
+ {
+ return source.DrawPolygon(new SolidBrush(color), thickness, points);
+ }
+
+ ///
+ /// Draws the provided Points as a closed Linear Polygon with the provided brush at the provided thickness.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The color.
+ /// The thickness.
+ /// The points.
+ /// The options.
+ /// The .
+ public static Image DrawPolygon(this Image source, TColor color, float thickness, Vector2[] points, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.DrawPolygon(new SolidBrush(color), thickness, points, options);
+ }
+
+ ///
+ /// Draws the provided Points as a closed Linear Polygon with the provided Pen.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The pen.
+ /// The points.
+ /// The .
+ public static Image DrawPolygon(this Image source, IPen pen, Vector2[] points)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(pen, new Polygon(new LinearLineSegment(points)), GraphicsOptions.Default);
+ }
+
+ ///
+ /// Draws the provided Points as a closed Linear Polygon with the provided Pen.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The pen.
+ /// The points.
+ /// The options.
+ /// The .
+ public static Image DrawPolygon(this Image source, IPen pen, Vector2[] points, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Draw(pen, new Polygon(new LinearLineSegment(points)), options);
+ }
+ }
+}
diff --git a/src/ImageSharp.Drawing/DrawRectangle.cs b/src/ImageSharp.Drawing.Paths/DrawRectangle.cs
similarity index 53%
rename from src/ImageSharp.Drawing/DrawRectangle.cs
rename to src/ImageSharp.Drawing.Paths/DrawRectangle.cs
index 38ed578b6..b35665240 100644
--- a/src/ImageSharp.Drawing/DrawRectangle.cs
+++ b/src/ImageSharp.Drawing.Paths/DrawRectangle.cs
@@ -9,10 +9,7 @@ namespace ImageSharp
using Drawing;
using Drawing.Brushes;
- using Drawing.Paths;
using Drawing.Pens;
- using Drawing.Processors;
- using Drawing.Shapes;
///
/// Extension methods for the type.
@@ -23,97 +20,91 @@ namespace ImageSharp
/// Draws the outline of the polygon with the provided pen.
///
/// The type of the color.
- /// The source.
+ /// The image this method extends.
/// The pen.
/// The shape.
/// The options.
- ///
- /// The Image
- ///
- public static Image DrawPolygon(this Image source, IPen pen, RectangleF shape, GraphicsOptions options)
- where TColor : struct, IPackedPixel, IEquatable
+ /// The .
+ public static Image Draw(this Image source, IPen pen, Rectangle shape, GraphicsOptions options)
+ where TColor : struct, IPixel
{
- return source.Apply(new DrawPathProcessor(pen, (IPath)new RectangularPolygon(shape), options));
+ return source.Draw(pen, new SixLabors.Shapes.Rectangle(shape.X, shape.Y, shape.Width, shape.Height), options);
}
///
/// Draws the outline of the polygon with the provided pen.
///
/// The type of the color.
- /// The source.
+ /// The image this method extends.
/// The pen.
/// The shape.
- /// The Image
- public static Image DrawPolygon(this Image source, IPen pen, RectangleF shape)
- where TColor : struct, IPackedPixel, IEquatable
+ /// The .
+ public static Image Draw(this Image source, IPen pen, Rectangle shape)
+ where TColor : struct, IPixel
{
- return source.DrawPolygon(pen, shape, GraphicsOptions.Default);
+ return source.Draw(pen, shape, GraphicsOptions.Default);
}
///
/// Draws the outline of the polygon with the provided brush at the provided thickness.
///
/// The type of the color.
- /// The source.
+ /// The image this method extends.
/// The brush.
/// The thickness.
/// The shape.
/// The options.
- ///
- /// The Image
- ///
- public static Image DrawPolygon(this Image source, IBrush brush, float thickness, RectangleF shape, GraphicsOptions options)
- where TColor : struct, IPackedPixel, IEquatable
+ /// The .
+ public static Image Draw(this Image source, IBrush brush, float thickness, Rectangle shape, GraphicsOptions options)
+ where TColor : struct, IPixel
{
- return source.DrawPolygon(new Pen(brush, thickness), shape, options);
+ return source.Draw(new Pen(brush, thickness), shape, options);
}
///
/// Draws the outline of the polygon with the provided brush at the provided thickness.
///
/// The type of the color.
- /// The source.
+ /// The image this method extends.
/// The brush.
/// The thickness.
/// The shape.
- /// The Image
- public static Image DrawPolygon(this Image source, IBrush brush, float thickness, RectangleF shape)
- where TColor : struct, IPackedPixel, IEquatable
+ /// The .
+ public static Image Draw(this Image source, IBrush brush, float thickness, Rectangle shape)
+ where TColor : struct, IPixel
{
- return source.DrawPolygon(new Pen(brush, thickness), shape);
+ return source.Draw(new Pen(brush, thickness), shape);
}
///
/// Draws the outline of the polygon with the provided brush at the provided thickness.
///
/// The type of the color.
- /// The source.
+ /// The image this method extends.
/// The color.
/// The thickness.
/// The shape.
/// The options.
- ///
- /// The Image
- ///
- public static Image DrawPolygon(this Image source, TColor color, float thickness, RectangleF shape, GraphicsOptions options)
- where TColor : struct, IPackedPixel, IEquatable
+ /// The .
+ public static Image Draw(this Image source, TColor color, float thickness, Rectangle shape, GraphicsOptions options)
+ where TColor : struct, IPixel
{
- return source.DrawPolygon(new SolidBrush(color), thickness, shape, options);
+ return source.Draw(new SolidBrush(color), thickness, shape, options);
}
///
/// Draws the outline of the polygon with the provided brush at the provided thickness.
///
/// The type of the color.
- /// The source.
+ /// The image this method extends.
/// The color.
/// The thickness.
/// The shape.
- /// The Image
- public static Image DrawPolygon(this Image source, TColor color, float thickness, RectangleF shape)
- where TColor : struct, IPackedPixel, IEquatable
+ /// The .
+ public static Image Draw(this Image source, TColor color, float thickness, Rectangle shape)
+ where TColor : struct, IPixel
{
- return source.DrawPolygon(new SolidBrush(color), thickness, shape);
+ return source.Draw(new SolidBrush(color), thickness, shape);
}
}
}
diff --git a/src/ImageSharp.Drawing.Paths/FillPaths.cs b/src/ImageSharp.Drawing.Paths/FillPaths.cs
new file mode 100644
index 000000000..92e227ce1
--- /dev/null
+++ b/src/ImageSharp.Drawing.Paths/FillPaths.cs
@@ -0,0 +1,78 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageSharp
+{
+ using System;
+
+ using Drawing;
+ using Drawing.Brushes;
+
+ using SixLabors.Shapes;
+
+ ///
+ /// Extension methods for the type.
+ ///
+ public static partial class ImageExtensions
+ {
+ ///
+ /// Flood fills the image in the shape of the provided polygon with the specified brush..
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The brush.
+ /// The shape.
+ /// The graphics options.
+ /// The .
+ public static Image Fill(this Image source, IBrush brush, IPath path, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Fill(brush, new ShapeRegion(path), options);
+ }
+
+ ///
+ /// Flood fills the image in the shape of the provided polygon with the specified brush.
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The brush.
+ /// The path.
+ /// The .
+ public static Image Fill(this Image source, IBrush brush, IPath path)
+ where TColor : struct, IPixel
+ {
+ return source.Fill(brush, new ShapeRegion(path), GraphicsOptions.Default);
+ }
+
+ ///
+ /// Flood fills the image in the shape of the provided polygon with the specified brush..
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The color.
+ /// The path.
+ /// The options.
+ /// The .
+ public static Image Fill(this Image source, TColor color, IPath path, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Fill(new SolidBrush(color), path, options);
+ }
+
+ ///
+ /// Flood fills the image in the shape of the provided polygon with the specified brush..
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The color.
+ /// The path.
+ /// The .
+ public static Image Fill(this Image source, TColor color, IPath path)
+ where TColor : struct, IPixel
+ {
+ return source.Fill(new SolidBrush(color), path);
+ }
+ }
+}
diff --git a/src/ImageSharp.Drawing.Paths/FillPolygon.cs b/src/ImageSharp.Drawing.Paths/FillPolygon.cs
new file mode 100644
index 000000000..cd3d15466
--- /dev/null
+++ b/src/ImageSharp.Drawing.Paths/FillPolygon.cs
@@ -0,0 +1,78 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageSharp
+{
+ using System;
+ using System.Numerics;
+ using Drawing;
+ using Drawing.Brushes;
+
+ using SixLabors.Shapes;
+
+ ///
+ /// Extension methods for the type.
+ ///
+ public static partial class ImageExtensions
+ {
+ ///
+ /// Flood fills the image in the shape of a Linear polygon described by the points
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The brush.
+ /// The points.
+ /// The options.
+ /// The .
+ public static Image FillPolygon(this Image source, IBrush brush, Vector2[] points, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Fill(brush, new Polygon(new LinearLineSegment(points)), options);
+ }
+
+ ///
+ /// Flood fills the image in the shape of a Linear polygon described by the points
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The brush.
+ /// The points.
+ /// The .
+ public static Image FillPolygon(this Image source, IBrush brush, Vector2[] points)
+ where TColor : struct, IPixel
+ {
+ return source.Fill(brush, new Polygon(new LinearLineSegment(points)));
+ }
+
+ ///
+ /// Flood fills the image in the shape of a Linear polygon described by the points
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The color.
+ /// The points.
+ /// The options.
+ /// The .
+ public static Image FillPolygon(this Image source, TColor color, Vector2[] points, GraphicsOptions options)
+ where TColor : struct, IPixel
+ {
+ return source.Fill(new SolidBrush(color), new Polygon(new LinearLineSegment(points)), options);
+ }
+
+ ///
+ /// Flood fills the image in the shape of a Linear polygon described by the points
+ ///
+ /// The type of the color.
+ /// The image this method extends.
+ /// The color.
+ /// The points.
+ /// The .
+ public static Image FillPolygon(this Image source, TColor color, Vector2[] points)
+ where TColor : struct, IPixel
+ {
+ return source.Fill(new SolidBrush(color), new Polygon(new LinearLineSegment(points)));
+ }
+ }
+}
diff --git a/src/ImageSharp.Drawing/FillRectangle.cs b/src/ImageSharp.Drawing.Paths/FillRectangle.cs
similarity index 65%
rename from src/ImageSharp.Drawing/FillRectangle.cs
rename to src/ImageSharp.Drawing.Paths/FillRectangle.cs
index d29b58e1b..1928e54d3 100644
--- a/src/ImageSharp.Drawing/FillRectangle.cs
+++ b/src/ImageSharp.Drawing.Paths/FillRectangle.cs
@@ -9,8 +9,6 @@ namespace ImageSharp
using Drawing;
using Drawing.Brushes;
- using Drawing.Processors;
- using Drawing.Shapes;
///
/// Extension methods for the type.
@@ -21,46 +19,42 @@ namespace ImageSharp
/// Flood fills the image in the shape of the provided polygon with the specified brush..
///
/// The type of the color.
- /// The source.
+ /// The image this method extends.
/// The brush.
/// The shape.
/// The options.
- ///
- /// The Image
- ///
- public static Image Fill(this Image source, IBrush brush, RectangleF shape, GraphicsOptions options)
- where TColor : struct, IPackedPixel, IEquatable
+ /// The .
+ public static Image Fill(this Image source, IBrush brush, Rectangle shape, GraphicsOptions options)
+ where TColor : struct, IPixel
{
- return source.Apply(new FillShapeProcessor(brush, new RectangularPolygon(shape), options));
+ return source.Fill(brush, new SixLabors.Shapes.Rectangle(shape.X, shape.Y, shape.Width, shape.Height), options);
}
///
/// Flood fills the image in the shape of the provided polygon with the specified brush..
///
/// The type of the color.
- /// The source.
+ /// The image this method extends.
/// The brush.
/// The shape.
- /// The Image
- public static Image Fill(this Image source, IBrush brush, RectangleF shape)
- where TColor : struct, IPackedPixel, IEquatable
+ /// The .
+ public static Image Fill(this Image source, IBrush brush, Rectangle shape)
+ where TColor : struct, IPixel