Skip to content

Commit 35c4445

Browse files
Feng shui all the things.
1 parent d427d29 commit 35c4445

98 files changed

Lines changed: 454 additions & 680 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ SixLabors.ImageSharp.Drawing
1515

1616
</div>
1717

18-
### **ImageSharp.Drawing** provides extensions to ImageSharp containing powerful, cross-platform 2D polygon manipulation and drawing APIs.
18+
### **ImageSharp.Drawing** provides extensions to ImageSharp containing powerful, Cross-Platform 2D polygon manipulation and drawing APIs.
1919

2020
Designed to democratize image processing, ImageSharp.Drawing brings you an incredibly powerful yet beautifully simple API.
2121

22-
Built against [.NET 6](https://docs.microsoft.com/en-us/dotnet/standard/net-standard), ImageSharp.Drawing can be used in device, cloud, and embedded/IoT scenarios.
22+
Built against [.NET 8](https://docs.microsoft.com/en-us/dotnet/standard/net-standard), ImageSharp.Drawing can be used in device, cloud, and embedded/IoT scenarios.
2323

2424
## License
2525

@@ -61,12 +61,12 @@ If you prefer, you can compile ImageSharp.Drawing yourself (please do and help!)
6161

6262
- Using [Visual Studio 2022](https://visualstudio.microsoft.com/vs/)
6363
- Make sure you have the latest version installed
64-
- Make sure you have [the .NET 7 SDK](https://www.microsoft.com/net/core#windows) installed
64+
- Make sure you have [the .NET 8 SDK](https://www.microsoft.com/net/core#windows) installed
6565

6666
Alternatively, you can work from command line and/or with a lightweight editor on **both Linux/Unix and Windows**:
6767

6868
- [Visual Studio Code](https://code.visualstudio.com/) with [C# Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp)
69-
- [the .NET 7 SDK](https://www.microsoft.com/net/core#linuxubuntu)
69+
- [the .NET 8 SDK](https://www.microsoft.com/net/core#linuxubuntu)
7070

7171
To clone ImageSharp.Drawing locally, click the "Clone in [YOUR_OS]" button above or run the following git commands:
7272

src/ImageSharp.Drawing.WebGPU/WebGPUDrawingBackend.CoverageRasterizer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.Runtime.CompilerServices;
77
using System.Runtime.InteropServices;
88
using Silk.NET.WebGPU;
9-
using SixLabors.ImageSharp.Drawing.Shapes.Rasterization;
109
using SixLabors.ImageSharp.Memory;
1110
using SixLabors.ImageSharp.PixelFormats;
1211
using WgpuBuffer = Silk.NET.WebGPU.Buffer;

src/ImageSharp.Drawing.WebGPU/WebGPUDrawingBackend.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
using System.Runtime.InteropServices;
88
using Silk.NET.WebGPU;
99
using Silk.NET.WebGPU.Extensions.WGPU;
10-
using SixLabors.ImageSharp;
11-
using SixLabors.ImageSharp.Drawing.Shapes.Rasterization;
1210
using SixLabors.ImageSharp.Memory;
1311
using SixLabors.ImageSharp.PixelFormats;
1412
using WgpuBuffer = Silk.NET.WebGPU.Buffer;
@@ -508,8 +506,8 @@ private bool TryRenderPreparedFlush<TPixel>(
508506
outputOriginY = 0;
509507
}
510508

511-
List<CompositionCoverageDefinition> coverageDefinitions = new();
512-
Dictionary<CoverageDefinitionIdentity, int> coverageDefinitionIndexByKey = new();
509+
List<CompositionCoverageDefinition> coverageDefinitions = [];
510+
Dictionary<CoverageDefinitionIdentity, int> coverageDefinitionIndexByKey = [];
513511
int[] batchCoverageIndices = new int[preparedBatches.Count];
514512
for (int i = 0; i < batchCoverageIndices.Length; i++)
515513
{
@@ -628,7 +626,7 @@ private bool TryDispatchPreparedCompositeCommands<TPixel>(
628626
}
629627

630628
string pipelineKey = $"prepared-composite-fine/{flushContext.TextureFormat}";
631-
WebGPUCompositeBindGroupLayoutFactory layoutFactory = (WebGPU api, Device* device, out BindGroupLayout* layout, out string? layoutError)
629+
bool LayoutFactory(WebGPU api, Device* device, out BindGroupLayout* layout, out string? layoutError)
632630
=> TryCreatePreparedCompositeFineBindGroupLayout(
633631
api,
634632
device,
@@ -640,7 +638,7 @@ private bool TryDispatchPreparedCompositeCommands<TPixel>(
640638
if (!flushContext.DeviceState.TryGetOrCreateCompositeComputePipeline(
641639
pipelineKey,
642640
shaderCode,
643-
layoutFactory,
641+
LayoutFactory,
644642
out BindGroupLayout* bindGroupLayout,
645643
out ComputePipeline* pipeline,
646644
out error))
@@ -790,8 +788,8 @@ private bool TryDispatchPreparedCompositeCommands<TPixel>(
790788
destinationX + destinationRegion.Width,
791789
destinationY + destinationRegion.Height);
792790
commandIndex++;
791+
}
793792
}
794-
}
795793

796794
int usedParameterByteCount = checked(flushCommandCount * (int)parameterSize);
797795
if (!flushContext.DeviceState.TryGetOrCreateSharedBuffer(
@@ -852,7 +850,7 @@ private bool TryDispatchPreparedCompositeCommands<TPixel>(
852850
return false;
853851
}
854852

855-
nuint binDataByteCount = checked((nuint)binningSize * (nuint)sizeof(uint));
853+
nuint binDataByteCount = checked(binningSize * (nuint)sizeof(uint));
856854
if (!flushContext.DeviceState.TryGetOrCreateSharedBuffer(
857855
PreparedCompositeBinDataBufferKey,
858856
BufferUsage.Storage | BufferUsage.CopyDst,
@@ -918,8 +916,8 @@ private bool TryDispatchPreparedCompositeCommands<TPixel>(
918916
(nuint)tileCountsByteCount);
919917

920918
uint tileCommandCapacity = maxTileCommandIndices;
921-
nuint usedTileCommandCount = (nuint)Math.Max(tileCommandCapacity, 1u);
922-
nuint tileCommandIndicesByteCount = checked(usedTileCommandCount * (nuint)sizeof(uint));
919+
nuint usedTileCommandCount = Math.Max(tileCommandCapacity, 1u);
920+
nuint tileCommandIndicesByteCount = checked(usedTileCommandCount * sizeof(uint));
923921
if (!flushContext.DeviceState.TryGetOrCreateSharedBuffer(
924922
PreparedCompositeTileIndicesBufferKey,
925923
BufferUsage.Storage | BufferUsage.CopyDst,
@@ -1874,7 +1872,7 @@ private static uint DivideRoundUp(int value, int divisor)
18741872

18751873
[MethodImpl(MethodImplOptions.AggressiveInlining)]
18761874
private static uint FloatToUInt32Bits(float value)
1877-
=> unchecked((uint)System.BitConverter.SingleToInt32Bits(value));
1875+
=> unchecked((uint)BitConverter.SingleToInt32Bits(value));
18781876

18791877
/// <summary>
18801878
/// Finalizes one flush by submitting command buffers and optionally reading results back to CPU memory.
File renamed without changes.
File renamed without changes.

src/ImageSharp.Drawing/Shapes/ClipPathExtensions.cs renamed to src/ImageSharp.Drawing/ClipPathExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) Six Labors.
22
// Licensed under the Six Labors Split License.
33

4+
using SixLabors.ImageSharp.Drawing.PolygonGeometry;
45
using SixLabors.ImageSharp.Drawing.Processing;
5-
using SixLabors.ImageSharp.Drawing.Shapes.PolygonGeometry;
66

77
namespace SixLabors.ImageSharp.Drawing;
88

File renamed without changes.

src/ImageSharp.Drawing/Shapes/CubicBezierLineSegment.cs renamed to src/ImageSharp.Drawing/CubicBezierLineSegment.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Six Labors Split License.
33

44
using System.Numerics;
5+
using SixLabors.ImageSharp.Drawing.Helpers;
56

67
namespace SixLabors.ImageSharp.Drawing;
78

@@ -54,7 +55,7 @@ public CubicBezierLineSegment(PointF start, PointF controlPoint1, PointF control
5455

5556
/// <inheritdoc cref="CubicBezierLineSegment(PointF, PointF, PointF, PointF, PointF[])" />
5657
public CubicBezierLineSegment(PointF start, PointF controlPoint1, PointF controlPoint2, PointF end)
57-
: this(new[] { start, controlPoint1, controlPoint2, end })
58+
: this([start, controlPoint1, controlPoint2, end])
5859
{
5960
}
6061

@@ -119,7 +120,7 @@ private static PointF[] GetDrawingPoints(PointF[] controlPoints)
119120
drawingPoints.AddRange(bezierCurveDrawingPoints);
120121
}
121122

122-
return drawingPoints.ToArray();
123+
return [.. drawingPoints];
123124
}
124125

125126
private static List<PointF> FindDrawingPoints(int curveIndex, PointF[] controlPoints)
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)