Stefan Nikolei 3 weeks ago
committed by GitHub
parent
commit
80e996344e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      ImageSharp.sln.DotSettings
  2. 2
      src/ImageSharp/ColorProfiles/Icc/Calculators/GrayTrcCalculator.cs
  3. 29
      src/ImageSharp/Common/Helpers/TestHelpers.cs
  4. 182
      src/ImageSharp/Formats/Jpeg/JpegEncoderCore.FrameConfig.cs
  5. 2
      src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs
  6. 2
      src/ImageSharp/Processing/Processors/Transforms/Linear/AffineTransformProcessor{TPixel}.cs
  7. 2
      tests/ImageSharp.Tests/Common/EncoderExtensionsTests.cs
  8. 2
      tests/ImageSharp.Tests/Formats/Jpg/JpegMetadataTests.cs
  9. 111
      tests/ImageSharp.Tests/Formats/WebP/Vp8HistogramTests.cs
  10. 3
      tests/ImageSharp.Tests/Image/ImageTests.WrapMemory.cs
  11. 8
      tests/ImageSharp.Tests/Memory/DiscontiguousBuffers/MemoryGroupTests.cs
  12. 2
      tests/ImageSharp.Tests/Metadata/Profiles/Exif/ExifReaderTests.cs
  13. 6
      tests/ImageSharp.Tests/Metadata/Profiles/Exif/Values/ExifValuesTests.cs
  14. 2
      tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTestsTPixel.cs
  15. 2
      tests/ImageSharp.Tests/Processing/Processors/Convolution/BokehBlurTest.cs
  16. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs
  17. 4
      tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs
  18. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/ProjectiveTransformTests.cs
  19. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs
  20. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs
  21. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/SwizzleTests.cs
  22. 53
      tests/ImageSharp.Tests/TestDataIcc/Conversion/IccConversionDataMultiProcessElement.cs

2
ImageSharp.sln.DotSettings

@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=IncorrectConstantExpectedAnnotation/@EntryIndexedValue">HINT</s:String></wpf:ResourceDictionary>

2
src/ImageSharp/ColorProfiles/Icc/Calculators/GrayTrcCalculator.cs

@ -12,7 +12,7 @@ internal class GrayTrcCalculator : IVector4Calculator
private readonly TrcCalculator calculator; private readonly TrcCalculator calculator;
public GrayTrcCalculator(IccTagDataEntry grayTrc, bool toPcs) public GrayTrcCalculator(IccTagDataEntry grayTrc, bool toPcs)
=> this.calculator = new TrcCalculator(new IccTagDataEntry[] { grayTrc }, !toPcs); => this.calculator = new TrcCalculator([grayTrc], !toPcs);
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public Vector4 Calculate(Vector4 value) => this.calculator.Calculate(value); public Vector4 Calculate(Vector4 value) => this.calculator.Calculate(value);

29
src/ImageSharp/Common/Helpers/TestHelpers.cs

@ -1,29 +0,0 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
namespace SixLabors.ImageSharp.Common.Helpers;
/// <summary>
/// Internal utilities intended to be only used in tests.
/// </summary>
internal static class TestHelpers
{
/// <summary>
/// This constant is useful to verify the target framework ImageSharp has been built against.
/// Only intended to be used in tests!
/// </summary>
internal const string ImageSharpBuiltAgainst =
#if NETCOREAPP3_1
"netcoreapp3.1";
#elif NETCOREAPP2_1
"netcoreapp2.1";
#elif NETSTANDARD2_1
"netstandard2.1";
#elif NETSTANDARD2_0
"netstandard2.0";
#elif NETSTANDARD1_3
"netstandard1.3";
#else
"net472";
#endif
}

182
src/ImageSharp/Formats/Jpeg/JpegEncoderCore.FrameConfig.cs

@ -21,175 +21,159 @@ internal sealed unsafe partial class JpegEncoderCore
JpegQuantizationTableConfig defaultLuminanceQuantTable = new(0, Quantization.LuminanceTable); JpegQuantizationTableConfig defaultLuminanceQuantTable = new(0, Quantization.LuminanceTable);
JpegQuantizationTableConfig defaultChrominanceQuantTable = new(1, Quantization.ChrominanceTable); JpegQuantizationTableConfig defaultChrominanceQuantTable = new(1, Quantization.ChrominanceTable);
JpegHuffmanTableConfig[] yCbCrHuffmanConfigs = new JpegHuffmanTableConfig[] JpegHuffmanTableConfig[] yCbCrHuffmanConfigs =
{ [
defaultLuminanceHuffmanDC, defaultLuminanceHuffmanDC,
defaultLuminanceHuffmanAC, defaultLuminanceHuffmanAC,
defaultChrominanceHuffmanDC, defaultChrominanceHuffmanDC,
defaultChrominanceHuffmanAC, defaultChrominanceHuffmanAC
}; ];
JpegQuantizationTableConfig[] yCbCrQuantTableConfigs = new JpegQuantizationTableConfig[] JpegQuantizationTableConfig[] yCbCrQuantTableConfigs =
{ [
defaultLuminanceQuantTable, defaultLuminanceQuantTable,
defaultChrominanceQuantTable, defaultChrominanceQuantTable
}; ];
return
[
return new JpegFrameConfig[]
{
// YCbCr 4:4:4 // YCbCr 4:4:4
new( new JpegFrameConfig(
JpegColorSpace.YCbCr, JpegColorSpace.YCbCr,
JpegColorType.YCbCrRatio444, JpegColorType.YCbCrRatio444,
new JpegComponentConfig[] [
{ new JpegComponentConfig(id: 1, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 1, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 2, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1),
new(id: 2, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1), new JpegComponentConfig(id: 3, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1)
new(id: 3, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1), ],
},
yCbCrHuffmanConfigs, yCbCrHuffmanConfigs,
yCbCrQuantTableConfigs), yCbCrQuantTableConfigs),
// YCbCr 4:2:2 // YCbCr 4:2:2
new( new JpegFrameConfig(
JpegColorSpace.YCbCr, JpegColorSpace.YCbCr,
JpegColorType.YCbCrRatio422, JpegColorType.YCbCrRatio422,
new JpegComponentConfig[] [
{ new JpegComponentConfig(id: 1, hsf: 2, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 1, hsf: 2, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 2, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1),
new(id: 2, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1), new JpegComponentConfig(id: 3, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1)
new(id: 3, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1), ],
},
yCbCrHuffmanConfigs, yCbCrHuffmanConfigs,
yCbCrQuantTableConfigs), yCbCrQuantTableConfigs),
// YCbCr 4:2:0 // YCbCr 4:2:0
new( new JpegFrameConfig(
JpegColorSpace.YCbCr, JpegColorSpace.YCbCr,
JpegColorType.YCbCrRatio420, JpegColorType.YCbCrRatio420,
new JpegComponentConfig[] [
{ new JpegComponentConfig(id: 1, hsf: 2, vsf: 2, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 1, hsf: 2, vsf: 2, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 2, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1),
new(id: 2, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1), new JpegComponentConfig(id: 3, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1)
new(id: 3, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1), ],
},
yCbCrHuffmanConfigs, yCbCrHuffmanConfigs,
yCbCrQuantTableConfigs), yCbCrQuantTableConfigs),
// YCbCr 4:1:1 // YCbCr 4:1:1
new( new JpegFrameConfig(
JpegColorSpace.YCbCr, JpegColorSpace.YCbCr,
JpegColorType.YCbCrRatio411, JpegColorType.YCbCrRatio411,
new JpegComponentConfig[] [
{ new JpegComponentConfig(id: 1, hsf: 4, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 1, hsf: 4, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 2, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1),
new(id: 2, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1), new JpegComponentConfig(id: 3, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1)
new(id: 3, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1), ],
},
yCbCrHuffmanConfigs, yCbCrHuffmanConfigs,
yCbCrQuantTableConfigs), yCbCrQuantTableConfigs),
// YCbCr 4:1:0 // YCbCr 4:1:0
new( new JpegFrameConfig(
JpegColorSpace.YCbCr, JpegColorSpace.YCbCr,
JpegColorType.YCbCrRatio410, JpegColorType.YCbCrRatio410,
new JpegComponentConfig[] [
{ new JpegComponentConfig(id: 1, hsf: 4, vsf: 2, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 1, hsf: 4, vsf: 2, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 2, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1),
new(id: 2, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1), new JpegComponentConfig(id: 3, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1)
new(id: 3, hsf: 1, vsf: 1, quantIndex: 1, dcIndex: 1, acIndex: 1), ],
},
yCbCrHuffmanConfigs, yCbCrHuffmanConfigs,
yCbCrQuantTableConfigs), yCbCrQuantTableConfigs),
// Luminance // Luminance
new( new JpegFrameConfig(
JpegColorSpace.Grayscale, JpegColorSpace.Grayscale,
JpegColorType.Luminance, JpegColorType.Luminance,
new JpegComponentConfig[] [
{ new JpegComponentConfig(id: 0, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0)
new(id: 0, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), ],
}, [
new JpegHuffmanTableConfig[]
{
defaultLuminanceHuffmanDC, defaultLuminanceHuffmanDC,
defaultLuminanceHuffmanAC defaultLuminanceHuffmanAC
}, ],
new JpegQuantizationTableConfig[] [
{
defaultLuminanceQuantTable defaultLuminanceQuantTable
}), ]),
// Rgb // Rgb
new( new JpegFrameConfig(
JpegColorSpace.RGB, JpegColorSpace.RGB,
JpegColorType.Rgb, JpegColorType.Rgb,
new JpegComponentConfig[] [
{ new JpegComponentConfig(id: 82, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 82, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 71, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 71, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 66, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0)
new(id: 66, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), ],
}, [
new JpegHuffmanTableConfig[]
{
defaultLuminanceHuffmanDC, defaultLuminanceHuffmanDC,
defaultLuminanceHuffmanAC defaultLuminanceHuffmanAC
}, ],
new JpegQuantizationTableConfig[] [
{
defaultLuminanceQuantTable defaultLuminanceQuantTable
}) ])
{ {
AdobeColorTransformMarkerFlag = JpegConstants.Adobe.ColorTransformUnknown AdobeColorTransformMarkerFlag = JpegConstants.Adobe.ColorTransformUnknown
}, },
// Cmyk // Cmyk
new( new JpegFrameConfig(
JpegColorSpace.Cmyk, JpegColorSpace.Cmyk,
JpegColorType.Cmyk, JpegColorType.Cmyk,
new JpegComponentConfig[] [
{ new JpegComponentConfig(id: 1, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 1, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 2, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 2, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 3, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 3, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 4, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0)
new(id: 4, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), ],
}, [
new JpegHuffmanTableConfig[]
{
defaultLuminanceHuffmanDC, defaultLuminanceHuffmanDC,
defaultLuminanceHuffmanAC defaultLuminanceHuffmanAC
}, ],
new JpegQuantizationTableConfig[] [
{
defaultLuminanceQuantTable defaultLuminanceQuantTable
}) ])
{ {
AdobeColorTransformMarkerFlag = JpegConstants.Adobe.ColorTransformUnknown, AdobeColorTransformMarkerFlag = JpegConstants.Adobe.ColorTransformUnknown,
}, },
// YccK // YccK
new( new JpegFrameConfig(
JpegColorSpace.Ycck, JpegColorSpace.Ycck,
JpegColorType.Ycck, JpegColorType.Ycck,
new JpegComponentConfig[] [
{ new JpegComponentConfig(id: 1, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 1, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 2, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 2, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 3, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0),
new(id: 3, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), new JpegComponentConfig(id: 4, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0)
new(id: 4, hsf: 1, vsf: 1, quantIndex: 0, dcIndex: 0, acIndex: 0), ],
}, [
new JpegHuffmanTableConfig[]
{
defaultLuminanceHuffmanDC, defaultLuminanceHuffmanDC,
defaultLuminanceHuffmanAC defaultLuminanceHuffmanAC
}, ],
new JpegQuantizationTableConfig[] [
{
defaultLuminanceQuantTable defaultLuminanceQuantTable
}) ])
{ {
AdobeColorTransformMarkerFlag = JpegConstants.Adobe.ColorTransformYcck, AdobeColorTransformMarkerFlag = JpegConstants.Adobe.ColorTransformYcck,
}, }
}; ];
} }
} }

2
src/ImageSharp/Metadata/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs

@ -102,7 +102,7 @@ internal sealed class IccTextDescriptionTagDataEntry : IccTagDataEntry, IEquatab
localString = new IccLocalizedString(string.Empty); localString = new IccLocalizedString(string.Empty);
} }
return new IccMultiLocalizedUnicodeTagDataEntry(new[] { localString }, textEntry.TagSignature); return new IccMultiLocalizedUnicodeTagDataEntry([localString], textEntry.TagSignature);
static CultureInfo GetCulture(uint value) static CultureInfo GetCulture(uint value)
{ {

2
src/ImageSharp/Processing/Processors/Transforms/Linear/AffineTransformProcessor{TPixel}.cs

@ -35,7 +35,7 @@ internal class AffineTransformProcessor<TPixel> : TransformProcessor<TPixel>, IR
{ {
this.destinationSize = definition.DestinationSize; this.destinationSize = definition.DestinationSize;
this.transformMatrix = definition.TransformMatrix; this.transformMatrix = definition.TransformMatrix;
this.transformMatrix4x4 = new(this.transformMatrix); this.transformMatrix4x4 = new Matrix4x4(this.transformMatrix);
this.resampler = definition.Sampler; this.resampler = definition.Sampler;
} }

2
tests/ImageSharp.Tests/Common/EncoderExtensionsTests.cs

@ -20,7 +20,7 @@ public class EncoderExtensionsTests
[Fact] [Fact]
public void GetString_Buffer_ReturnsString() public void GetString_Buffer_ReturnsString()
{ {
ReadOnlySpan<byte> buffer = new(new byte[] { 73, 109, 97, 103, 101, 83, 104, 97, 114, 112 }); ReadOnlySpan<byte> buffer = new("ImageSharp"u8.ToArray());
string result = Encoding.UTF8.GetString(buffer); string result = Encoding.UTF8.GetString(buffer);

2
tests/ImageSharp.Tests/Formats/Jpg/JpegMetadataTests.cs

@ -71,7 +71,7 @@ public class JpegMetadataTests
public void Comment_OnlyComment() public void Comment_OnlyComment()
{ {
string comment = "test comment"; string comment = "test comment";
Collection<string> expectedCollection = new() { comment }; Collection<string> expectedCollection = [comment];
JpegMetadata meta = new(); JpegMetadata meta = new();
meta.Comments.Add(JpegComData.FromString(comment)); meta.Comments.Add(JpegComData.FromString(comment));

111
tests/ImageSharp.Tests/Formats/WebP/Vp8HistogramTests.cs

@ -13,55 +13,60 @@ public class Vp8HistogramTests
{ {
get get
{ {
List<object[]> result = new(); List<object[]> result =
result.Add(new object[] [
{ [
new byte[] new byte[]
{ {
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16,
16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128,
128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
16, 16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 128,
128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 128,
16, 16, 16, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 204, 204, 204, 16, 16, 16, 19, 16, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 16, 16, 16, 16, 16, 16, 16, 16, 128, 128, 128, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 204, 204,
16, 16, 16, 16, 16, 16, 19, 16, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 16, 16, 16, 16,
204, 204, 204, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 204, 204, 204, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 204, 204, 204, 204, 204, 204, 204, 204,
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 16, 16, 16, 16, 16, 16, 16, 16, 204, 204, 204, 204, 204, 204, 204, 204, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 19, 16, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 16, 16, 19, 16, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
204, 204, 204, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 204, 204, 204, 204, 204, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 204, 204, 204,
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 16, 16, 16, 16, 16, 16, 16, 16, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 19, 16, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 204, 204, 204, 204, 204, 204, 204, 204, 204,
204, 204, 204, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 24, 16, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 16, 16, 16, 16, 16, 16, 16, 16, 16, 19, 16, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
16, 16, 16, 16, 16, 16, 16, 16, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 24, 16, 204, 204, 204, 204,
204, 204, 204 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 16, 16, 16, 16, 16, 16, 16,
}, 16, 16, 16, 16, 16, 16, 16, 16, 16, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
new byte[] 204, 204, 204, 204, 204, 204
{ },
128, 128, 128, 128, 129, 129, 129, 129, 127, 127, 127, 127, 129, 129, 129, 129, 128, 127, 127, new byte[]
127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 129, 129, {
129, 129, 127, 127, 127, 127, 129, 129, 129, 129, 129, 128, 127, 127, 128, 127, 127, 127, 127, 128, 128, 128, 128, 129, 129, 129, 129, 127, 127, 127, 127, 129, 129, 129, 129, 128,
127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 129, 129, 129, 129, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128,
129, 129, 129, 129, 129, 129, 128, 127, 129, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 129, 129, 129, 129, 127, 127, 127, 127, 129, 129, 129, 129, 129, 128, 127,
127, 128, 128, 128, 128, 129, 129, 129, 129, 127, 127, 127, 127, 129, 129, 129, 129, 129, 129, 127, 128, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128,
129, 128, 129, 128, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 127, 127, 129, 129, 129, 129, 129, 127, 127, 127, 127, 129, 129, 129, 129, 129, 129, 128, 127, 129,
129, 129, 129, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 129, 129,
204, 204, 204, 204, 204, 204, 204, 204, 129, 129, 128, 128, 129, 129, 129, 129, 204, 204, 204, 129, 129, 127, 127, 127, 127, 129, 129, 129, 129, 129, 129, 129, 128, 129, 128, 127,
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 127, 127, 129, 129, 129, 129,
204, 204, 129, 129, 129, 129, 129, 129, 129, 129, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 129, 129, 129, 129, 204, 204, 204, 204, 204, 204, 204, 129, 129, 128, 128, 129, 129, 129, 129, 204, 204,
129, 129, 129, 129, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
204, 204, 204, 204, 204, 204, 204, 204, 204 204, 204, 204, 204, 204, 129, 129, 129, 129, 129, 129, 129, 129, 204, 204, 204, 204,
} 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
}); 204, 204, 204, 129, 129, 129, 129, 129, 129, 129, 129, 204, 204, 204, 204, 204, 204,
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204
}
]
];
return result; return result;
} }
} }
@ -72,7 +77,7 @@ public class Vp8HistogramTests
Vp8Histogram histogram = new(); Vp8Histogram histogram = new();
byte[] reference = byte[] reference =
{ [
154, 154, 151, 151, 149, 148, 151, 157, 163, 163, 154, 132, 102, 98, 104, 108, 107, 104, 104, 103, 154, 154, 151, 151, 149, 148, 151, 157, 163, 163, 154, 132, 102, 98, 104, 108, 107, 104, 104, 103,
101, 106, 123, 119, 170, 171, 172, 171, 168, 175, 171, 173, 151, 151, 149, 150, 147, 147, 146, 159, 101, 106, 123, 119, 170, 171, 172, 171, 168, 175, 171, 173, 151, 151, 149, 150, 147, 147, 146, 159,
164, 165, 154, 129, 92, 90, 101, 105, 104, 103, 104, 101, 100, 105, 123, 117, 172, 172, 172, 168, 164, 165, 154, 129, 92, 90, 101, 105, 104, 103, 104, 101, 100, 105, 123, 117, 172, 172, 172, 168,
@ -99,9 +104,9 @@ public class Vp8HistogramTests
95, 102, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 151, 130, 95, 102, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 151, 130,
82, 82, 89, 134, 154, 161, 161, 157, 152, 129, 81, 77, 95, 102, 204, 204, 204, 204, 204, 204, 204, 82, 82, 89, 134, 154, 161, 161, 157, 152, 129, 81, 77, 95, 102, 204, 204, 204, 204, 204, 204, 204,
204, 204, 204, 204, 204, 204, 204, 204, 204 204, 204, 204, 204, 204, 204, 204, 204, 204
}; ];
byte[] pred = byte[] pred =
{ [
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129,
@ -154,7 +159,7 @@ public class Vp8HistogramTests
129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 127, 127, 127, 127, 127, 127, 127, 127, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 127, 127, 127, 127, 127, 127, 127, 127,
127, 127, 127, 127, 127, 127, 127, 127, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 127, 127, 127, 127, 127, 127, 127, 127, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129,
129, 129, 129, 129 129, 129, 129, 129
}; ];
int expectedAlpha = 146; int expectedAlpha = 146;
// act // act

3
tests/ImageSharp.Tests/Image/ImageTests.WrapMemory.cs

@ -667,7 +667,6 @@ public partial class ImageTests
} }
private static bool ShouldSkipBitmapTest => private static bool ShouldSkipBitmapTest =>
!TestEnvironment.Is64BitProcess || (TestHelpers.ImageSharpBuiltAgainst != "netcoreapp3.1" && !TestEnvironment.Is64BitProcess || true;
TestHelpers.ImageSharpBuiltAgainst != "netcoreapp2.1");
} }
} }

8
tests/ImageSharp.Tests/Memory/DiscontiguousBuffers/MemoryGroupTests.cs

@ -29,9 +29,9 @@ public partial class MemoryGroupTests : MemoryGroupTestsBase
[Fact] [Fact]
public void Wrap() public void Wrap()
{ {
int[] data0 = { 1, 2, 3, 4 }; int[] data0 = [1, 2, 3, 4];
int[] data1 = { 5, 6, 7, 8 }; int[] data1 = [5, 6, 7, 8];
int[] data2 = { 9, 10 }; int[] data2 = [9, 10];
using TestMemoryManager<int> mgr0 = new(data0); using TestMemoryManager<int> mgr0 = new(data0);
using TestMemoryManager<int> mgr1 = new(data1); using TestMemoryManager<int> mgr1 = new(data1);
@ -46,7 +46,7 @@ public partial class MemoryGroupTests : MemoryGroupTestsBase
Assert.True(group[2].Span.SequenceEqual(data2)); Assert.True(group[2].Span.SequenceEqual(data2));
int cnt = 0; int cnt = 0;
int[][] allData = { data0, data1, data2 }; int[][] allData = [data0, data1, data2];
foreach (Memory<int> memory in group) foreach (Memory<int> memory in group)
{ {
Assert.True(memory.Span.SequenceEqual(allData[cnt])); Assert.True(memory.Span.SequenceEqual(allData[cnt]));

2
tests/ImageSharp.Tests/Metadata/Profiles/Exif/ExifReaderTests.cs

@ -21,7 +21,7 @@ public class ExifReaderTests
[Fact] [Fact]
public void Read_DataIsMinimal_ReturnsEmptyCollection() public void Read_DataIsMinimal_ReturnsEmptyCollection()
{ {
ExifReader reader = new(new byte[] { 69, 120, 105, 102, 0, 0 }); ExifReader reader = new("Exif\0\0"u8.ToArray());
IList<IExifValue> result = reader.ReadValues(); IList<IExifValue> result = reader.ReadValues();

6
tests/ImageSharp.Tests/Metadata/Profiles/Exif/Values/ExifValuesTests.cs

@ -458,7 +458,7 @@ public class ExifValuesTests
[MemberData(nameof(NumberArrayTags))] [MemberData(nameof(NumberArrayTags))]
public void ExifNumberArrayTests(ExifTag tag) public void ExifNumberArrayTests(ExifTag tag)
{ {
Number[] expected = [new Number(uint.MaxValue)]; Number[] expected = [new(uint.MaxValue)];
ExifValue value = ExifValues.Create(tag); ExifValue value = ExifValues.Create(tag);
Assert.False(value.TrySetValue(expected.ToString())); Assert.False(value.TrySetValue(expected.ToString()));
@ -496,7 +496,7 @@ public class ExifValuesTests
[MemberData(nameof(RationalArrayTags))] [MemberData(nameof(RationalArrayTags))]
public void ExifRationalArrayTests(ExifTag tag) public void ExifRationalArrayTests(ExifTag tag)
{ {
Rational[] expected = [new Rational(21, 42)]; Rational[] expected = [new(21, 42)];
ExifValue value = ExifValues.Create(tag); ExifValue value = ExifValues.Create(tag);
Assert.False(value.TrySetValue(expected.ToString())); Assert.False(value.TrySetValue(expected.ToString()));
@ -554,7 +554,7 @@ public class ExifValuesTests
[MemberData(nameof(SignedRationalArrayTags))] [MemberData(nameof(SignedRationalArrayTags))]
public void ExifSignedRationalArrayTests(ExifTag tag) public void ExifSignedRationalArrayTests(ExifTag tag)
{ {
SignedRational[] expected = [new SignedRational(21, 42)]; SignedRational[] expected = [new(21, 42)];
ExifValue value = ExifValues.Create(tag); ExifValue value = ExifValues.Create(tag);
Assert.False(value.TrySetValue(expected.ToString())); Assert.False(value.TrySetValue(expected.ToString()));

2
tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTestsTPixel.cs

@ -14,7 +14,7 @@ public class PorterDuffFunctionsTestsTPixel
private static Span<T> AsSpan<T>(T value) private static Span<T> AsSpan<T>(T value)
where T : struct where T : struct
{ {
return new Span<T>(new[] { value }); return new Span<T>([value]);
} }
private static T[] CreateFilledArray<T>(T value) private static T[] CreateFilledArray<T>(T value)

2
tests/ImageSharp.Tests/Processing/Processors/Convolution/BokehBlurTest.cs

@ -47,7 +47,7 @@ public class BokehBlurTest
public void VerifyComplexComponents() public void VerifyComplexComponents()
{ {
// Get the saved components // Get the saved components
List<Complex64[]> components = new(); List<Complex64[]> components = [];
foreach (Match match in Regex.Matches(Components10x2, @"\[\[(.*?)\]\]", RegexOptions.Singleline)) foreach (Match match in Regex.Matches(Components10x2, @"\[\[(.*?)\]\]", RegexOptions.Singleline))
{ {
string[] values = match.Groups[1].Value.Trim().Split([' '], StringSplitOptions.RemoveEmptyEntries); string[] values = match.Groups[1].Value.Trim().Split([' '], StringSplitOptions.RemoveEmptyEntries);

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs

@ -35,7 +35,7 @@ public class CropTest
{ {
using Image<TPixel> image = provider.GetImage(); using Image<TPixel> image = provider.GetImage();
image.Metadata.ExifProfile = new(); image.Metadata.ExifProfile = new ExifProfile();
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]);
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 50, 50]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 50, 50]);

4
tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs

@ -50,7 +50,7 @@ public class FlipTests
{ {
using Image<TPixel> image = provider.GetImage(); using Image<TPixel> image = provider.GetImage();
image.Metadata.ExifProfile = new(); image.Metadata.ExifProfile = new ExifProfile();
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]);
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 50, 50]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 50, 50]);
@ -79,7 +79,7 @@ public class FlipTests
{ {
using Image<TPixel> image = provider.GetImage(); using Image<TPixel> image = provider.GetImage();
image.Metadata.ExifProfile = new(); image.Metadata.ExifProfile = new ExifProfile();
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]);
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 50, 50]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 50, 50]);

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/ProjectiveTransformTests.cs

@ -239,7 +239,7 @@ public class ProjectiveTransformTests
{ {
using Image<TPixel> image = provider.GetImage(); using Image<TPixel> image = provider.GetImage();
image.Metadata.ExifProfile = new(); image.Metadata.ExifProfile = new ExifProfile();
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]);
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 50, 50]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 50, 50]);

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs

@ -639,7 +639,7 @@ public class ResizeTests
{ {
using Image<TPixel> image = provider.GetImage(); using Image<TPixel> image = provider.GetImage();
image.Metadata.ExifProfile = new(); image.Metadata.ExifProfile = new ExifProfile();
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]);
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 20, 20]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 20, 20]);

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs

@ -48,7 +48,7 @@ public class RotateTests
{ {
using Image<TPixel> image = provider.GetImage(); using Image<TPixel> image = provider.GetImage();
image.Metadata.ExifProfile = new(); image.Metadata.ExifProfile = new ExifProfile();
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]);
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 50, 50]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 50, 50]);

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/SwizzleTests.cs

@ -60,7 +60,7 @@ public class SwizzleTests
{ {
using Image<TPixel> image = provider.GetImage(); using Image<TPixel> image = provider.GetImage();
image.Metadata.ExifProfile = new(); image.Metadata.ExifProfile = new ExifProfile();
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectLocation, [5, 15]);
image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 20, 20]); image.Metadata.ExifProfile.SetValue(ExifTag.SubjectArea, [5, 15, 20, 20]);

53
tests/ImageSharp.Tests/TestDataIcc/Conversion/IccConversionDataMultiProcessElement.cs

@ -9,15 +9,14 @@ public class IccConversionDataMultiProcessElement
{ {
private static readonly IccMatrixProcessElement Matrix = new( private static readonly IccMatrixProcessElement Matrix = new(
new float[,] new float[,]
{ {
{ 2, 4, 6 }, { 2, 4, 6 },
{ 3, 5, 7 }, { 3, 5, 7 },
}, },
new float[] { 3, 4, 5 }); [3, 4, 5]);
private static readonly IccClut Clut = new( private static readonly IccClut Clut = new(
new[] [
{
0.2f, 0.3f, 0.2f, 0.3f,
0.4f, 0.2f, 0.4f, 0.2f,
@ -28,9 +27,9 @@ public class IccConversionDataMultiProcessElement
0.42f, 0.52f, 0.42f, 0.52f,
0.23f, 0.33f, 0.23f, 0.33f,
0.43f, 0.53f, 0.43f, 0.53f
}, ],
new byte[] { 2, 2, 2 }, [2, 2, 2],
IccClutDataType.Float, IccClutDataType.Float,
outputChannelCount: 2); outputChannelCount: 2);
@ -42,39 +41,39 @@ public class IccConversionDataMultiProcessElement
private static readonly IccCurveSetProcessElement CurveSet1DFormula2 = Create1DSingleCurveSet(FormulaCurveElement2); private static readonly IccCurveSetProcessElement CurveSet1DFormula2 = Create1DSingleCurveSet(FormulaCurveElement2);
private static readonly IccCurveSetProcessElement CurveSet1DFormula3 = Create1DSingleCurveSet(FormulaCurveElement3); private static readonly IccCurveSetProcessElement CurveSet1DFormula3 = Create1DSingleCurveSet(FormulaCurveElement3);
private static readonly IccCurveSetProcessElement CurveSet1DFormula1And2 = Create1DMultiCurveSet(new[] { 0.5f }, FormulaCurveElement1, FormulaCurveElement2); private static readonly IccCurveSetProcessElement CurveSet1DFormula1And2 = Create1DMultiCurveSet([0.5f], FormulaCurveElement1, FormulaCurveElement2);
private static readonly IccClutProcessElement ClutElement = new(Clut); private static readonly IccClutProcessElement ClutElement = new(Clut);
private static IccCurveSetProcessElement Create1DSingleCurveSet(IccCurveSegment segment) private static IccCurveSetProcessElement Create1DSingleCurveSet(IccCurveSegment segment)
{ {
IccOneDimensionalCurve curve = new(new float[0], new[] { segment }); IccOneDimensionalCurve curve = new([], [segment]);
return new IccCurveSetProcessElement(new[] { curve }); return new IccCurveSetProcessElement([curve]);
} }
private static IccCurveSetProcessElement Create1DMultiCurveSet(float[] breakPoints, params IccCurveSegment[] segments) private static IccCurveSetProcessElement Create1DMultiCurveSet(float[] breakPoints, params IccCurveSegment[] segments)
{ {
IccOneDimensionalCurve curve = new(breakPoints, segments); IccOneDimensionalCurve curve = new(breakPoints, segments);
return new IccCurveSetProcessElement(new[] { curve }); return new IccCurveSetProcessElement([curve]);
} }
public static object[][] MpeCurveConversionTestData = public static object[][] MpeCurveConversionTestData =
{ [
new object[] { CurveSet1DFormula1, new[] { 0.51f }, new[] { 0.575982451f } }, [CurveSet1DFormula1, new[] { 0.51f }, new[] { 0.575982451f }],
new object[] { CurveSet1DFormula2, new[] { 0.52f }, new[] { -0.4684991f } }, [CurveSet1DFormula2, new[] { 0.52f }, new[] { -0.4684991f }],
new object[] { CurveSet1DFormula3, new[] { 0.53f }, new[] { 0.86126f } }, [CurveSet1DFormula3, new[] { 0.53f }, new[] { 0.86126f }],
new object[] { CurveSet1DFormula1And2, new[] { 0.31f }, new[] { 0.445982f } }, [CurveSet1DFormula1And2, new[] { 0.31f }, new[] { 0.445982f }],
new object[] { CurveSet1DFormula1And2, new[] { 0.61f }, new[] { -0.341274023f } }, [CurveSet1DFormula1And2, new[] { 0.61f }, new[] { -0.341274023f }]
}; ];
public static object[][] MpeMatrixConversionTestData = public static object[][] MpeMatrixConversionTestData =
{ [
new object[] { Matrix, new float[] { 2, 4 }, new float[] { 19, 32, 45 } } [Matrix, new float[] { 2, 4 }, new float[] { 19, 32, 45 }]
}; ];
public static object[][] MpeClutConversionTestData = public static object[][] MpeClutConversionTestData =
{ [
new object[] { ClutElement, new[] { 0.5f, 0.5f, 0.5f }, new[] { 0.5f, 0.5f } } [ClutElement, new[] { 0.5f, 0.5f, 0.5f }, new[] { 0.5f, 0.5f }]
}; ];
} }

Loading…
Cancel
Save