Skip to content

Commit 43bf27a

Browse files
Merge branch 'SixLabors:main' into main
2 parents 60d8763 + 7d0bbbd commit 43bf27a

File tree

245 files changed

+3871
-2792
lines changed

Some content is hidden

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

245 files changed

+3871
-2792
lines changed

.github/CONTRIBUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@
2929
#### **Running tests and Debugging**
3030

3131
* Expected test output is pulled in as a submodule from the [ImageSharp.Tests.Images repository](https://github.com/SixLabors/Imagesharp.Tests.Images/tree/main/ReferenceOutput). To succesfully run tests, make sure that you have updated the submodules!
32-
* Debugging (running tests in Debug mode) is only supported on .NET Core 2.1+, because of JIT Code Generation bugs like [dotnet/coreclr#16443](https://github.com/dotnet/coreclr/issues/16443) or [dotnet/coreclr#20657](https://github.com/dotnet/coreclr/issues/20657)
3332

3433
#### **Do you have questions about consuming the library or the source code?**
3534

3635
* Ask any question about how to use SixLabors.ImageSharp in the [Help Discussions Channel](https://github.com/SixLabors/ImageSharp/discussions?discussions_q=category%3AHelp).
3736

3837
#### Code of Conduct
3938
This project has adopted the code of conduct defined by the [Contributor Covenant](https://contributor-covenant.org/) to clarify expected behavior in our community.
40-
For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
4139

4240
And please remember. SixLabors.ImageSharp is the work of a very, very, small number of developers who struggle balancing time to contribute to the project with family time and work commitments. We encourage you to pitch in and help make our vision of simple accessible image processing available to all. Open Source can only exist with your help.
4341

.github/ISSUE_TEMPLATE/commercial-bug-report.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/oss-bug-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: "OSS : Bug Report"
2-
description: Create a report to help us improve the project. OSS Issues are not guaranteed to be triaged.
1+
name: "Bug Report"
2+
description: Create a report to help us improve the project. Issues are not guaranteed to be triaged.
33
labels: ["needs triage"]
44
body:
55
- type: checkboxes

ImageSharp.sln

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1799
2828
EndProject
2929
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{FBE8C1AD-5AEC-4514-9B64-091D8E145865}"
3030
ProjectSection(SolutionItems) = preProject
31-
.github\ISSUE_TEMPLATE\commercial-bug-report.yml = .github\ISSUE_TEMPLATE\commercial-bug-report.yml
3231
.github\ISSUE_TEMPLATE\config.yml = .github\ISSUE_TEMPLATE\config.yml
3332
.github\ISSUE_TEMPLATE\oss-bug-report.yml = .github\ISSUE_TEMPLATE\oss-bug-report.yml
3433
EndProjectSection

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ git submodule update --init --recursive
101101

102102
Please... Spread the word, contribute algorithms, submit performance improvements, unit tests, no input is too little. Make sure to read our [Contribution Guide](https://github.com/SixLabors/ImageSharp/blob/main/.github/CONTRIBUTING.md) before opening a PR.
103103

104+
Useful tools for development and links to specifications can be found in our wikipage: [Useful-tools-and-links](https://github.com/SixLabors/ImageSharp/wiki/Useful-tools-and-links).
105+
104106
## The ImageSharp Team
105107

106108
- [James Jackson-South](https://github.com/jimbobsquarepants)
@@ -109,6 +111,11 @@ Please... Spread the word, contribute algorithms, submit performance improvement
109111
- [Scott Williams](https://github.com/tocsoft)
110112
- [Brian Popow](https://github.com/brianpopow)
111113

114+
---
112115

116+
<div>
117+
<a href="https://www.jetbrains.com/?from=ImageSharp" align="right"><img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" alt="JetBrains" class="logo-footer" width="72" align="left"></a>
118+
<br/>
113119

114-
120+
Special thanks to [JetBrains](https://www.jetbrains.com/?from=ImageSharp) for supporting us with open-source licenses for their IDEs.
121+
</div>

src/ImageSharp/ColorSpaces/Companding/SRgbCompanding.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,15 @@ public static float Compress(float channel)
167167
[MethodImpl(MethodImplOptions.AggressiveInlining)]
168168
private static unsafe void CompandAvx2(Span<Vector4> vectors, float[] table)
169169
{
170-
fixed (float* tablePointer = &table[0])
170+
fixed (float* tablePointer = &MemoryMarshal.GetArrayDataReference(table))
171171
{
172172
var scale = Vector256.Create((float)Scale);
173173
Vector256<float> zero = Vector256<float>.Zero;
174174
var offset = Vector256.Create(1);
175175

176176
// Divide by 2 as 4 elements per Vector4 and 8 per Vector256<float>
177177
ref Vector256<float> vectorsBase = ref Unsafe.As<Vector4, Vector256<float>>(ref MemoryMarshal.GetReference(vectors));
178-
ref Vector256<float> vectorsLast = ref Unsafe.Add(ref vectorsBase, (IntPtr)((uint)vectors.Length / 2u));
178+
ref Vector256<float> vectorsLast = ref Unsafe.Add(ref vectorsBase, (uint)vectors.Length / 2u);
179179

180180
while (Unsafe.IsAddressLessThan(ref vectorsBase, ref vectorsLast))
181181
{
@@ -199,12 +199,12 @@ private static unsafe void CompandAvx2(Span<Vector4> vectors, float[] table)
199199
[MethodImpl(MethodImplOptions.AggressiveInlining)]
200200
private static unsafe void CompandScalar(Span<Vector4> vectors, float[] table)
201201
{
202-
fixed (float* tablePointer = &table[0])
202+
fixed (float* tablePointer = &MemoryMarshal.GetArrayDataReference(table))
203203
{
204204
Vector4 zero = Vector4.Zero;
205205
var scale = new Vector4(Scale);
206206
ref Vector4 vectorsBase = ref MemoryMarshal.GetReference(vectors);
207-
ref Vector4 vectorsLast = ref Unsafe.Add(ref vectorsBase, vectors.Length);
207+
ref Vector4 vectorsLast = ref Unsafe.Add(ref vectorsBase, (uint)vectors.Length);
208208

209209
while (Unsafe.IsAddressLessThan(ref vectorsBase, ref vectorsLast))
210210
{

src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void Convert(ReadOnlySpan<CieLch> source, Span<CieLab> destination)
3737
ref CieLch sourceRef = ref MemoryMarshal.GetReference(source);
3838
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
3939

40-
for (int i = 0; i < count; i++)
40+
for (nuint i = 0; i < (uint)count; i++)
4141
{
4242
ref CieLch sp = ref Unsafe.Add(ref sourceRef, i);
4343
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -70,7 +70,7 @@ public void Convert(ReadOnlySpan<CieLchuv> source, Span<CieLab> destination)
7070
ref CieLchuv sourceRef = ref MemoryMarshal.GetReference(source);
7171
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
7272

73-
for (int i = 0; i < count; i++)
73+
for (nuint i = 0; i < (uint)count; i++)
7474
{
7575
ref CieLchuv sp = ref Unsafe.Add(ref sourceRef, i);
7676
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -103,7 +103,7 @@ public void Convert(ReadOnlySpan<CieLuv> source, Span<CieLab> destination)
103103
ref CieLuv sourceRef = ref MemoryMarshal.GetReference(source);
104104
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
105105

106-
for (int i = 0; i < count; i++)
106+
for (nuint i = 0; i < (uint)count; i++)
107107
{
108108
ref CieLuv sp = ref Unsafe.Add(ref sourceRef, i);
109109
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -136,7 +136,7 @@ public void Convert(ReadOnlySpan<CieXyy> source, Span<CieLab> destination)
136136
ref CieXyy sourceRef = ref MemoryMarshal.GetReference(source);
137137
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
138138

139-
for (int i = 0; i < count; i++)
139+
for (nuint i = 0; i < (uint)count; i++)
140140
{
141141
ref CieXyy sp = ref Unsafe.Add(ref sourceRef, i);
142142
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -169,7 +169,7 @@ public void Convert(ReadOnlySpan<CieXyz> source, Span<CieLab> destination)
169169
ref CieXyz sourceRef = ref MemoryMarshal.GetReference(source);
170170
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
171171

172-
for (int i = 0; i < count; i++)
172+
for (nuint i = 0; i < (uint)count; i++)
173173
{
174174
ref CieXyz sp = ref Unsafe.Add(ref sourceRef, i);
175175
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -201,7 +201,7 @@ public void Convert(ReadOnlySpan<Cmyk> source, Span<CieLab> destination)
201201
ref Cmyk sourceRef = ref MemoryMarshal.GetReference(source);
202202
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
203203

204-
for (int i = 0; i < count; i++)
204+
for (nuint i = 0; i < (uint)count; i++)
205205
{
206206
ref Cmyk sp = ref Unsafe.Add(ref sourceRef, i);
207207
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -234,7 +234,7 @@ public void Convert(ReadOnlySpan<Hsl> source, Span<CieLab> destination)
234234
ref Hsl sourceRef = ref MemoryMarshal.GetReference(source);
235235
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
236236

237-
for (int i = 0; i < count; i++)
237+
for (nuint i = 0; i < (uint)count; i++)
238238
{
239239
ref Hsl sp = ref Unsafe.Add(ref sourceRef, i);
240240
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -266,7 +266,7 @@ public void Convert(ReadOnlySpan<Hsv> source, Span<CieLab> destination)
266266
ref Hsv sourceRef = ref MemoryMarshal.GetReference(source);
267267
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
268268

269-
for (int i = 0; i < count; i++)
269+
for (nuint i = 0; i < (uint)count; i++)
270270
{
271271
ref Hsv sp = ref Unsafe.Add(ref sourceRef, i);
272272
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -299,7 +299,7 @@ public void Convert(ReadOnlySpan<HunterLab> source, Span<CieLab> destination)
299299
ref HunterLab sourceRef = ref MemoryMarshal.GetReference(source);
300300
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
301301

302-
for (int i = 0; i < count; i++)
302+
for (nuint i = 0; i < (uint)count; i++)
303303
{
304304
ref HunterLab sp = ref Unsafe.Add(ref sourceRef, i);
305305
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -332,7 +332,7 @@ public void Convert(ReadOnlySpan<Lms> source, Span<CieLab> destination)
332332
ref Lms sourceRef = ref MemoryMarshal.GetReference(source);
333333
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
334334

335-
for (int i = 0; i < count; i++)
335+
for (nuint i = 0; i < (uint)count; i++)
336336
{
337337
ref Lms sp = ref Unsafe.Add(ref sourceRef, i);
338338
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -365,7 +365,7 @@ public void Convert(ReadOnlySpan<LinearRgb> source, Span<CieLab> destination)
365365
ref LinearRgb sourceRef = ref MemoryMarshal.GetReference(source);
366366
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
367367

368-
for (int i = 0; i < count; i++)
368+
for (nuint i = 0; i < (uint)count; i++)
369369
{
370370
ref LinearRgb sp = ref Unsafe.Add(ref sourceRef, i);
371371
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -398,7 +398,7 @@ public void Convert(ReadOnlySpan<Rgb> source, Span<CieLab> destination)
398398
ref Rgb sourceRef = ref MemoryMarshal.GetReference(source);
399399
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
400400

401-
for (int i = 0; i < count; i++)
401+
for (nuint i = 0; i < (uint)count; i++)
402402
{
403403
ref Rgb sp = ref Unsafe.Add(ref sourceRef, i);
404404
ref CieLab dp = ref Unsafe.Add(ref destRef, i);
@@ -431,7 +431,7 @@ public void Convert(ReadOnlySpan<YCbCr> source, Span<CieLab> destination)
431431
ref YCbCr sourceRef = ref MemoryMarshal.GetReference(source);
432432
ref CieLab destRef = ref MemoryMarshal.GetReference(destination);
433433

434-
for (int i = 0; i < count; i++)
434+
for (nuint i = 0; i < (uint)count; i++)
435435
{
436436
ref YCbCr sp = ref Unsafe.Add(ref sourceRef, i);
437437
ref CieLab dp = ref Unsafe.Add(ref destRef, i);

src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void Convert(ReadOnlySpan<CieLab> source, Span<CieLch> destination)
3636
ref CieLab sourceRef = ref MemoryMarshal.GetReference(source);
3737
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
3838

39-
for (int i = 0; i < count; i++)
39+
for (nuint i = 0; i < (uint)count; i++)
4040
{
4141
ref CieLab sp = ref Unsafe.Add(ref sourceRef, i);
4242
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -69,7 +69,7 @@ public void Convert(ReadOnlySpan<CieLchuv> source, Span<CieLch> destination)
6969
ref CieLchuv sourceRef = ref MemoryMarshal.GetReference(source);
7070
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
7171

72-
for (int i = 0; i < count; i++)
72+
for (nuint i = 0; i < (uint)count; i++)
7373
{
7474
ref CieLchuv sp = ref Unsafe.Add(ref sourceRef, i);
7575
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -102,7 +102,7 @@ public void Convert(ReadOnlySpan<CieLuv> source, Span<CieLch> destination)
102102
ref CieLuv sourceRef = ref MemoryMarshal.GetReference(source);
103103
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
104104

105-
for (int i = 0; i < count; i++)
105+
for (nuint i = 0; i < (uint)count; i++)
106106
{
107107
ref CieLuv sp = ref Unsafe.Add(ref sourceRef, i);
108108
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -135,7 +135,7 @@ public void Convert(ReadOnlySpan<CieXyy> source, Span<CieLch> destination)
135135
ref CieXyy sourceRef = ref MemoryMarshal.GetReference(source);
136136
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
137137

138-
for (int i = 0; i < count; i++)
138+
for (nuint i = 0; i < (uint)count; i++)
139139
{
140140
ref CieXyy sp = ref Unsafe.Add(ref sourceRef, i);
141141
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -168,7 +168,7 @@ public void Convert(ReadOnlySpan<CieXyz> source, Span<CieLch> destination)
168168
ref CieXyz sourceRef = ref MemoryMarshal.GetReference(source);
169169
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
170170

171-
for (int i = 0; i < count; i++)
171+
for (nuint i = 0; i < (uint)count; i++)
172172
{
173173
ref CieXyz sp = ref Unsafe.Add(ref sourceRef, i);
174174
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -200,7 +200,7 @@ public void Convert(ReadOnlySpan<Cmyk> source, Span<CieLch> destination)
200200
ref Cmyk sourceRef = ref MemoryMarshal.GetReference(source);
201201
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
202202

203-
for (int i = 0; i < count; i++)
203+
for (nuint i = 0; i < (uint)count; i++)
204204
{
205205
ref Cmyk sp = ref Unsafe.Add(ref sourceRef, i);
206206
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -233,7 +233,7 @@ public void Convert(ReadOnlySpan<Hsl> source, Span<CieLch> destination)
233233
ref Hsl sourceRef = ref MemoryMarshal.GetReference(source);
234234
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
235235

236-
for (int i = 0; i < count; i++)
236+
for (nuint i = 0; i < (uint)count; i++)
237237
{
238238
ref Hsl sp = ref Unsafe.Add(ref sourceRef, i);
239239
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -266,7 +266,7 @@ public void Convert(ReadOnlySpan<Hsv> source, Span<CieLch> destination)
266266
ref Hsv sourceRef = ref MemoryMarshal.GetReference(source);
267267
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
268268

269-
for (int i = 0; i < count; i++)
269+
for (nuint i = 0; i < (uint)count; i++)
270270
{
271271
ref Hsv sp = ref Unsafe.Add(ref sourceRef, i);
272272
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -299,7 +299,7 @@ public void Convert(ReadOnlySpan<HunterLab> source, Span<CieLch> destination)
299299
ref HunterLab sourceRef = ref MemoryMarshal.GetReference(source);
300300
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
301301

302-
for (int i = 0; i < count; i++)
302+
for (nuint i = 0; i < (uint)count; i++)
303303
{
304304
ref HunterLab sp = ref Unsafe.Add(ref sourceRef, i);
305305
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -332,7 +332,7 @@ public void Convert(ReadOnlySpan<LinearRgb> source, Span<CieLch> destination)
332332
ref LinearRgb sourceRef = ref MemoryMarshal.GetReference(source);
333333
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
334334

335-
for (int i = 0; i < count; i++)
335+
for (nuint i = 0; i < (uint)count; i++)
336336
{
337337
ref LinearRgb sp = ref Unsafe.Add(ref sourceRef, i);
338338
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -365,7 +365,7 @@ public void Convert(ReadOnlySpan<Lms> source, Span<CieLch> destination)
365365
ref Lms sourceRef = ref MemoryMarshal.GetReference(source);
366366
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
367367

368-
for (int i = 0; i < count; i++)
368+
for (nuint i = 0; i < (uint)count; i++)
369369
{
370370
ref Lms sp = ref Unsafe.Add(ref sourceRef, i);
371371
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -398,7 +398,7 @@ public void Convert(ReadOnlySpan<Rgb> source, Span<CieLch> destination)
398398
ref Rgb sourceRef = ref MemoryMarshal.GetReference(source);
399399
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
400400

401-
for (int i = 0; i < count; i++)
401+
for (nuint i = 0; i < (uint)count; i++)
402402
{
403403
ref Rgb sp = ref Unsafe.Add(ref sourceRef, i);
404404
ref CieLch dp = ref Unsafe.Add(ref destRef, i);
@@ -431,7 +431,7 @@ public void Convert(ReadOnlySpan<YCbCr> source, Span<CieLch> destination)
431431
ref YCbCr sourceRef = ref MemoryMarshal.GetReference(source);
432432
ref CieLch destRef = ref MemoryMarshal.GetReference(destination);
433433

434-
for (int i = 0; i < count; i++)
434+
for (nuint i = 0; i < (uint)count; i++)
435435
{
436436
ref YCbCr sp = ref Unsafe.Add(ref sourceRef, i);
437437
ref CieLch dp = ref Unsafe.Add(ref destRef, i);

0 commit comments

Comments
 (0)