Skip to content

Commit 7196b43

Browse files
Master cleanup (#952)
* Fix gitignore and line endings * Update README.md
1 parent a48de63 commit 7196b43

33 files changed

+8878
-8889
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
*.sql text eol=lf
5050
*.svg text eol=lf
5151
*.targets text eol=lf
52-
*.tt text eol=lf
52+
*.tt text eol=crlf
5353
*.ttinclude text eol=crlf
5454
*.txt text eol=lf
5555
*.vb text eol=lf

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,6 @@ FakesAssemblies/
204204

205205
**/node_modules
206206
**/node_modules/*
207-
**/Images/ActualOutput
208-
**/Images/ReferenceOutput
209207

210208
# ASP.NET 5
211209
project.lock.json
@@ -218,7 +216,8 @@ artifacts/
218216
*.csproj.bak
219217

220218
#CodeCoverage
221-
**/CodeCoverage/*
222-
docs/
223-
/samples/AvatarWithRoundedCorner/output
224219
/ImageSharp.Coverage.xml
220+
221+
# Tests
222+
**/Images/ActualOutput
223+
**/Images/ReferenceOutput

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,18 @@ Alternatively, you can work from command line and/or with a lightweight editor o
118118
- [Visual Studio Code](https://code.visualstudio.com/) with [C# Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp)
119119
- [.NET Core](https://www.microsoft.com/net/core#linuxubuntu)
120120

121-
To clone ImageSharp locally, click the "Clone in Windows" button above or run the following git commands:
121+
To clone ImageSharp locally, click the "Clone in [YOUR_OS]" button above or run the following git commands:
122122

123123
```bash
124124
git clone https://github.com/SixLabors/ImageSharp
125125
```
126126

127+
If working with Windows please ensure that you have enabled log file paths in git (run as Administrator).
128+
129+
```bash
130+
git config --system core.longpaths true
131+
```
132+
127133
### Submodules
128134

129135
This repository contains [git submodules](https://blog.github.com/2016-02-01-working-with-submodules/). To add the submodules to the project, navigate to the repository root and type:
Lines changed: 98 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,99 @@
1-
// Copyright (c) Six Labors and contributors.
2-
// Licensed under the Apache License, Version 2.0.
3-
4-
using System.Buffers;
5-
using System.Threading.Tasks;
6-
7-
using SixLabors.ImageSharp.Memory;
8-
using SixLabors.ImageSharp.PixelFormats;
9-
using SixLabors.Memory;
10-
using SixLabors.Primitives;
11-
12-
namespace SixLabors.ImageSharp.Processing.Processors.Drawing
13-
{
14-
/// <summary>
15-
/// Combines two images together by blending the pixels.
16-
/// </summary>
17-
public class DrawImageProcessor : IImageProcessor
18-
{
19-
/// <summary>
20-
/// Initializes a new instance of the <see cref="DrawImageProcessor"/> class.
21-
/// </summary>
22-
/// <param name="image">The image to blend.</param>
23-
/// <param name="location">The location to draw the blended image.</param>
24-
/// <param name="colorBlendingMode">The blending mode to use when drawing the image.</param>
25-
/// <param name="alphaCompositionMode">The Alpha blending mode to use when drawing the image.</param>
26-
/// <param name="opacity">The opacity of the image to blend.</param>
27-
public DrawImageProcessor(
28-
Image image,
29-
Point location,
30-
PixelColorBlendingMode colorBlendingMode,
31-
PixelAlphaCompositionMode alphaCompositionMode,
32-
float opacity)
33-
{
34-
this.Image = image;
35-
this.Location = location;
36-
this.ColorBlendingMode = colorBlendingMode;
37-
this.AlphaCompositionMode = alphaCompositionMode;
38-
this.Opacity = opacity;
39-
}
40-
41-
/// <summary>
42-
/// Gets the image to blend.
43-
/// </summary>
44-
public Image Image { get; }
45-
46-
/// <summary>
47-
/// Gets the location to draw the blended image.
48-
/// </summary>
49-
public Point Location { get; }
50-
51-
/// <summary>
52-
/// Gets the blending mode to use when drawing the image.
53-
/// </summary>
54-
public PixelColorBlendingMode ColorBlendingMode { get; }
55-
56-
/// <summary>
57-
/// Gets the Alpha blending mode to use when drawing the image.
58-
/// </summary>
59-
public PixelAlphaCompositionMode AlphaCompositionMode { get; }
60-
61-
/// <summary>
62-
/// Gets the opacity of the image to blend.
63-
/// </summary>
64-
public float Opacity { get; }
65-
66-
/// <inheritdoc />
67-
public IImageProcessor<TPixelBg> CreatePixelSpecificProcessor<TPixelBg>()
68-
where TPixelBg : struct, IPixel<TPixelBg>
69-
{
70-
var visitor = new ProcessorFactoryVisitor<TPixelBg>(this);
71-
this.Image.AcceptVisitor(visitor);
72-
return visitor.Result;
73-
}
74-
75-
private class ProcessorFactoryVisitor<TPixelBg> : IImageVisitor
76-
where TPixelBg : struct, IPixel<TPixelBg>
77-
{
78-
private readonly DrawImageProcessor definition;
79-
80-
public ProcessorFactoryVisitor(DrawImageProcessor definition)
81-
{
82-
this.definition = definition;
83-
}
84-
85-
public IImageProcessor<TPixelBg> Result { get; private set; }
86-
87-
public void Visit<TPixelFg>(Image<TPixelFg> image)
88-
where TPixelFg : struct, IPixel<TPixelFg>
89-
{
90-
this.Result = new DrawImageProcessor<TPixelBg, TPixelFg>(
91-
image,
92-
this.definition.Location,
93-
this.definition.ColorBlendingMode,
94-
this.definition.AlphaCompositionMode,
95-
this.definition.Opacity);
96-
}
97-
}
98-
}
1+
// Copyright (c) Six Labors and contributors.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
using System.Buffers;
5+
using System.Threading.Tasks;
6+
7+
using SixLabors.ImageSharp.Memory;
8+
using SixLabors.ImageSharp.PixelFormats;
9+
using SixLabors.Memory;
10+
using SixLabors.Primitives;
11+
12+
namespace SixLabors.ImageSharp.Processing.Processors.Drawing
13+
{
14+
/// <summary>
15+
/// Combines two images together by blending the pixels.
16+
/// </summary>
17+
public class DrawImageProcessor : IImageProcessor
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the <see cref="DrawImageProcessor"/> class.
21+
/// </summary>
22+
/// <param name="image">The image to blend.</param>
23+
/// <param name="location">The location to draw the blended image.</param>
24+
/// <param name="colorBlendingMode">The blending mode to use when drawing the image.</param>
25+
/// <param name="alphaCompositionMode">The Alpha blending mode to use when drawing the image.</param>
26+
/// <param name="opacity">The opacity of the image to blend.</param>
27+
public DrawImageProcessor(
28+
Image image,
29+
Point location,
30+
PixelColorBlendingMode colorBlendingMode,
31+
PixelAlphaCompositionMode alphaCompositionMode,
32+
float opacity)
33+
{
34+
this.Image = image;
35+
this.Location = location;
36+
this.ColorBlendingMode = colorBlendingMode;
37+
this.AlphaCompositionMode = alphaCompositionMode;
38+
this.Opacity = opacity;
39+
}
40+
41+
/// <summary>
42+
/// Gets the image to blend.
43+
/// </summary>
44+
public Image Image { get; }
45+
46+
/// <summary>
47+
/// Gets the location to draw the blended image.
48+
/// </summary>
49+
public Point Location { get; }
50+
51+
/// <summary>
52+
/// Gets the blending mode to use when drawing the image.
53+
/// </summary>
54+
public PixelColorBlendingMode ColorBlendingMode { get; }
55+
56+
/// <summary>
57+
/// Gets the Alpha blending mode to use when drawing the image.
58+
/// </summary>
59+
public PixelAlphaCompositionMode AlphaCompositionMode { get; }
60+
61+
/// <summary>
62+
/// Gets the opacity of the image to blend.
63+
/// </summary>
64+
public float Opacity { get; }
65+
66+
/// <inheritdoc />
67+
public IImageProcessor<TPixelBg> CreatePixelSpecificProcessor<TPixelBg>()
68+
where TPixelBg : struct, IPixel<TPixelBg>
69+
{
70+
var visitor = new ProcessorFactoryVisitor<TPixelBg>(this);
71+
this.Image.AcceptVisitor(visitor);
72+
return visitor.Result;
73+
}
74+
75+
private class ProcessorFactoryVisitor<TPixelBg> : IImageVisitor
76+
where TPixelBg : struct, IPixel<TPixelBg>
77+
{
78+
private readonly DrawImageProcessor definition;
79+
80+
public ProcessorFactoryVisitor(DrawImageProcessor definition)
81+
{
82+
this.definition = definition;
83+
}
84+
85+
public IImageProcessor<TPixelBg> Result { get; private set; }
86+
87+
public void Visit<TPixelFg>(Image<TPixelFg> image)
88+
where TPixelFg : struct, IPixel<TPixelFg>
89+
{
90+
this.Result = new DrawImageProcessor<TPixelBg, TPixelFg>(
91+
image,
92+
this.definition.Location,
93+
this.definition.ColorBlendingMode,
94+
this.definition.AlphaCompositionMode,
95+
this.definition.Opacity);
96+
}
97+
}
98+
}
9999
}
Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
1-
// Copyright (c) Six Labors and contributors.
2-
// Licensed under the Apache License, Version 2.0.
3-
4-
using System.Threading.Tasks;
5-
6-
using SixLabors.ImageSharp.PixelFormats;
7-
using SixLabors.Memory;
8-
9-
namespace SixLabors.ImageSharp.Processing.Processors.Drawing
10-
{
11-
/// <summary>
12-
/// Defines a processor to fill an <see cref="Image"/> with the given <see cref="IBrush"/>
13-
/// using blending defined by the given <see cref="GraphicsOptions"/>.
14-
/// </summary>
15-
public class FillProcessor : IImageProcessor
16-
{
17-
/// <summary>
18-
/// Initializes a new instance of the <see cref="FillProcessor"/> class.
19-
/// </summary>
20-
/// <param name="brush">The brush to use for filling.</param>
21-
/// <param name="options">The <see cref="GraphicsOptions"/> defining how to blend the brush pixels over the image pixels.</param>
22-
public FillProcessor(IBrush brush, GraphicsOptions options)
23-
{
24-
this.Brush = brush;
25-
this.Options = options;
26-
}
27-
28-
/// <summary>
29-
/// Gets the <see cref="IBrush"/> used for filling the destination image.
30-
/// </summary>
31-
public IBrush Brush { get; }
32-
33-
/// <summary>
34-
/// Gets the <see cref="GraphicsOptions"/> defining how to blend the brush pixels over the image pixels.
35-
/// </summary>
36-
public GraphicsOptions Options { get; }
37-
38-
/// <inheritdoc />
39-
public IImageProcessor<TPixel> CreatePixelSpecificProcessor<TPixel>()
40-
where TPixel : struct, IPixel<TPixel>
41-
{
42-
return new FillProcessor<TPixel>(this);
43-
}
44-
}
1+
// Copyright (c) Six Labors and contributors.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
using System.Threading.Tasks;
5+
6+
using SixLabors.ImageSharp.PixelFormats;
7+
using SixLabors.Memory;
8+
9+
namespace SixLabors.ImageSharp.Processing.Processors.Drawing
10+
{
11+
/// <summary>
12+
/// Defines a processor to fill an <see cref="Image"/> with the given <see cref="IBrush"/>
13+
/// using blending defined by the given <see cref="GraphicsOptions"/>.
14+
/// </summary>
15+
public class FillProcessor : IImageProcessor
16+
{
17+
/// <summary>
18+
/// Initializes a new instance of the <see cref="FillProcessor"/> class.
19+
/// </summary>
20+
/// <param name="brush">The brush to use for filling.</param>
21+
/// <param name="options">The <see cref="GraphicsOptions"/> defining how to blend the brush pixels over the image pixels.</param>
22+
public FillProcessor(IBrush brush, GraphicsOptions options)
23+
{
24+
this.Brush = brush;
25+
this.Options = options;
26+
}
27+
28+
/// <summary>
29+
/// Gets the <see cref="IBrush"/> used for filling the destination image.
30+
/// </summary>
31+
public IBrush Brush { get; }
32+
33+
/// <summary>
34+
/// Gets the <see cref="GraphicsOptions"/> defining how to blend the brush pixels over the image pixels.
35+
/// </summary>
36+
public GraphicsOptions Options { get; }
37+
38+
/// <inheritdoc />
39+
public IImageProcessor<TPixel> CreatePixelSpecificProcessor<TPixel>()
40+
where TPixel : struct, IPixel<TPixel>
41+
{
42+
return new FillProcessor<TPixel>(this);
43+
}
44+
}
4545
}

0 commit comments

Comments
 (0)