diff --git a/.gitignore b/.gitignore
index 8034c8c89..c2e6f7d53 100644
--- a/.gitignore
+++ b/.gitignore
@@ -158,7 +158,6 @@ AppPackages/
# Others
*.[Cc]ache
ClientBin/
-[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
@@ -202,7 +201,8 @@ FakesAssemblies/
**/node_modules
**/node_modules/*
-**/TestOutput
+**/Images/ActualOutput
+**/Images/ReferenceOutput
# ASP.NET 5
project.lock.json
@@ -218,3 +218,4 @@ artifacts/
**/CodeCoverage/*
docs/
/samples/AvatarWithRoundedCorner/output
+/ImageSharp.Coverage.xml
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..e7972649f
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,4 @@
+[submodule "tests/Images/External"]
+ path = tests/Images/External
+ url = https://github.com/SixLabors/Imagesharp.Tests.Images.git
+ branch = master
diff --git a/.travis.yml b/.travis.yml
index 4ae163530..a4f68b1d1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,6 +19,7 @@ branches:
- coverity_scan
script:
+ - git submodule -q update --init
- dotnet restore
- dotnet test tests/ImageSharp.Tests/ImageSharp.Tests.csproj -c Release -f "netcoreapp1.1"
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 000000000..c9c7453f6
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,28 @@
+{
+ // Use IntelliSense to find out which attributes exist for C# debugging
+ // Use hover for the description of the existing attributes
+ // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": ".NET Core Launch (console)",
+ "type": "coreclr",
+ "request": "launch",
+ "preLaunchTask": "build",
+ // If you have changed target frameworks, make sure to update the program path.
+ "program": "${workspaceRoot}/samples/AvatarWithRoundedCorner/bin/Debug/netcoreapp1.1/AvatarWithRoundedCorner.dll",
+ "args": [],
+ "cwd": "${workspaceRoot}/samples/AvatarWithRoundedCorner",
+ // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
+ "console": "internalConsole",
+ "stopAtEntry": false,
+ "internalConsoleOptions": "openOnSessionStart"
+ },
+ {
+ "name": ".NET Core Attach",
+ "type": "coreclr",
+ "request": "attach",
+ "processId": "${command:pickProcess}"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/ImageSharp.ruleset b/ImageSharp.ruleset
index 0bd9cd11a..2149364b1 100644
--- a/ImageSharp.ruleset
+++ b/ImageSharp.ruleset
@@ -2,10 +2,10 @@
-
-
-
+
\ No newline at end of file
diff --git a/ImageSharp.sln b/ImageSharp.sln
index a004f1371..4ea89dd45 100644
--- a/ImageSharp.sln
+++ b/ImageSharp.sln
@@ -1,6 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
+VisualStudioVersion = 15.0.26730.3
VisualStudioVersion = 15.0.26730.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}"
@@ -32,28 +33,28 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{9E574A07-F879-4811-9C41-5CBDC6BAFDB7}"
ProjectSection(SolutionItems) = preProject
src\Shared\AssemblyInfo.Common.cs = src\Shared\AssemblyInfo.Common.cs
- src\Shared\stylecop.json = src\Shared\stylecop.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp", "src\ImageSharp\ImageSharp.csproj", "{2AA31A1F-142C-43F4-8687-09ABCA4B3A26}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Drawing", "src\ImageSharp.Drawing\ImageSharp.Drawing.csproj", "{2E33181E-6E28-4662-A801-E2E7DC206029}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "build", "build\build.csproj", "{575A5002-DD9F-4335-AA47-1DD87FA13645}"
-EndProject
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.Sandbox46", "tests\ImageSharp.Sandbox46\ImageSharp.Sandbox46.csproj", "{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{7CC6D57E-B916-43B8-B315-A0BB92F260A2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvatarWithRoundedCorner", "samples\AvatarWithRoundedCorner\AvatarWithRoundedCorner.csproj", "{844FC582-4E78-4371-847D-EFD4D1103578}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChangeDefaultEncoderOptions", "samples\ChangeDefaultEncoderOptions\ChangeDefaultEncoderOptions.csproj", "{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChangeDefaultEncoderOptions", "samples\ChangeDefaultEncoderOptions\ChangeDefaultEncoderOptions.csproj", "{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Sandbox46", "tests\ImageSharp.Sandbox46\ImageSharp.Sandbox46.csproj", "{561B880A-D9EE-44EF-90F5-817C54A9D9AB}"
EndProject
Global
+ GlobalSection(Performance) = preSolution
+ HasPerformanceSessions = true
+ EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
@@ -87,18 +88,6 @@ Global
{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|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|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
{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|Any CPU
@@ -123,18 +112,6 @@ Global
{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
- {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
- {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|x64.Build.0 = Debug|Any CPU
- {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|x86.ActiveCfg = Debug|Any CPU
- {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|x86.Build.0 = Debug|Any CPU
- {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|Any CPU.Build.0 = Release|Any CPU
- {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|x64.ActiveCfg = Release|Any CPU
- {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|x64.Build.0 = Release|Any CPU
- {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|x86.ActiveCfg = Release|Any CPU
- {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|x86.Build.0 = Release|Any CPU
{844FC582-4E78-4371-847D-EFD4D1103578}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{844FC582-4E78-4371-847D-EFD4D1103578}.Debug|Any CPU.Build.0 = Debug|Any CPU
{844FC582-4E78-4371-847D-EFD4D1103578}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -159,6 +136,18 @@ Global
{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}.Release|x64.Build.0 = Release|Any CPU
{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}.Release|x86.ActiveCfg = Release|Any CPU
{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}.Release|x86.Build.0 = Release|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x64.Build.0 = Debug|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x86.Build.0 = Debug|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x64.ActiveCfg = Release|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x64.Build.0 = Release|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x86.ActiveCfg = Release|Any CPU
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -167,11 +156,13 @@ Global
{9E574A07-F879-4811-9C41-5CBDC6BAFDB7} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
{2E33181E-6E28-4662-A801-E2E7DC206029} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
- {575A5002-DD9F-4335-AA47-1DD87FA13645} = {E919DF0B-2607-4462-8FC0-5C98FE50F8C9}
{EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
{2BF743D8-2A06-412D-96D7-F448F00C5EA5} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
- {96188137-5FA6-4924-AB6E-4EFF79C6E0BB} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
{844FC582-4E78-4371-847D-EFD4D1103578} = {7CC6D57E-B916-43B8-B315-A0BB92F260A2}
{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0} = {7CC6D57E-B916-43B8-B315-A0BB92F260A2}
+ {561B880A-D9EE-44EF-90F5-817C54A9D9AB} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {5F8B9D1F-CD8B-4CC5-8216-D531E25BD795}
EndGlobalSection
EndGlobal
diff --git a/ImageSharp.sln.DotSettings b/ImageSharp.sln.DotSettings
index b058fad4e..1839bf2f8 100644
--- a/ImageSharp.sln.DotSettings
+++ b/ImageSharp.sln.DotSettings
@@ -342,6 +342,7 @@
True
AC
DC
+ DCT
EOF
FDCT
IDCT
diff --git a/README.md b/README.md
index 7113d6ba1..31ca5cef3 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Built against .Net Standard 1.1 ImageSharp can be used in device, cloud, and emb
> **ImageSharp** has made excellent progress and contains many great features but is still considered by us to be still in early stages (alpha). As such, we cannot support its use on production environments until the library reaches release candidate status.
>
-> Pre-release downloads are available from the [MyGet package repository](https://www.myget.org/gallery/imagesharp).
+> Pre-release downloads are available from the [MyGet package repository](https://www.myget.org/gallery/sixlabors).
[](https://raw.githubusercontent.com/SixLabors/ImageSharp/master/APACHE-2.0-LICENSE.txt)
[](https://github.com/SixLabors/ImageSharp/issues)
@@ -31,20 +31,20 @@ At present the code is pre-release but when ready it will be available on [Nuget
**Pre-release downloads**
-We already have a [MyGet package repository](https://www.myget.org/gallery/imagesharp) - for bleeding-edge / development NuGet releases.
+We already have a [MyGet package repository](https://www.myget.org/gallery/sixlabors) - for bleeding-edge / development NuGet releases.
### Packages
The **ImageSharp** library is made up of multiple packages.
Packages include:
-- **ImageSharp**
+- **SixLabors.ImageSharp**
- Contains the generic `Image` class, PixelFormats, Primitives, Configuration, and other core functionality.
- The `IImageFormat` interface, Jpeg, Png, Bmp, and Gif formats.
- Transform methods like Resize, Crop, Skew, Rotate - Anything that alters the dimensions of the image.
- Non-transform methods like Gaussian Blur, Pixelate, Edge Detection - Anything that maintains the original image dimensions.
-- **ImageSharp.Drawing**
+- **SixLabors.ImageSharp.Drawing**
- Brushes and various drawing algorithms, including drawing images.
- Various vector drawing methods for drawing paths, polygons etc.
- Text drawing.
@@ -88,9 +88,10 @@ On platforms supporting netstandard 1.3+
// 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.Resize(image.Width / 2, image.Height / 2)
- .Grayscale()
- .Save("bar.jpg"); // automatic encoder selected based on extension.
+ image.Mutate(x => x
+ .Resize(image.Width / 2, image.Height / 2)
+ .Grayscale());
+ image.Save("bar.jpg"); // automatic encoder selected based on extension.
}
```
on netstandard 1.1 - 1.2
@@ -100,9 +101,10 @@ using (FileStream stream = File.OpenRead("foo.jpg"))
using (FileStream output = File.OpenWrite("bar.jpg"))
using (Image image = Image.Load(stream))
{
- image.Resize(image.Width / 2, image.Height / 2)
- .Grayscale()
- .Save(output);
+ image.Mutate(x => x
+ .Resize(image.Width / 2, image.Height / 2)
+ .Grayscale());
+ image.Save(output);
}
```
@@ -116,7 +118,7 @@ using (Image image = new Image(400, 400))
}
```
-For optimized access within a loop it is recommended that the following methods are used.
+For optimized synchronous access within a loop it is recommended that the following methods are used.
1. `image.GetRowSpan(y)`
2. `image.GetRowSpan(x, y)`
@@ -140,9 +142,7 @@ Grand High Eternal Dictator
Core Team
- [Dirk Lemstra](https://github.com/dlemstra)
-- [Jeavon Leopold](https://github.com/jeavon)
- [Anton Firsov](https://github.com/antonfirsov)
-- [Olivia Ifrim](https://github.com/olivif)
- [Scott Williams](https://github.com/tocsoft)
### Backers
diff --git a/appveyor.yml b/appveyor.yml
index fdbe46b01..5c548a71c 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -4,8 +4,13 @@ image: Visual Studio 2017
# prevent the double build when a branch has an active PR
skip_branch_with_pr: true
-init:
- - ps: iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/PureKrome/0f79e25693d574807939/raw/8cf3160c9516ef1f4effc825c0a44acc918a0b5a/appveyor-build-info.ps'))
+install:
+ - choco install gitversion.portable -pre -y
+
+before_build:
+ - git submodule -q update --init
+ - cmd: dotnet --version
+ - ps: c:\ProgramData\chocolatey\lib\gitversion.portable\tools\gitversion.exe /l console /output buildserver
build_script:
- cmd: build.cmd
@@ -13,16 +18,17 @@ build_script:
test_script:
- tests\CodeCoverage\CodeCoverage.cmd
-artifacts:
-- path: artifacts\bin\ImageSharp\**\*.nupkg
+after_test:
+ - cmd: appveyor PushArtifact "artifacts\SixLabors.ImageSharp.%GitVersion_NuGetVersion%.nupkg"
+ - cmd: appveyor PushArtifact "artifacts\SixLabors.ImageSharp.Drawing.%GitVersion_NuGetVersion%.nupkg"
deploy:
# MyGet Deployment for builds & releases
- - provider: NuGet
- server: https://www.myget.org/F/imagesharp/api/v2/package
- symbol_server: https://www.myget.org/F/imagesharp/symbols/api/v2/package
- api_key:
- secure: P2Fz82nty+itjL+kNRCsMQcqzngmVtkU0R4CZqgST7zgUaE6/1q9ekh5MKKlZLkD
- artifact: /.*\.nupkg/
- on:
- branch: master
+ - provider: NuGet
+ server: https://www.myget.org/F/sixlabors/api/v2/package
+ symbol_server: https://www.myget.org/F/sixlabors/symbols/api/v2/package
+ api_key:
+ secure: V/lEHP0UeMWIpWd0fiNlY2IgbCnJKQlGdRksECdJbOBdaE20Fl0RNL7WyqHe02o4
+ artifact: /.*\.nupkg/
+ on:
+ branch: master
diff --git a/build.cmd b/build.cmd
index e33a230bc..1ba1b3742 100644
--- a/build.cmd
+++ b/build.cmd
@@ -1,2 +1,39 @@
@echo Off
-call build\build.cmd
\ No newline at end of file
+
+SET versionCommand=
+if not "%GitVersion_NuGetVersion%" == "" (
+ SET versionCommand=/p:packageversion=%GitVersion_NuGetVersion%
+ @echo building with version set to '%GitVersion_NuGetVersion%'
+)
+
+dotnet restore %versionCommand%
+
+ECHO Building projects
+dotnet build -c Release %versionCommand%
+
+if not "%errorlevel%"=="0" goto failure
+
+if not "%CI%" == "True" (
+ ECHO NOT on CI server running tests
+ dotnet test ./tests/ImageSharp.Tests/ImageSharp.Tests.csproj --no-build -c Release
+)
+if not "%errorlevel%"=="0" goto failure
+
+ECHO Packaging projects
+dotnet pack ./src/ImageSharp/ -c Release --output ../../artifacts --no-build %versionCommand%
+if not "%errorlevel%"=="0" goto failure
+
+dotnet pack ./src/ImageSharp.Drawing/ -c Release --output ../../artifacts --no-build %versionCommand%
+if not "%errorlevel%"=="0" goto failure
+
+:success
+ECHO successfully built project
+REM exit 0
+goto end
+
+:failure
+ECHO failed to build.
+REM exit -1
+goto end
+
+:end
\ No newline at end of file
diff --git a/build/Program.cs b/build/Program.cs
deleted file mode 100644
index 4e59b2214..000000000
--- a/build/Program.cs
+++ /dev/null
@@ -1,463 +0,0 @@
-//
-// Copyright (c) James Jackson-South and contributors.
-// Licensed under the Apache License, Version 2.0.
-//
-
-namespace ConsoleApplication
-{
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Xml;
- using LibGit2Sharp;
- using Microsoft.Build.Construction;
- using Microsoft.Build.Evaluation;
- using NuGet.Versioning;
-
- ///
- /// This updates the version numbers for all the projects in the src folder.
- /// The version number it will geneate is dependent on if this is a build from master or a branch/PR
- ///
- /// If its a build on master
- /// We take the version number specified in project.json,
- /// count how meny commits the repo has had that will affect this project or its dependencies since the version number of manually changed
- /// If this is the first commit that effected this project since number change then leave the version number as defined i.e. will build 1.0.0 if thats in project.json
- /// unless it is a preview build number in which case we always add the counter
- ///
- /// If the build is from a PR/branch
- /// We take the version number specified in project.json, append a tag for the branch/PR (so we can determin how each package was built)
- /// append number of commits effecting the project.
- ///
- ///
- ///
- /// for PR#123 and project.json version 2.0.1 and we have had 30 commits affecting the project
- /// we would end up with version number 2.0.1-PR124-00030
- ///
- /// for branch `fix-stuff` project.json version 2.0.1-alpha1 and we have had 832 commits affecting the project
- /// we would end up with version number 2.0.1-alpha1-fix-stuff-00832
- ///
- /// for `master` project.json version 2.0.1-alpha1 and we have had 832 commits affecting the project
- /// we would end up with version number 2.0.1-alpha1-00832
- ///
- /// for `master` project.json version 2.0.1 and we have had 132 commits affecting the project
- /// we would end up with version number 2.0.1-CI-00132
- ///
- /// for `master` project.json version 2.0.1 and we have had 1 commits affecting the project
- /// we would end up with version number 2.0.1
- ///
- /// for `master` project.json version 2.0.1-alpha1 and we have had 1 commits affecting the project
- /// we would end up with version number 2.0.1-alpha1
- ///
- ///
- /// TODO Add the option for using this to update the version numbers in a project and its dependent references.
- ///
- public class Program
- {
- private const string FallbackTag = "CI";
-
- ///
- /// Main entry point.
- ///
- /// The arguments.
- public static void Main(string[] args)
- {
- bool resetmode = args.Contains("reset");
-
- // Find the project root
- string root = Path.GetFullPath(Path.Combine(LibGit2Sharp.Repository.Discover("."), ".."));
-
- // Lets find the repo
- Repository repo = new LibGit2Sharp.Repository(root);
-
- // Lets find all the project.json files in the src folder (don't care about versioning `tests`)
- IEnumerable projectFiles = Directory.EnumerateFiles(Path.Combine(root, "src"), "*.csproj", SearchOption.AllDirectories);
-
- ResetProject(projectFiles);
-
- // Open them and convert them to source projects
- List projects = projectFiles.Select(x => ProjectRootElement.Open(x, ProjectCollection.GlobalProjectCollection, true))
- .Select(x => new SourceProject(x, repo.Info.WorkingDirectory))
- .ToList();
-
- if (!resetmode)
- {
- CaclulateProjectVersionNumber(projects, repo);
-
- UpdateVersionNumbers(projects);
-
- CreateBuildScript(projects, root);
-
- foreach (SourceProject p in projects)
- {
- Console.WriteLine($"{p.Name} {p.FinalVersionNumber}");
- }
- }
- }
-
- private static void CreateBuildScript(IEnumerable projects, string root)
- {
- string outputDir = Path.GetFullPath(Path.Combine(root, @"artifacts\bin\ImageSharp"));
-
- StringBuilder sb = new StringBuilder();
- foreach (SourceProject p in projects)
- {
- sb.AppendLine($@"dotnet pack --configuration Release --output ""{outputDir}"" ""{p.ProjectFilePath}""");
- }
-
- File.WriteAllText("build-inner.cmd", sb.ToString());
- }
-
- private static void UpdateVersionNumbers(IEnumerable projects)
- {
- foreach (SourceProject p in projects)
- {
- // create a backup file so we can rollback later without breaking formatting
- File.Copy(p.FullProjectFilePath, $"{p.FullProjectFilePath}.bak", true);
- }
-
- foreach (SourceProject p in projects)
- {
- // TODO force update of all dependent projects to point to the newest build.
- // we skip the build number and standard CI prefix on first commits
- string newVersion = p.FinalVersionNumber;
-
- p.UpdateVersion(newVersion);
- }
- }
-
- private static string CurrentBranch(Repository repo)
- {
- // lets build version friendly commit
- string branch = repo.Head.FriendlyName;
-
- // lets see if we are running in appveyor and if we are use the environment variables instead of the head
- string appveryorBranch = Environment.GetEnvironmentVariable("APPVEYOR_REPO_BRANCH");
- if (!string.IsNullOrWhiteSpace(appveryorBranch))
- {
- branch = appveryorBranch;
- }
-
- string prNumber = Environment.GetEnvironmentVariable("APPVEYOR_PULL_REQUEST_NUMBER");
- if (!string.IsNullOrWhiteSpace(prNumber))
- {
- branch = $"PR{int.Parse(prNumber):000}";
- }
-
- // this will happen when checking out a comit directly and not a branch (like appveryor does when it builds)
- if (branch == "(no branch)")
- {
- throw new Exception("unable to find branch");
- }
-
- // clean branch names (might need to be improved)
- branch = branch.Replace("/", "-").Replace("--", "-");
-
- return branch;
- }
-
- private static void CaclulateProjectVersionNumber(List projects, Repository repo)
- {
- string branch = CurrentBranch(repo);
-
- // populate the dependency chains
- projects.ForEach(x => x.PopulateDependencies(projects));
-
- // update the final version based on the repo history and the currentr branch name
- projects.ForEach(x => x.CalculateVersion(repo, branch));
- }
-
- private static void ResetProject(IEnumerable projectPaths)
- {
- if (File.Exists("build-inner.cmd"))
- {
- File.Delete("build-inner.cmd");
- }
-
- // revert the project.json change be reverting it but skipp all the git stuff as its not needed
- foreach (string p in projectPaths)
- {
- if (File.Exists($"{p}.bak"))
- {
- File.Copy($"{p}.bak", p, true);
- File.Delete($"{p}.bak");
- }
- }
- }
-
- ///
- /// Project level logic
- ///
- public class SourceProject
- {
- private readonly IEnumerable dependencies;
- private readonly ProjectRootElement project;
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The project.
- /// The root.
- public SourceProject(ProjectRootElement project, string root)
- {
- this.Name = project.Properties.FirstOrDefault(x => x.Name == "AssemblyTitle").Value;
-
- this.ProjectDirectory = project.DirectoryPath.Substring(root.Length);
- this.ProjectFilePath = project.ProjectFileLocation.File.Substring(root.Length);
- this.FullProjectFilePath = Path.GetFullPath(project.ProjectFileLocation.File);
- this.Version = new NuGetVersion(project.Properties.FirstOrDefault(x => x.Name == "VersionPrefix").Value);
- this.dependencies = project.Items.Where(x => x.ItemType == "ProjectReference").Select(x => Path.GetFullPath(Path.Combine(project.DirectoryPath, x.Include)));
- this.FinalVersionNumber = this.Version.ToFullString();
- this.project = project;
- }
-
- ///
- /// Gets the project directory.
- ///
- ///
- /// The project directory.
- ///
- public string ProjectDirectory { get; }
-
- ///
- /// Gets the version.
- ///
- ///
- /// The version.
- ///
- public NuGetVersion Version { get; private set; }
-
- ///
- /// Gets the dependent projects.
- ///
- ///
- /// The dependent projects.
- ///
- public List DependentProjects { get; private set; }
-
- ///
- /// Gets the name.
- ///
- ///
- /// The name.
- ///
- public string Name { get; private set; }
-
- ///
- /// Gets the project file path.
- ///
- ///
- /// The project file path.
- ///
- public string ProjectFilePath { get; private set; }
-
- ///
- /// Gets the commit count since version change.
- ///
- ///
- /// The commit count since version change.
- ///
- public int CommitCountSinceVersionChange { get; private set; } = 0;
-
- ///
- /// Gets the full project file path.
- ///
- ///
- /// The full project file path.
- ///
- public string FullProjectFilePath { get; private set; }
-
- ///
- /// Gets the final version number.
- ///
- ///
- /// The final version number.
- ///
- public string FinalVersionNumber { get; private set; }
-
- ///
- /// Populates the dependencies.
- ///
- /// The projects.
- public void PopulateDependencies(IEnumerable projects)
- {
- this.DependentProjects = projects.Where(x => this.dependencies.Contains(x.FullProjectFilePath)).ToList();
- }
-
- ///
- /// Update the version number in the project file
- ///
- /// the new version number to save.
- internal void UpdateVersion(string versionnumber)
- {
- this.project.AddProperty("VersionPrefix", versionnumber);
- this.Version = new NuGetVersion(versionnumber);
- this.project.Save();
- }
-
- ///
- /// Calculates the version.
- ///
- /// The repo.
- /// The branch.
- internal void CalculateVersion(Repository repo, string branch)
- {
- foreach (Commit c in repo.Commits)
- {
- if (!this.ApplyCommit(c, repo))
- {
- // we have finished lets populate the final version number
- this.FinalVersionNumber = this.CalculateVersionNumber(branch);
-
- return;
- }
- }
- }
-
- private bool MatchPath(string path)
- {
- if (path.StartsWith(this.ProjectDirectory, StringComparison.OrdinalIgnoreCase))
- {
- return true;
- }
-
- if (this.DependentProjects.Any())
- {
- return this.DependentProjects.Any(x => x.MatchPath(path));
- }
-
- return false;
- }
-
- private bool ApplyCommitInternal(Commit commit, TreeChanges changes, Repository repo)
- {
- this.CommitCountSinceVersionChange++;
-
- // return false if this is a version number root
- TreeEntryChanges projectFileChange = changes.Where(x => x.Path?.Equals(this.ProjectFilePath, StringComparison.OrdinalIgnoreCase) == true).FirstOrDefault();
- if (projectFileChange != null)
- {
- if (projectFileChange.Status == ChangeKind.Added)
- {
- // the version must have been set here
- return false;
- }
- else
- {
- Blob blob = repo.Lookup(projectFileChange.Oid);
- using (Stream s = blob.GetContentStream())
- {
- using (XmlReader reader = XmlReader.Create(s))
- {
- ProjectRootElement proj = ProjectRootElement.Create(reader);
- NuGetVersion version = new NuGetVersion(proj.Properties.FirstOrDefault(x => x.Name == "VersionPrefix").Value);
- if (version != this.Version)
- {
- // version changed
- return false;
- }
- }
- }
- }
-
- // version must have been the same lets carry on
- return true;
- }
-
- return true;
- }
-
- private bool ApplyCommit(Commit commit, Repository repo)
- {
- foreach (Commit parent in commit.Parents)
- {
- TreeChanges changes = repo.Diff.Compare(parent.Tree, commit.Tree);
-
- foreach (TreeEntryChanges change in changes)
- {
- if (!string.IsNullOrWhiteSpace(change.OldPath))
- {
- if (this.MatchPath(change.OldPath))
- {
- return this.ApplyCommitInternal(commit, changes, repo);
- }
- }
-
- if (!string.IsNullOrWhiteSpace(change.Path))
- {
- if (this.MatchPath(change.Path))
- {
- return this.ApplyCommitInternal(commit, changes, repo);
- }
- }
- }
- }
-
- return true;
- }
-
- private string CalculateVersionNumber(string branch)
- {
- string version = this.Version.ToFullString();
-
- // master only
- if (this.CommitCountSinceVersionChange == 1 && branch == "master")
- {
- if (this.Version.IsPrerelease)
- {
- // prerelease always needs the build counter just not on a branch name
- return $"{version}-{this.CommitCountSinceVersionChange:00000}";
- }
-
- // this is the full release happy path, first commit after changing the version number
- return version;
- }
-
- string rootSpecialVersion = string.Empty;
-
- if (this.Version.IsPrerelease)
- {
- // probably a much easy way for doing this but it work sell enough for a build script
- string[] parts = version.Split(new[] { '-' }, 2);
- version = parts[0];
- rootSpecialVersion = parts[1];
- }
-
- // if master and the version doesn't manually specify a prerelease tag force one on for CI builds
- if (branch == "master")
- {
- if (!this.Version.IsPrerelease)
- {
- branch = FallbackTag;
- }
- else
- {
- branch = string.Empty;
- }
- }
-
- if (rootSpecialVersion.Length > 0)
- {
- rootSpecialVersion = "-" + rootSpecialVersion;
- }
-
- if (branch.Length > 0)
- {
- branch = "-" + branch;
- }
-
- int maxLength = 20; // dotnet will fail to populate the package if the tag is > 20
- maxLength -= rootSpecialVersion.Length; // this is a required tag
- maxLength -= 7; // for the counter and dashes
-
- if (branch.Length > maxLength)
- {
- branch = branch.Substring(0, maxLength);
- }
-
- return $"{version}{rootSpecialVersion}{branch}-{this.CommitCountSinceVersionChange:00000}";
- }
- }
- }
-}
diff --git a/build/Properties/launchSettings.json b/build/Properties/launchSettings.json
deleted file mode 100644
index d175ae754..000000000
--- a/build/Properties/launchSettings.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "profiles": {
- "build": {
- "commandName": "Project",
- "commandLineArgs": "reset"
- }
- }
-}
\ No newline at end of file
diff --git a/build/build.cmd b/build/build.cmd
deleted file mode 100644
index 14fc0bdaa..000000000
--- a/build/build.cmd
+++ /dev/null
@@ -1,18 +0,0 @@
-@echo Off
-set buildRoot="%cd%"
-
-ECHO Restoring packages
-dotnet restore
-
-ECHO Updating version numbers and generating build script
-cd %~dp0
-dotnet run -- update
-cd %buildRoot%
-
-ECHO Building package
-call %~dp0build-inner.cmd
-
-ECHO Reset version numbers
-cd %~dp0
-dotnet run -- reset
-cd %buildRoot%
\ No newline at end of file
diff --git a/build/build.csproj b/build/build.csproj
deleted file mode 100644
index dc431284e..000000000
--- a/build/build.csproj
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
- netcoreapp1.1
- portable
- true
- build
- Exe
- build
- ..\ImageSharp.ruleset
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/build/reset-versions.cmd b/build/reset-versions.cmd
deleted file mode 100644
index 31d1d2431..000000000
--- a/build/reset-versions.cmd
+++ /dev/null
@@ -1,8 +0,0 @@
-@echo Off
-
-set buildRoot="%cd%"
-cd %~dp0
-
-dotnet run -- reset
-
-cd %buildRoot%
\ No newline at end of file
diff --git a/gitversion.yml b/gitversion.yml
new file mode 100644
index 000000000..9fae0d8c2
--- /dev/null
+++ b/gitversion.yml
@@ -0,0 +1,31 @@
+# to create a new package you create a new release/tag
+# in github appveyor will build it without the -cixxx tag
+# it will then be deployable cleanly to nuget.org
+
+branches:
+ master:
+ tag: ci
+ mode: ContinuousDeployment
+ increment: Minor
+ prevent-increment-of-merged-branch-version: false
+ track-merge-target: true
+ pull-request:
+ regex: (pull|pull\-requests|pr)[/-]
+ mode: ContinuousDelivery
+ tag: PullRequest
+ increment: Inherit
+ prevent-increment-of-merged-branch-version: false
+ tag-number-pattern: '[/-](?\d+)[-/]'
+ track-merge-target: false
+ tracks-release-branches: false
+ is-release-branch: false
+ otherbranches:
+ regex: '.*'
+ mode: ContinuousDeployment
+ tag: ci
+ increment: Patch
+ prevent-increment-of-merged-branch-version: false
+ track-merge-target: true
+ is-release-branch: false
+ignore:
+ sha: []
\ No newline at end of file
diff --git a/packages.xml b/packages.xml
new file mode 100644
index 000000000..c7ff4de4c
--- /dev/null
+++ b/packages.xml
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/AvatarWithRoundedCorner/Program.cs b/samples/AvatarWithRoundedCorner/Program.cs
index b164c8d3b..087bbc29d 100644
--- a/samples/AvatarWithRoundedCorner/Program.cs
+++ b/samples/AvatarWithRoundedCorner/Program.cs
@@ -1,69 +1,109 @@
-
+// Copyright (c) Six Labors and contributors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+using System.Numerics;
+using SixLabors.ImageSharp;
+using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Processing;
+using SixLabors.Primitives;
+using SixLabors.Shapes;
namespace AvatarWithRoundedCorner
{
- using System;
- using System.Numerics;
- using ImageSharp;
- using SixLabors.Primitives;
- using SixLabors.Shapes;
-
- class Program
+ static class Program
{
static void Main(string[] args)
{
System.IO.Directory.CreateDirectory("output");
+ using (var img = Image.Load("fb.jpg"))
+ {
+ // as generate returns a new IImage make sure we dispose of it
+ using (Image destRound = img.Clone(x => x.ConvertToAvatar(new Size(200, 200), 20)))
+ {
+ destRound.Save("output/fb.png");
+ }
- GenerateAvatar("fb.jpg", "output/fb.png", new Size(200, 200), 20);
- GenerateAvatar("fb.jpg", "output/fb-round.png", new Size(200, 200), 100);
- GenerateAvatar("fb.jpg", "output/fb-rounder.png", new Size(200, 200), 150);
+ using (Image destRound = img.Clone(x => x.ConvertToAvatar(new Size(200, 200), 100)))
+ {
+ destRound.Save("output/fb-round.png");
+ }
+
+ using (Image destRound = img.Clone(x => x.ConvertToAvatar(new Size(200, 200), 150)))
+ {
+ destRound.Save("output/fb-rounder.png");
+ }
+
+ using (Image destRound = img.CloneAndConvertToAvatarWithoutApply(new Size(200, 200), 150))
+ {
+ destRound.Save("output/fb-rounder-without-apply.png");
+ }
+
+ // the original `img` object has not been altered at all.
+ }
}
- private static void GenerateAvatar(string source, string destination, Size size, float cornerRadius)
+ // 1. The short way:
+ // Implements a full image mutating pipeline operating on IImageProcessingContext
+ // We need the dimensions of the resized image to deduce 'IPathCollection' needed to build the corners,
+ // so we implement an "inline" image processor by utilizing 'ImageExtensions.Apply()'
+ private static IImageProcessingContext ConvertToAvatar(this IImageProcessingContext processingContext, Size size, float cornerRadius)
{
- using (var image = Image.Load(source))
+ return processingContext.Resize(new ResizeOptions
{
- image.Resize(new ImageSharp.Processing.ResizeOptions
- {
- Size = size,
- Mode = ImageSharp.Processing.ResizeMode.Crop
- });
+ Size = size,
+ Mode = ResizeMode.Crop
+ }).Apply(i => ApplyRoundedCorners(i, cornerRadius));
+ }
- ApplyRoundedCourners(image, cornerRadius);
- image.Save(destination);
- }
+ // 2. A more verbose way, avoiding 'Apply()':
+ // First we create a resized clone of the image, then we draw the corners on that instance with Mutate().
+ private static Image CloneAndConvertToAvatarWithoutApply(this Image image, Size size, float cornerRadius)
+ {
+ Image result = image.Clone(
+ ctx => ctx.Resize(
+ new ResizeOptions
+ {
+ Size = size,
+ Mode = ResizeMode.Crop
+ }));
+
+ ApplyRoundedCorners(result, cornerRadius);
+ return result;
}
- public static void ApplyRoundedCourners(Image img, float cornerRadius)
+ // This method can be seen as an inline implementation of an `IImageProcessor`:
+ // (The combination of `IImageOperations.Apply()` + this could be replaced with an `IImageProcessor`)
+ public static void ApplyRoundedCorners(Image img, float cornerRadius)
{
- var corners = BuildCorners(img.Width, img.Height, cornerRadius);
- // now we have our corners time to draw them
- img.Fill(Rgba32.Transparent, corners, new GraphicsOptions(true)
+ IPathCollection corners = BuildCorners(img.Width, img.Height, cornerRadius);
+
+ // mutating in here as we already have a cloned original
+ img.Mutate(x => x.Fill(Rgba32.Transparent, corners, new GraphicsOptions(true)
{
- BlenderMode = ImageSharp.PixelFormats.PixelBlenderMode.Src // enforces that any part of this shape that has color is punched out of the background
- });
+ BlenderMode = PixelBlenderMode.Src // enforces that any part of this shape that has color is punched out of the background
+ }));
}
- public static IPathCollection BuildCorners(int imageWidth, int imageHeight, float cornerRadius)
+ public static IPathCollection BuildCorners(int imageWidth, int imageHeight, float cornerRadius)
{
// first create a square
- var rect = new SixLabors.Shapes.RectangularePolygon(-0.5f, -0.5f, cornerRadius, cornerRadius);
+ var rect = new RectangularePolygon(-0.5f, -0.5f, cornerRadius, cornerRadius);
// then cut out of the square a circle so we are left with a corner
- var cornerToptLeft = rect.Clip(new SixLabors.Shapes.EllipsePolygon(cornerRadius-0.5f, cornerRadius - 0.5f, cornerRadius));
+ IPath cornerToptLeft = rect.Clip(new EllipsePolygon(cornerRadius - 0.5f, cornerRadius - 0.5f, cornerRadius));
// corner is now a corner shape positions top left
- //lets make 3 more positioned correctly, we cando that by translating the orgional artound the center of the image
- var center = new Vector2(imageWidth / 2, imageHeight / 2);
- var angle = Math.PI / 2f;
+ //lets make 3 more positioned correctly, we can do that by translating the orgional artound the center of the image
+ var center = new Vector2(imageWidth / 2F, imageHeight / 2F);
- float rightPos = imageWidth - cornerToptLeft.Bounds.Width +1;
+ float rightPos = imageWidth - cornerToptLeft.Bounds.Width + 1;
float bottomPos = imageHeight - cornerToptLeft.Bounds.Height + 1;
// move it across the widthof the image - the width of the shape
- var cornerTopRight = cornerToptLeft.RotateDegree(90).Translate(rightPos, 0);
- var cornerBottomLeft = cornerToptLeft.RotateDegree(-90).Translate(0, bottomPos);
- var cornerBottomRight = cornerToptLeft.RotateDegree(180).Translate(rightPos, bottomPos);
+ IPath cornerTopRight = cornerToptLeft.RotateDegree(90).Translate(rightPos, 0);
+ IPath cornerBottomLeft = cornerToptLeft.RotateDegree(-90).Translate(0, bottomPos);
+ IPath cornerBottomRight = cornerToptLeft.RotateDegree(180).Translate(rightPos, bottomPos);
return new PathCollection(cornerToptLeft, cornerBottomLeft, cornerTopRight, cornerBottomRight);
}
diff --git a/samples/ChangeDefaultEncoderOptions/Program.cs b/samples/ChangeDefaultEncoderOptions/Program.cs
index dab8d445c..a8fbd7599 100644
--- a/samples/ChangeDefaultEncoderOptions/Program.cs
+++ b/samples/ChangeDefaultEncoderOptions/Program.cs
@@ -1,6 +1,9 @@
-using System;
-using ImageSharp;
-using ImageSharp.Formats;
+// Copyright (c) Six Labors and contributors.
+// Licensed under the Apache License, Version 2.0.
+
+using System;
+using SixLabors.ImageSharp;
+using SixLabors.ImageSharp.Formats.Jpeg;
namespace ChangeDefaultEncoderOptions
{
@@ -10,7 +13,7 @@ namespace ChangeDefaultEncoderOptions
{
// lets switch out the default encoder for jpeg to one
// that saves at 90 quality and ignores the matadata
- Configuration.Default.SetEncoder(ImageFormats.Jpeg, new ImageSharp.Formats.JpegEncoder()
+ Configuration.Default.SetEncoder(ImageFormats.Jpeg, new JpegEncoder()
{
Quality = 90,
IgnoreMetadata = true
diff --git a/src/ImageSharp.Drawing/Brushes/Brushes.cs b/src/ImageSharp.Drawing/Brushes/Brushes.cs
index e39f3dd49..47e207e8c 100644
--- a/src/ImageSharp.Drawing/Brushes/Brushes.cs
+++ b/src/ImageSharp.Drawing/Brushes/Brushes.cs
@@ -1,12 +1,10 @@
-//
-// Copyright (c) James Jackson-South and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-//
-namespace ImageSharp.Drawing.Brushes
-{
- using ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.PixelFormats;
+namespace SixLabors.ImageSharp.Drawing.Brushes
+{
///
/// A collection of methods for creating generic brushes.
///
diff --git a/src/ImageSharp.Drawing/Brushes/IBrush.cs b/src/ImageSharp.Drawing/Brushes/IBrush.cs
index 33b516e5c..bb907281b 100644
--- a/src/ImageSharp.Drawing/Brushes/IBrush.cs
+++ b/src/ImageSharp.Drawing/Brushes/IBrush.cs
@@ -1,14 +1,13 @@
-//
-// Copyright (c) James Jackson-South and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-//
-namespace ImageSharp.Drawing
-{
- using ImageSharp.PixelFormats;
- using Processors;
- using SixLabors.Primitives;
+using SixLabors.ImageSharp.Drawing.Brushes.Processors;
+using SixLabors.ImageSharp.Drawing.Processors;
+using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.Primitives;
+namespace SixLabors.ImageSharp.Drawing.Brushes
+{
///
/// Brush represents a logical configuration of a brush which can be used to source pixel colors
///
@@ -33,6 +32,6 @@ namespace ImageSharp.Drawing
/// The when being applied to things like shapes would usually be the
/// bounding box of the shape not necessarily the bounds of the whole image
///
- BrushApplicator CreateApplicator(ImageBase source, RectangleF region, GraphicsOptions options);
+ BrushApplicator CreateApplicator(ImageFrame source, RectangleF region, GraphicsOptions options);
}
}
\ No newline at end of file
diff --git a/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs
index 57fcd8ffa..4cd3585ec 100644
--- a/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs
+++ b/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs
@@ -1,17 +1,16 @@
-//
-// Copyright (c) James Jackson-South and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-//
-namespace ImageSharp.Drawing.Brushes
-{
- using System;
-
- using ImageSharp.Memory;
- using ImageSharp.PixelFormats;
- using Processors;
- using SixLabors.Primitives;
+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
+{
///
/// Provides an implementation of an image brush for painting images within areas.
///
@@ -22,19 +21,19 @@ namespace ImageSharp.Drawing.Brushes
///
/// The image to paint.
///
- private readonly ImageBase image;
+ private readonly ImageFrame image;
///
/// Initializes a new instance of the class.
///
/// The image.
- public ImageBrush(ImageBase image)
+ public ImageBrush(ImageFrame image)
{
this.image = image;
}
///
- public BrushApplicator CreateApplicator(ImageBase source, RectangleF region, GraphicsOptions options)
+ public BrushApplicator CreateApplicator(ImageFrame source, RectangleF region, GraphicsOptions options)
{
return new ImageBrushApplicator(source, this.image, region, options);
}
@@ -47,7 +46,7 @@ namespace ImageSharp.Drawing.Brushes
///
/// The source image.
///
- private readonly ImageBase source;
+ private readonly ImageFrame source;
///
/// The y-length.
@@ -76,7 +75,7 @@ namespace ImageSharp.Drawing.Brushes
/// The image.
/// The region.
/// The options
- public ImageBrushApplicator(ImageBase target, ImageBase image, RectangleF region, GraphicsOptions options)
+ public ImageBrushApplicator(ImageFrame target, ImageFrame image, RectangleF region, GraphicsOptions options)
: base(target, options)
{
this.source = image;
@@ -119,7 +118,7 @@ namespace ImageSharp.Drawing.Brushes
{
int sourceY = (y - this.offsetY) % this.yLength;
int offsetX = x - this.offsetX;
- Span sourceRow = this.source.GetRowSpan(sourceY);
+ Span sourceRow = this.source.GetPixelRowSpan(sourceY);
for (int i = 0; i < scanline.Length; i++)
{
@@ -130,7 +129,7 @@ namespace ImageSharp.Drawing.Brushes
overlay[i] = pixel;
}
- Span destinationRow = this.Target.GetRowSpan(x, y).Slice(0, scanline.Length);
+ Span destinationRow = this.Target.GetPixelRowSpan(y).Slice(x, scanline.Length);
this.Blender.Blend(destinationRow, destinationRow, overlay, amountBuffer);
}
}
diff --git a/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs
index 5fcb92bdc..844df0e0e 100644
--- a/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs
+++ b/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs
@@ -1,18 +1,17 @@
-//
-// Copyright (c) James Jackson-South and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-//
-namespace ImageSharp.Drawing.Brushes
-{
- using System;
- using System.Numerics;
-
- using ImageSharp.Memory;
- using ImageSharp.PixelFormats;
- using Processors;
- using SixLabors.Primitives;
+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
+{
///
/// Provides an implementation of a pattern brush for painting patterns.
///
@@ -93,7 +92,7 @@ namespace ImageSharp.Drawing.Brushes
}
///
- public BrushApplicator CreateApplicator(ImageBase source, RectangleF region, GraphicsOptions options)
+ public BrushApplicator CreateApplicator(ImageFrame source, RectangleF region, GraphicsOptions options)
{
return new PatternBrushApplicator(source, this.pattern, this.patternVector, options);
}
@@ -116,7 +115,7 @@ namespace ImageSharp.Drawing.Brushes
/// The pattern.
/// The patternVector.
/// The options
- public PatternBrushApplicator(ImageBase source, Fast2DArray pattern, Fast2DArray patternVector, GraphicsOptions options)
+ public PatternBrushApplicator(ImageFrame source, Fast2DArray pattern, Fast2DArray patternVector, GraphicsOptions options)
: base(source, options)
{
this.pattern = pattern;
@@ -164,7 +163,7 @@ namespace ImageSharp.Drawing.Brushes
overlay[i] = this.pattern[patternY, patternX];
}
- Span destinationRow = this.Target.GetRowSpan(x, y).Slice(0, scanline.Length);
+ Span destinationRow = this.Target.GetPixelRowSpan(y).Slice(x, scanline.Length);
this.Blender.Blend(destinationRow, destinationRow, overlay, amountBuffer);
}
}
diff --git a/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs b/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs
index 29c625d7f..ca6f7630d 100644
--- a/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs
+++ b/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs
@@ -1,15 +1,13 @@
-//
-// Copyright (c) James Jackson-South and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-//
-namespace ImageSharp.Drawing.Processors
-{
- using System;
-
- using ImageSharp.Memory;
- using ImageSharp.PixelFormats;
+using System;
+using SixLabors.ImageSharp.Advanced;
+using SixLabors.ImageSharp.Memory;
+using SixLabors.ImageSharp.PixelFormats;
+namespace SixLabors.ImageSharp.Drawing.Brushes.Processors
+{
///
/// primitive that converts a point in to a color for discovering the fill color based on an implementation
///
@@ -23,7 +21,7 @@ namespace ImageSharp.Drawing.Processors
///
/// The target.
/// The options.
- internal BrushApplicator(ImageBase target, GraphicsOptions options)
+ internal BrushApplicator(ImageFrame target, GraphicsOptions options)
{
this.Target = target;
@@ -40,7 +38,7 @@ namespace ImageSharp.Drawing.Processors
///
/// Gets the destinaion
///
- protected ImageBase Target { get; }
+ protected ImageFrame Target { get; }
///
/// Gets the blend percentage
@@ -80,7 +78,7 @@ namespace ImageSharp.Drawing.Processors
overlay[i] = this[x + i, y];
}
- Span destinationRow = this.Target.GetRowSpan(x, y).Slice(0, scanline.Length);
+ Span destinationRow = this.Target.GetPixelRowSpan(y).Slice(x, scanline.Length);
this.Blender.Blend(destinationRow, destinationRow, overlay, amountBuffer);
}
}
diff --git a/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs
index 27aa99b97..ba2fca4e4 100644
--- a/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs
+++ b/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs
@@ -1,18 +1,17 @@
-//
-// Copyright (c) James Jackson-South and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-//
-namespace ImageSharp.Drawing.Brushes
-{
- using System;
- using System.Numerics;
-
- using ImageSharp.Memory;
- using ImageSharp.PixelFormats;
- using Processors;
- using SixLabors.Primitives;
+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
+{
///
/// Provides an implementation of a brush that can recolor an image
///
@@ -58,7 +57,7 @@ namespace ImageSharp.Drawing.Brushes
public TPixel TargeTPixel { get; }
///
- public BrushApplicator CreateApplicator(ImageBase source, RectangleF region, GraphicsOptions options)
+ public BrushApplicator CreateApplicator(ImageFrame source, RectangleF region, GraphicsOptions options)
{
return new RecolorBrushApplicator(source, this.SourceColor, this.TargeTPixel, this.Threshold, options);
}
@@ -93,7 +92,7 @@ namespace ImageSharp.Drawing.Brushes
/// Color of the target.
/// The threshold .
/// The options
- public RecolorBrushApplicator(ImageBase source, TPixel sourceColor, TPixel targetColor, float threshold, GraphicsOptions options)
+ public RecolorBrushApplicator(ImageFrame source, TPixel sourceColor, TPixel targetColor, float threshold, GraphicsOptions options)
: base(source, options)
{
this.sourceColor = sourceColor.ToVector4();
@@ -159,7 +158,7 @@ namespace ImageSharp.Drawing.Brushes
overlay[i] = this[offsetX, y];
}
- Span destinationRow = this.Target.GetRowSpan(x, y).Slice(0, scanline.Length);
+ Span destinationRow = this.Target.GetPixelRowSpan(y).Slice(x, scanline.Length);
this.Blender.Blend(destinationRow, destinationRow, overlay, amountBuffer);
}
}
diff --git a/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs
index 21ebb88a0..658164339 100644
--- a/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs
+++ b/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs
@@ -1,18 +1,17 @@
-//
-// Copyright (c) James Jackson-South and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-//
-namespace ImageSharp.Drawing.Brushes
-{
- using System;
- using System.Numerics;
-
- using ImageSharp.Memory;
- using ImageSharp.PixelFormats;
- using Processors;
- using SixLabors.Primitives;
+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
+{
///
/// Provides an implementation of a solid brush for painting solid color areas.
///
@@ -43,7 +42,7 @@ namespace ImageSharp.Drawing.Brushes
public TPixel Color => this.color;
///
- public BrushApplicator CreateApplicator(ImageBase source, RectangleF region, GraphicsOptions options)
+ public BrushApplicator CreateApplicator(ImageFrame source, RectangleF region, GraphicsOptions options)
{
return new SolidBrushApplicator(source, this.color, options);
}
@@ -59,7 +58,7 @@ namespace ImageSharp.Drawing.Brushes
/// The source image.
/// The color.
/// The options
- public SolidBrushApplicator(ImageBase source, TPixel color, GraphicsOptions options)
+ public SolidBrushApplicator(ImageFrame source, TPixel color, GraphicsOptions options)
: base(source, options)
{
this.Colors = new Buffer(source.Width);
@@ -93,16 +92,23 @@ namespace ImageSharp.Drawing.Brushes
///
internal override void Apply(Span scanline, int x, int y)
{
- Span destinationRow = this.Target.GetRowSpan(x, y).Slice(0, scanline.Length);
-
- using (var amountBuffer = new Buffer(scanline.Length))
+ try
{
- for (int i = 0; i < scanline.Length; i++)
+ Span destinationRow = this.Target.GetPixelRowSpan(y).Slice(x, scanline.Length);
+
+ using (var amountBuffer = new Buffer(scanline.Length))
{
- amountBuffer[i] = scanline[i] * this.Options.BlendPercentage;
- }
+ for (int i = 0; i < scanline.Length; i++)
+ {
+ amountBuffer[i] = scanline[i] * this.Options.BlendPercentage;
+ }
- this.Blender.Blend(destinationRow, destinationRow, this.Colors, amountBuffer);
+ this.Blender.Blend(destinationRow, destinationRow, this.Colors, amountBuffer);
+ }
+ }
+ catch (Exception)
+ {
+ throw;
}
}
}
diff --git a/src/ImageSharp.Drawing/DrawImage.cs b/src/ImageSharp.Drawing/DrawImage.cs
index 03eb7be28..d55e22416 100644
--- a/src/ImageSharp.Drawing/DrawImage.cs
+++ b/src/ImageSharp.Drawing/DrawImage.cs
@@ -1,14 +1,12 @@
-//
-// Copyright (c) James Jackson-South and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-//
-namespace ImageSharp
-{
- using Drawing.Processors;
- using ImageSharp.PixelFormats;
- using SixLabors.Primitives;
+using SixLabors.ImageSharp.Drawing.Processors;
+using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.Primitives;
+namespace SixLabors.ImageSharp
+{
///
/// Extension methods for the type.
///
@@ -24,7 +22,7 @@ namespace ImageSharp
/// The location to draw the blended image.
/// The options.
/// The .
- public static Image DrawImage(this Image source, Image image, Size size, Point location, GraphicsOptions options)
+ public static IImageProcessingContext DrawImage(this IImageProcessingContext source, Image image, Size size, Point location, GraphicsOptions options)
where TPixel : struct, IPixel
{
if (size == default(Size))
@@ -37,7 +35,7 @@ namespace ImageSharp
location = Point.Empty;
}
- source.ApplyProcessor(new DrawImageProcessor(image, size, location, options), source.Bounds);
+ source.ApplyProcessor(new DrawImageProcessor(image, size, location, options));
return source;
}
@@ -49,7 +47,7 @@ namespace ImageSharp
/// The image to blend with the currently processing image.
/// The opacity of the image image to blend. Must be between 0 and 1.
/// The .
- public static Image Blend(this Image source, Image image, float percent)
+ public static IImageProcessingContext Blend(this IImageProcessingContext source, Image image, float percent)
where TPixel : struct, IPixel
{
GraphicsOptions options = GraphicsOptions.Default;
@@ -66,7 +64,7 @@ namespace ImageSharp
/// The blending mode.
/// The opacity of the image image to blend. Must be between 0 and 1.
/// The .
- public static Image Blend(this Image source, Image image, PixelBlenderMode blender, float percent)
+ public static IImageProcessingContext Blend(this IImageProcessingContext source, Image image, PixelBlenderMode blender, float percent)
where TPixel : struct, IPixel
{
GraphicsOptions options = GraphicsOptions.Default;
@@ -83,7 +81,7 @@ namespace ImageSharp
/// The image to blend with the currently processing image.
/// The options, including the blending type and belnding amount.
/// The .
- public static Image Blend(this Image source, Image image, GraphicsOptions options)
+ public static IImageProcessingContext Blend(this IImageProcessingContext source, Image image, GraphicsOptions options)
where TPixel : struct, IPixel
{
return DrawImage(source, image, default(Size), default(Point), options);
@@ -99,7 +97,7 @@ namespace ImageSharp
/// The size to draw the blended image.
/// The location to draw the blended image.
/// The .
- public static Image DrawImage(this Image source, Image image, float percent, Size size, Point location)
+ public static IImageProcessingContext DrawImage(this IImageProcessingContext source, Image image, float percent, Size size, Point location)
where TPixel : struct, IPixel
{
GraphicsOptions options = GraphicsOptions.Default;
@@ -118,7 +116,7 @@ namespace ImageSharp
/// The size to draw the blended image.
/// The location to draw the blended image.
/// The .
- public static Image DrawImage(this Image source, Image image, PixelBlenderMode blender, float percent, Size size, Point location)
+ public static IImageProcessingContext DrawImage(this IImageProcessingContext source, Image image, PixelBlenderMode blender, float percent, Size size, Point location)
where TPixel : struct, IPixel
{
GraphicsOptions options = GraphicsOptions.Default;
diff --git a/src/ImageSharp.Drawing/FillRegion.cs b/src/ImageSharp.Drawing/FillRegion.cs
index b3ee2ed99..2e5d311c6 100644
--- a/src/ImageSharp.Drawing/FillRegion.cs
+++ b/src/ImageSharp.Drawing/FillRegion.cs
@@ -1,15 +1,13 @@
-//
-// Copyright (c) James Jackson-South and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-//
-namespace ImageSharp
-{
- using Drawing;
- using Drawing.Brushes;
- using Drawing.Processors;
- using ImageSharp.PixelFormats;
+using SixLabors.ImageSharp.Drawing;
+using SixLabors.ImageSharp.Drawing.Brushes;
+using SixLabors.ImageSharp.Drawing.Processors;
+using SixLabors.ImageSharp.PixelFormats;
+namespace SixLabors.ImageSharp
+{
///
/// Extension methods for the type.
///
@@ -23,10 +21,10 @@ namespace ImageSharp
/// The details how to fill the region of interest.
/// The graphics options.
/// The .
- public static Image Fill(this Image source, IBrush brush, GraphicsOptions options)
+ public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, GraphicsOptions options)
where TPixel : struct, IPixel
{
- return source.Apply(new FillProcessor(brush, options));
+ return source.ApplyProcessor(new FillProcessor(brush, options));
}
///
@@ -36,7 +34,7 @@ namespace ImageSharp
/// The image this method extends.
/// The details how to fill the region of interest.
/// The .
- public static Image Fill(this Image source, IBrush brush)
+ public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush)
where TPixel : struct, IPixel
{
return source.Fill(brush, GraphicsOptions.Default);
@@ -49,7 +47,7 @@ namespace ImageSharp
/// The image this method extends.
/// The color.
/// The .
- public static Image Fill(this Image source, TPixel color)
+ public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color)
where TPixel : struct, IPixel
{
return source.Fill(new SolidBrush(color));
@@ -64,10 +62,10 @@ namespace ImageSharp
/// The region.
/// The graphics options.
/// The .
- public static Image Fill(this Image source, IBrush brush, Region region, GraphicsOptions options)
+ public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, Region region, GraphicsOptions options)
where TPixel : struct, IPixel
{
- return source.Apply(new FillRegionProcessor(brush, region, options));
+ return source.ApplyProcessor(new FillRegionProcessor(brush, region, options));
}
///
@@ -78,7 +76,7 @@ namespace ImageSharp
/// The brush.
/// The region.
/// The .
- public static Image Fill(this Image source, IBrush brush, Region region)
+ public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, Region region)
where TPixel : struct, IPixel
{
return source.Fill(brush, region, GraphicsOptions.Default);
@@ -93,7 +91,7 @@ namespace ImageSharp
/// The region.
/// The options.
/// The .
- public static Image Fill(this Image source, TPixel color, Region region, GraphicsOptions options)
+ public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, Region region, GraphicsOptions options)
where TPixel : struct, IPixel
{
return source.Fill(new SolidBrush(color), region, options);
@@ -107,7 +105,7 @@ namespace ImageSharp
/// The color.
/// The region.
/// The .
- public static Image Fill(this Image source, TPixel color, Region region)
+ public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, Region region)
where TPixel : struct, IPixel
{
return source.Fill(new SolidBrush(color), region);
diff --git a/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj b/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj
index ddf18e428..5918e7705 100644
--- a/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj
+++ b/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj
@@ -1,20 +1,21 @@
An extension to ImageSharp that allows the drawing of images, paths, and text.
- ImageSharp.Drawing
- 1.0.0-alpha9
- James Jackson-South and contributors
+ SixLabors.ImageSharp.Drawing
+ $(packageversion)
+ 0.0.1
+ Six Labor and contributors
netstandard1.1
true
true
- ImageSharp.Drawing
- ImageSharp.Drawing
+ SixLabors.ImageSharp.Drawing
+ SixLabors.ImageSharp.Drawing
Image Draw Shape Path Font
- https://raw.githubusercontent.com/JimBobSquarePants/ImageSharp/master/build/icons/imagesharp-logo-128.png
- https://github.com/JimBobSquarePants/ImageSharp
+ https://raw.githubusercontent.com/SixLabor/ImageSharp/master/build/icons/imagesharp-logo-128.png
+ https://github.com/SixLabors/ImageSharp
http://www.apache.org/licenses/LICENSE-2.0
git
- https://github.com/JimBobSquarePants/ImageSharp
+ https://github.com/SixLabor/ImageSharp
false
false
false
@@ -30,19 +31,22 @@
-
+
-
+
+
+
All
..\..\ImageSharp.ruleset
+ SixLabors.ImageSharp.Drawing
true
diff --git a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs b/src/ImageSharp.Drawing/Paths/DrawBeziers.cs
index 59bcf4036..de4fdd003 100644
--- a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs
+++ b/src/ImageSharp.Drawing/Paths/DrawBeziers.cs
@@ -1,18 +1,16 @@
-//
-// Copyright (c) James Jackson-South and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-//
-namespace ImageSharp
-{
- using System.Numerics;
- using Drawing;
- using Drawing.Brushes;
- using Drawing.Pens;
- using ImageSharp.PixelFormats;
- using SixLabors.Primitives;
- using SixLabors.Shapes;
+using System.Numerics;
+using SixLabors.ImageSharp.Drawing;
+using SixLabors.ImageSharp.Drawing.Brushes;
+using SixLabors.ImageSharp.Drawing.Pens;
+using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.Primitives;
+using SixLabors.Shapes;
+namespace SixLabors.ImageSharp
+{
///
/// Extension methods for the type.
///
@@ -28,7 +26,7 @@ namespace ImageSharp
/// The points.
/// The options.
/// The .
- public static Image DrawBeziers(this Image source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options)
+ 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);
@@ -43,7 +41,7 @@ namespace ImageSharp
/// The thickness.
/// The points.
/// The .
- public static Image DrawBeziers(this Image source, IBrush brush, float thickness, PointF[] points)
+ 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)));
@@ -58,7 +56,7 @@ namespace ImageSharp
/// The thickness.
/// The points.
/// The .
- public static Image DrawBeziers(this Image source, TPixel color, float thickness, PointF[] points)
+ 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);
@@ -74,7 +72,7 @@ namespace ImageSharp
/// The points.
/// The options.
/// The .
- public static Image DrawBeziers(this Image source, TPixel color, float thickness, PointF[] points, GraphicsOptions options)
+ 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);
@@ -89,7 +87,7 @@ namespace ImageSharp
/// The points.
/// The options.
/// The .
- public static Image DrawBeziers(this Image source, IPen pen, PointF[] points, GraphicsOptions options)
+ 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);
@@ -103,7 +101,7 @@ namespace ImageSharp
/// The pen.
/// The points.
/// The .
- public static Image DrawBeziers(this Image source, IPen pen, PointF[] points)
+ public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, IPen pen, PointF[] points)
where TPixel : struct, IPixel
{
return source.Draw(pen, new Path(new CubicBezierLineSegment(points)));
diff --git a/src/ImageSharp.Drawing/Paths/DrawLines.cs b/src/ImageSharp.Drawing/Paths/DrawLines.cs
index 3ce0dc4da..e5d9a1b3b 100644
--- a/src/ImageSharp.Drawing/Paths/DrawLines.cs
+++ b/src/ImageSharp.Drawing/Paths/DrawLines.cs
@@ -1,18 +1,16 @@
-//
-// Copyright (c) James Jackson-South and contributors.
+// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
-//
-namespace ImageSharp
-{
- using System.Numerics;
- using Drawing;
- using Drawing.Brushes;
- using Drawing.Pens;
- using ImageSharp.PixelFormats;
- using SixLabors.Primitives;
- using SixLabors.Shapes;
+using System.Numerics;
+using SixLabors.ImageSharp.Drawing;
+using SixLabors.ImageSharp.Drawing.Brushes;
+using SixLabors.ImageSharp.Drawing.Pens;
+using SixLabors.ImageSharp.PixelFormats;
+using SixLabors.Primitives;
+using SixLabors.Shapes;
+namespace SixLabors.ImageSharp
+{
///
/// Extension methods for the type.
///
@@ -28,7 +26,7 @@ namespace ImageSharp
/// The points.
/// The options.
/// The .
- public static Image DrawLines(this Image source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options)
+ public static IImageProcessingContext