Skip to content

Commit df50613

Browse files
Merge branch 'main' into js/fix-sse3-paeth
2 parents 9672d48 + 3fd0d70 commit df50613

File tree

98 files changed

+185
-776
lines changed

Some content is hidden

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

98 files changed

+185
-776
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,6 @@
133133
*.pnm filter=lfs diff=lfs merge=lfs -text
134134
*.wbmp filter=lfs diff=lfs merge=lfs -text
135135
*.exr filter=lfs diff=lfs merge=lfs -text
136+
*.ico filter=lfs diff=lfs merge=lfs -text
137+
*.cur filter=lfs diff=lfs merge=lfs -text
138+
*.ani filter=lfs diff=lfs merge=lfs -text

.github/workflows/build-and-test.yml

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,23 @@ jobs:
1919
- ${{ contains(github.event.pull_request.labels.*.name, 'arch:arm32') || contains(github.event.pull_request.labels.*.name, 'arch:arm64') }}
2020
options:
2121
- os: ubuntu-latest
22-
framework: net7.0
23-
sdk: 7.0.x
24-
sdk-preview: true
22+
framework: net8.0
23+
sdk: 8.0.x
2524
runtime: -x64
2625
codecov: false
2726
- os: macos-latest
28-
framework: net7.0
29-
sdk: 7.0.x
30-
sdk-preview: true
27+
framework: net8.0
28+
sdk: 8.0.x
3129
runtime: -x64
3230
codecov: false
3331
- os: windows-latest
34-
framework: net7.0
35-
sdk: 7.0.x
36-
sdk-preview: true
32+
framework: net8.0
33+
sdk: 8.0.x
3734
runtime: -x64
3835
codecov: false
3936
- os: buildjet-4vcpu-ubuntu-2204-arm
40-
framework: net7.0
41-
sdk: 7.0.x
42-
sdk-preview: true
43-
runtime: -x64
44-
codecov: false
45-
- os: ubuntu-latest
46-
framework: net6.0
47-
sdk: 6.0.x
48-
runtime: -x64
49-
codecov: false
50-
- os: macos-latest
51-
framework: net6.0
52-
sdk: 6.0.x
53-
runtime: -x64
54-
codecov: false
55-
- os: windows-latest
56-
framework: net6.0
57-
sdk: 6.0.x
37+
framework: net8.0
38+
sdk: 8.0.x
5839
runtime: -x64
5940
codecov: false
6041
exclude:
@@ -108,17 +89,17 @@ jobs:
10889

10990
- name: DotNet Setup
11091
if: ${{ matrix.options.sdk-preview != true }}
111-
uses: actions/setup-dotnet@v3
92+
uses: actions/setup-dotnet@v4
11293
with:
11394
dotnet-version: |
114-
6.0.x
95+
8.0.x
11596
11697
- name: DotNet Setup Preview
11798
if: ${{ matrix.options.sdk-preview == true }}
118-
uses: actions/setup-dotnet@v3
99+
uses: actions/setup-dotnet@v4
119100
with:
120101
dotnet-version: |
121-
7.0.x
102+
8.0.x
122103
123104
- name: DotNet Build
124105
if: ${{ matrix.options.sdk-preview != true }}

.github/workflows/code-coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
options:
1212
- os: ubuntu-latest
13-
framework: net6.0
13+
framework: net8.0
1414
runtime: -x64
1515
codecov: true
1616

@@ -55,10 +55,10 @@ jobs:
5555
restore-keys: ${{ runner.os }}-nuget-
5656

5757
- name: DotNet Setup
58-
uses: actions/setup-dotnet@v3
58+
uses: actions/setup-dotnet@v4
5959
with:
6060
dotnet-version: |
61-
6.0.x
61+
8.0.x
6262
6363
- name: DotNet Build
6464
shell: pwsh

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Designed to simplify image processing, ImageSharp brings you an incredibly power
2121

2222
ImageSharp is designed from the ground up to be flexible and extensible. The library provides API endpoints for common image processing operations and the building blocks to allow for the development of additional operations.
2323

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

2626

2727
## License
@@ -64,7 +64,7 @@ If you prefer, you can compile ImageSharp yourself (please do and help!)
6464

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

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

src/ImageSharp.ruleset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
55
<Rule Id="SA1011" Action="None" />
66
</Rules>
7-
</RuleSet>
7+
</RuleSet>

src/ImageSharp/Advanced/ParallelRowIterator.Wrappers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void Invoke(int i)
5151
for (int y = yMin; y < yMax; y++)
5252
{
5353
// Skip the safety copy when invoking a potentially impure method on a readonly field
54-
Unsafe.AsRef(this.action).Invoke(y);
54+
Unsafe.AsRef(in this.action).Invoke(y);
5555
}
5656
}
5757
}
@@ -102,7 +102,7 @@ public void Invoke(int i)
102102

103103
for (int y = yMin; y < yMax; y++)
104104
{
105-
Unsafe.AsRef(this.action).Invoke(y, span);
105+
Unsafe.AsRef(in this.action).Invoke(y, span);
106106
}
107107
}
108108
}

src/ImageSharp/Advanced/ParallelRowIterator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static void IterateRows<T>(
5858
{
5959
for (int y = top; y < bottom; y++)
6060
{
61-
Unsafe.AsRef(operation).Invoke(y);
61+
Unsafe.AsRef(in operation).Invoke(y);
6262
}
6363

6464
return;
@@ -118,7 +118,7 @@ public static void IterateRows<T, TBuffer>(
118118
int maxSteps = DivideCeil(width * (long)height, parallelSettings.MinimumPixelsProcessedPerTask);
119119
int numOfSteps = Math.Min(parallelSettings.MaxDegreeOfParallelism, maxSteps);
120120
MemoryAllocator allocator = parallelSettings.MemoryAllocator;
121-
int bufferLength = Unsafe.AsRef(operation).GetRequiredBufferLength(rectangle);
121+
int bufferLength = Unsafe.AsRef(in operation).GetRequiredBufferLength(rectangle);
122122

123123
// Avoid TPL overhead in this trivial case:
124124
if (numOfSteps == 1)
@@ -128,7 +128,7 @@ public static void IterateRows<T, TBuffer>(
128128

129129
for (int y = top; y < bottom; y++)
130130
{
131-
Unsafe.AsRef(operation).Invoke(y, span);
131+
Unsafe.AsRef(in operation).Invoke(y, span);
132132
}
133133

134134
return;
@@ -245,15 +245,15 @@ public static void IterateRowIntervals<T, TBuffer>(
245245
int maxSteps = DivideCeil(width * (long)height, parallelSettings.MinimumPixelsProcessedPerTask);
246246
int numOfSteps = Math.Min(parallelSettings.MaxDegreeOfParallelism, maxSteps);
247247
MemoryAllocator allocator = parallelSettings.MemoryAllocator;
248-
int bufferLength = Unsafe.AsRef(operation).GetRequiredBufferLength(rectangle);
248+
int bufferLength = Unsafe.AsRef(in operation).GetRequiredBufferLength(rectangle);
249249

250250
// Avoid TPL overhead in this trivial case:
251251
if (numOfSteps == 1)
252252
{
253253
var rows = new RowInterval(top, bottom);
254254
using IMemoryOwner<TBuffer> buffer = allocator.Allocate<TBuffer>(bufferLength);
255255

256-
Unsafe.AsRef(operation).Invoke(in rows, buffer.Memory.Span);
256+
Unsafe.AsRef(in operation).Invoke(in rows, buffer.Memory.Span);
257257

258258
return;
259259
}

src/ImageSharp/Common/Helpers/DebugGuard.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ public static void IsTrue(bool target, string message)
3333
[Conditional("DEBUG")]
3434
public static void NotDisposed(bool isDisposed, string objectName)
3535
{
36+
#pragma warning disable CA1513
3637
if (isDisposed)
3738
{
3839
throw new ObjectDisposedException(objectName);
3940
}
41+
#pragma warning restore CA1513
4042
}
4143

4244
/// <summary>

src/ImageSharp/Common/Helpers/Numerics.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -908,25 +908,6 @@ public static int ReduceSum(Vector256<int> accumulator)
908908
return Sse2.ConvertToInt32(vsum);
909909
}
910910

911-
/// <summary>
912-
/// Reduces elements of the vector into one sum.
913-
/// </summary>
914-
/// <param name="accumulator">The accumulator to reduce.</param>
915-
/// <returns>The sum of all elements.</returns>
916-
[MethodImpl(InliningOptions.ShortMethod)]
917-
public static int ReduceSumArm(Vector128<uint> accumulator)
918-
{
919-
if (AdvSimd.Arm64.IsSupported)
920-
{
921-
Vector64<uint> sum = AdvSimd.Arm64.AddAcross(accumulator);
922-
return (int)AdvSimd.Extract(sum, 0);
923-
}
924-
925-
Vector128<ulong> sum2 = AdvSimd.AddPairwiseWidening(accumulator);
926-
Vector64<uint> sum3 = AdvSimd.Add(sum2.GetLower().AsUInt32(), sum2.GetUpper().AsUInt32());
927-
return (int)AdvSimd.Extract(sum3, 0);
928-
}
929-
930911
/// <summary>
931912
/// Reduces even elements of the vector into one sum.
932913
/// </summary>

0 commit comments

Comments
 (0)