Skip to content

Commit 0e9a066

Browse files
FS Namespaces and Implicit Global Usings
1 parent 8d2bab3 commit 0e9a066

File tree

1,782 files changed

+201506
-205472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,782 files changed

+201506
-205472
lines changed

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ csharp_space_between_square_brackets = false
253253
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#wrap-options
254254
csharp_preserve_single_line_statements = false
255255
csharp_preserve_single_line_blocks = true
256+
# Namespace options
257+
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#namespace-options
258+
csharp_style_namespace_declarations = file_scoped:warning
256259

257260
##########################################
258261
# .NET Naming Rules
@@ -452,4 +455,4 @@ dotnet_naming_rule.parameters_rule.severity = warning
452455
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
453456
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
454457
# OTHER DEALINGS IN THE SOFTWARE.
455-
##########################################
458+
##########################################

src/ImageSharp/Advanced/AdvancedImageExtensions.cs

Lines changed: 150 additions & 156 deletions
Large diffs are not rendered by default.

src/ImageSharp/Advanced/AotCompilerTools.cs

Lines changed: 498 additions & 500 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4-
namespace SixLabors.ImageSharp.Advanced
4+
namespace SixLabors.ImageSharp.Advanced;
5+
6+
/// <summary>
7+
/// Defines the contract for objects that can provide access to configuration.
8+
/// </summary>
9+
internal interface IConfigurationProvider
510
{
611
/// <summary>
7-
/// Defines the contract for objects that can provide access to configuration.
12+
/// Gets the configuration which allows altering default behaviour or extending the library.
813
/// </summary>
9-
internal interface IConfigurationProvider
10-
{
11-
/// <summary>
12-
/// Gets the configuration which allows altering default behaviour or extending the library.
13-
/// </summary>
14-
Configuration Configuration { get; }
15-
}
14+
Configuration Configuration { get; }
1615
}
Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4-
using System.Threading;
5-
using System.Threading.Tasks;
64
using SixLabors.ImageSharp.PixelFormats;
75

8-
namespace SixLabors.ImageSharp.Advanced
6+
namespace SixLabors.ImageSharp.Advanced;
7+
8+
/// <summary>
9+
/// A visitor to implement a double-dispatch pattern in order to apply pixel-specific operations
10+
/// on non-generic <see cref="Image"/> instances.
11+
/// </summary>
12+
public interface IImageVisitor
913
{
1014
/// <summary>
11-
/// A visitor to implement a double-dispatch pattern in order to apply pixel-specific operations
12-
/// on non-generic <see cref="Image"/> instances.
15+
/// Provides a pixel-specific implementation for a given operation.
1316
/// </summary>
14-
public interface IImageVisitor
15-
{
16-
/// <summary>
17-
/// Provides a pixel-specific implementation for a given operation.
18-
/// </summary>
19-
/// <param name="image">The image.</param>
20-
/// <typeparam name="TPixel">The pixel type.</typeparam>
21-
void Visit<TPixel>(Image<TPixel> image)
22-
where TPixel : unmanaged, IPixel<TPixel>;
23-
}
17+
/// <param name="image">The image.</param>
18+
/// <typeparam name="TPixel">The pixel type.</typeparam>
19+
void Visit<TPixel>(Image<TPixel> image)
20+
where TPixel : unmanaged, IPixel<TPixel>;
21+
}
2422

23+
/// <summary>
24+
/// A visitor to implement a double-dispatch pattern in order to apply pixel-specific operations
25+
/// on non-generic <see cref="Image"/> instances.
26+
/// </summary>
27+
public interface IImageVisitorAsync
28+
{
2529
/// <summary>
26-
/// A visitor to implement a double-dispatch pattern in order to apply pixel-specific operations
27-
/// on non-generic <see cref="Image"/> instances.
30+
/// Provides a pixel-specific implementation for a given operation.
2831
/// </summary>
29-
public interface IImageVisitorAsync
30-
{
31-
/// <summary>
32-
/// Provides a pixel-specific implementation for a given operation.
33-
/// </summary>
34-
/// <param name="image">The image.</param>
35-
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
36-
/// <typeparam name="TPixel">The pixel type.</typeparam>
37-
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
38-
Task VisitAsync<TPixel>(Image<TPixel> image, CancellationToken cancellationToken)
39-
where TPixel : unmanaged, IPixel<TPixel>;
40-
}
32+
/// <param name="image">The image.</param>
33+
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
34+
/// <typeparam name="TPixel">The pixel type.</typeparam>
35+
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
36+
Task VisitAsync<TPixel>(Image<TPixel> image, CancellationToken cancellationToken)
37+
where TPixel : unmanaged, IPixel<TPixel>;
4138
}

src/ImageSharp/Advanced/IPixelSource.cs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,28 @@
44
using SixLabors.ImageSharp.Memory;
55
using SixLabors.ImageSharp.PixelFormats;
66

7-
namespace SixLabors.ImageSharp.Advanced
7+
namespace SixLabors.ImageSharp.Advanced;
8+
9+
/// <summary>
10+
/// Encapsulates the basic properties and methods required to manipulate images.
11+
/// </summary>
12+
internal interface IPixelSource
813
{
914
/// <summary>
10-
/// Encapsulates the basic properties and methods required to manipulate images.
15+
/// Gets the pixel buffer.
1116
/// </summary>
12-
internal interface IPixelSource
13-
{
14-
/// <summary>
15-
/// Gets the pixel buffer.
16-
/// </summary>
17-
Buffer2D<byte> PixelBuffer { get; }
18-
}
17+
Buffer2D<byte> PixelBuffer { get; }
18+
}
1919

20+
/// <summary>
21+
/// Encapsulates the basic properties and methods required to manipulate images.
22+
/// </summary>
23+
/// <typeparam name="TPixel">The type of the pixel.</typeparam>
24+
internal interface IPixelSource<TPixel>
25+
where TPixel : unmanaged, IPixel<TPixel>
26+
{
2027
/// <summary>
21-
/// Encapsulates the basic properties and methods required to manipulate images.
28+
/// Gets the pixel buffer.
2229
/// </summary>
23-
/// <typeparam name="TPixel">The type of the pixel.</typeparam>
24-
internal interface IPixelSource<TPixel>
25-
where TPixel : unmanaged, IPixel<TPixel>
26-
{
27-
/// <summary>
28-
/// Gets the pixel buffer.
29-
/// </summary>
30-
Buffer2D<TPixel> PixelBuffer { get; }
31-
}
30+
Buffer2D<TPixel> PixelBuffer { get; }
3231
}

src/ImageSharp/Advanced/IRowIntervalOperation.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33

44
using SixLabors.ImageSharp.Memory;
55

6-
namespace SixLabors.ImageSharp.Advanced
6+
namespace SixLabors.ImageSharp.Advanced;
7+
8+
/// <summary>
9+
/// Defines the contract for an action that operates on a row interval.
10+
/// </summary>
11+
public interface IRowIntervalOperation
712
{
813
/// <summary>
9-
/// Defines the contract for an action that operates on a row interval.
14+
/// Invokes the method passing the row interval.
1015
/// </summary>
11-
public interface IRowIntervalOperation
12-
{
13-
/// <summary>
14-
/// Invokes the method passing the row interval.
15-
/// </summary>
16-
/// <param name="rows">The row interval.</param>
17-
void Invoke(in RowInterval rows);
18-
}
16+
/// <param name="rows">The row interval.</param>
17+
void Invoke(in RowInterval rows);
1918
}
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4-
using System;
54
using SixLabors.ImageSharp.Memory;
65

7-
namespace SixLabors.ImageSharp.Advanced
6+
namespace SixLabors.ImageSharp.Advanced;
7+
8+
/// <summary>
9+
/// Defines the contract for an action that operates on a row interval with a temporary buffer.
10+
/// </summary>
11+
/// <typeparam name="TBuffer">The type of buffer elements.</typeparam>
12+
public interface IRowIntervalOperation<TBuffer>
13+
where TBuffer : unmanaged
814
{
915
/// <summary>
10-
/// Defines the contract for an action that operates on a row interval with a temporary buffer.
16+
/// Invokes the method passing the row interval and a buffer.
1117
/// </summary>
12-
/// <typeparam name="TBuffer">The type of buffer elements.</typeparam>
13-
public interface IRowIntervalOperation<TBuffer>
14-
where TBuffer : unmanaged
15-
{
16-
/// <summary>
17-
/// Invokes the method passing the row interval and a buffer.
18-
/// </summary>
19-
/// <param name="rows">The row interval.</param>
20-
/// <param name="span">The contiguous region of memory.</param>
21-
void Invoke(in RowInterval rows, Span<TBuffer> span);
22-
}
18+
/// <param name="rows">The row interval.</param>
19+
/// <param name="span">The contiguous region of memory.</param>
20+
void Invoke(in RowInterval rows, Span<TBuffer> span);
2321
}
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4-
namespace SixLabors.ImageSharp.Advanced
4+
namespace SixLabors.ImageSharp.Advanced;
5+
6+
/// <summary>
7+
/// Defines the contract for an action that operates on a row.
8+
/// </summary>
9+
public interface IRowOperation
510
{
611
/// <summary>
7-
/// Defines the contract for an action that operates on a row.
12+
/// Invokes the method passing the row y coordinate.
813
/// </summary>
9-
public interface IRowOperation
10-
{
11-
/// <summary>
12-
/// Invokes the method passing the row y coordinate.
13-
/// </summary>
14-
/// <param name="y">The row y coordinate.</param>
15-
void Invoke(int y);
16-
}
14+
/// <param name="y">The row y coordinate.</param>
15+
void Invoke(int y);
1716
}
Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4-
using System;
4+
namespace SixLabors.ImageSharp.Advanced;
55

6-
namespace SixLabors.ImageSharp.Advanced
6+
/// <summary>
7+
/// Defines the contract for an action that operates on a row with a temporary buffer.
8+
/// </summary>
9+
/// <typeparam name="TBuffer">The type of buffer elements.</typeparam>
10+
public interface IRowOperation<TBuffer>
11+
where TBuffer : unmanaged
712
{
813
/// <summary>
9-
/// Defines the contract for an action that operates on a row with a temporary buffer.
14+
/// Invokes the method passing the row and a buffer.
1015
/// </summary>
11-
/// <typeparam name="TBuffer">The type of buffer elements.</typeparam>
12-
public interface IRowOperation<TBuffer>
13-
where TBuffer : unmanaged
14-
{
15-
/// <summary>
16-
/// Invokes the method passing the row and a buffer.
17-
/// </summary>
18-
/// <param name="y">The row y coordinate.</param>
19-
/// <param name="span">The contiguous region of memory.</param>
20-
void Invoke(int y, Span<TBuffer> span);
21-
}
16+
/// <param name="y">The row y coordinate.</param>
17+
/// <param name="span">The contiguous region of memory.</param>
18+
void Invoke(int y, Span<TBuffer> span);
2219
}

0 commit comments

Comments
 (0)