Browse Source

Correct SIMD helper accessibility

pull/3161/head
James Jackson-South 3 weeks ago
parent
commit
71d27f4b85
  1. 4
      src/ImageSharp/Common/Helpers/Shuffle/IComponentShuffle.cs
  2. 4
      src/ImageSharp/Common/Helpers/Shuffle/IShuffle4.cs
  3. 22
      src/ImageSharp/Formats/Jpeg/Components/ColorConverters/JpegColorConverter.Operator.cs
  4. 16
      src/ImageSharp/Formats/Png/Filters/IPngFilterOperator.cs
  5. 6
      src/ImageSharp/PixelFormats/PixelBlenders/IPixelBlenderOperator.cs
  6. 4
      src/ImageSharp/PixelFormats/Utils/Vector4Converters.Affine.cs
  7. 8
      src/ImageSharp/PixelFormats/Utils/Vector4Converters.AffineOperators.cs

4
src/ImageSharp/Common/Helpers/Shuffle/IComponentShuffle.cs

@ -15,12 +15,12 @@ internal interface IComponentShuffle
/// </summary>
/// <param name="source">The source components, with the first component in the least-significant byte.</param>
/// <returns>The reordered packed components.</returns>
static abstract uint Invoke(uint source);
public static abstract uint Invoke(uint source);
/// <summary>
/// Reorders the packed pixels in a 128-bit vector.
/// </summary>
/// <param name="source">The source pixels.</param>
/// <returns>The reordered pixels.</returns>
static abstract Vector128<byte> Invoke(Vector128<byte> source);
public static abstract Vector128<byte> Invoke(Vector128<byte> source);
}

4
src/ImageSharp/Common/Helpers/Shuffle/IShuffle4.cs

@ -19,14 +19,14 @@ internal interface IShuffle4 : IComponentShuffle
/// </summary>
/// <param name="source">The source pixels.</param>
/// <returns>The reordered pixels.</returns>
static abstract Vector256<byte> Invoke(Vector256<byte> source);
public static abstract Vector256<byte> Invoke(Vector256<byte> source);
/// <summary>
/// Reorders the packed pixels in a 512-bit vector.
/// </summary>
/// <param name="source">The source pixels.</param>
/// <returns>The reordered pixels.</returns>
static abstract Vector512<byte> Invoke(Vector512<byte> source);
public static abstract Vector512<byte> Invoke(Vector512<byte> source);
}
/// <summary>

22
src/ImageSharp/Formats/Jpeg/Components/ColorConverters/JpegColorConverter.Operator.cs

@ -23,12 +23,12 @@ internal abstract partial class JpegColorConverterBase
/// <summary>
/// Gets the JPEG color space handled by the operator.
/// </summary>
static abstract JpegColorSpace ColorSpace { get; }
public static abstract JpegColorSpace ColorSpace { get; }
/// <summary>
/// Gets the number of component planes used by the color space.
/// </summary>
static abstract int ComponentCount { get; }
public static abstract int ComponentCount { get; }
/// <summary>
/// Converts one JPEG sample to normalized RGB.
@ -40,7 +40,7 @@ internal abstract partial class JpegColorConverterBase
/// <param name="maximumValue">The maximum component value for the configured precision.</param>
/// <param name="halfValue">The midpoint component value for the configured precision.</param>
/// <param name="scale">The reciprocal of <paramref name="maximumValue"/>.</param>
static abstract void ConvertToRgb(
public static abstract void ConvertToRgb(
ref float c0,
ref float c1,
ref float c2,
@ -59,7 +59,7 @@ internal abstract partial class JpegColorConverterBase
/// <param name="maximumValue">The maximum component value for the configured precision.</param>
/// <param name="halfValue">The midpoint component value for the configured precision.</param>
/// <param name="scale">The reciprocal of <paramref name="maximumValue"/> in every lane.</param>
static abstract void ConvertToRgb(
public static abstract void ConvertToRgb(
ref Vector128<float> c0,
ref Vector128<float> c1,
ref Vector128<float> c2,
@ -78,7 +78,7 @@ internal abstract partial class JpegColorConverterBase
/// <param name="maximumValue">The maximum component value for the configured precision.</param>
/// <param name="halfValue">The midpoint component value for the configured precision.</param>
/// <param name="scale">The reciprocal of <paramref name="maximumValue"/> in every lane.</param>
static abstract void ConvertToRgb(
public static abstract void ConvertToRgb(
ref Vector256<float> c0,
ref Vector256<float> c1,
ref Vector256<float> c2,
@ -97,7 +97,7 @@ internal abstract partial class JpegColorConverterBase
/// <param name="maximumValue">The maximum component value for the configured precision.</param>
/// <param name="halfValue">The midpoint component value for the configured precision.</param>
/// <param name="scale">The reciprocal of <paramref name="maximumValue"/> in every lane.</param>
static abstract void ConvertToRgb(
public static abstract void ConvertToRgb(
ref Vector512<float> c0,
ref Vector512<float> c1,
ref Vector512<float> c2,
@ -119,7 +119,7 @@ internal abstract partial class JpegColorConverterBase
/// <param name="c1">The second converted component.</param>
/// <param name="c2">The third converted component.</param>
/// <param name="c3">The fourth converted component, if used.</param>
static abstract void ConvertFromRgb(
public static abstract void ConvertFromRgb(
float r,
float g,
float b,
@ -144,7 +144,7 @@ internal abstract partial class JpegColorConverterBase
/// <param name="c1">The second converted component lanes.</param>
/// <param name="c2">The third converted component lanes.</param>
/// <param name="c3">The fourth converted component lanes, if used.</param>
static abstract void ConvertFromRgb(
public static abstract void ConvertFromRgb(
Vector128<float> r,
Vector128<float> g,
Vector128<float> b,
@ -169,7 +169,7 @@ internal abstract partial class JpegColorConverterBase
/// <param name="c1">The second converted component lanes.</param>
/// <param name="c2">The third converted component lanes.</param>
/// <param name="c3">The fourth converted component lanes, if used.</param>
static abstract void ConvertFromRgb(
public static abstract void ConvertFromRgb(
Vector256<float> r,
Vector256<float> g,
Vector256<float> b,
@ -194,7 +194,7 @@ internal abstract partial class JpegColorConverterBase
/// <param name="c1">The second converted component lanes.</param>
/// <param name="c2">The third converted component lanes.</param>
/// <param name="c3">The fourth converted component lanes, if used.</param>
static abstract void ConvertFromRgb(
public static abstract void ConvertFromRgb(
Vector512<float> r,
Vector512<float> g,
Vector512<float> b,
@ -213,7 +213,7 @@ internal abstract partial class JpegColorConverterBase
/// <param name="profile">The source ICC profile.</param>
/// <param name="values">The component values to convert.</param>
/// <param name="maximumValue">The maximum component value for the configured precision.</param>
static abstract void ConvertToRgbInPlaceWithIcc(
public static abstract void ConvertToRgbInPlaceWithIcc(
Configuration configuration,
IccProfile profile,
in ComponentValues values,

16
src/ImageSharp/Formats/Png/Filters/IPngFilterOperator.cs

@ -16,22 +16,22 @@ internal interface IPngFilterOperator
/// <summary>
/// Gets the filter type written to the leading result byte.
/// </summary>
static abstract FilterType Type { get; }
public static abstract FilterType Type { get; }
/// <summary>
/// Gets a value indicating whether the predictor reads the left component.
/// </summary>
static abstract bool UsesLeft { get; }
public static abstract bool UsesLeft { get; }
/// <summary>
/// Gets a value indicating whether the predictor reads the above component.
/// </summary>
static abstract bool UsesAbove { get; }
public static abstract bool UsesAbove { get; }
/// <summary>
/// Gets a value indicating whether the predictor reads the upper-left component.
/// </summary>
static abstract bool UsesUpperLeft { get; }
public static abstract bool UsesUpperLeft { get; }
/// <summary>
/// Filters one byte from its PNG neighborhood.
@ -41,7 +41,7 @@ internal interface IPngFilterOperator
/// <param name="above">The corresponding component in the preceding scanline.</param>
/// <param name="upperLeft">The preceding component in the preceding scanline.</param>
/// <returns>The filtered residual.</returns>
static abstract byte Invoke(byte scan, byte left, byte above, byte upperLeft);
public static abstract byte Invoke(byte scan, byte left, byte above, byte upperLeft);
/// <summary>
/// Filters sixteen byte lanes from their PNG neighborhoods.
@ -51,7 +51,7 @@ internal interface IPngFilterOperator
/// <param name="above">The corresponding components in the preceding scanline.</param>
/// <param name="upperLeft">The preceding components in the preceding scanline.</param>
/// <returns>The filtered residuals.</returns>
static abstract Vector128<byte> Invoke(
public static abstract Vector128<byte> Invoke(
Vector128<byte> scan,
Vector128<byte> left,
Vector128<byte> above,
@ -65,7 +65,7 @@ internal interface IPngFilterOperator
/// <param name="above">The corresponding components in the preceding scanline.</param>
/// <param name="upperLeft">The preceding components in the preceding scanline.</param>
/// <returns>The filtered residuals.</returns>
static abstract Vector256<byte> Invoke(
public static abstract Vector256<byte> Invoke(
Vector256<byte> scan,
Vector256<byte> left,
Vector256<byte> above,
@ -79,7 +79,7 @@ internal interface IPngFilterOperator
/// <param name="above">The corresponding components in the preceding scanline.</param>
/// <param name="upperLeft">The preceding components in the preceding scanline.</param>
/// <returns>The filtered residuals.</returns>
static abstract Vector512<byte> Invoke(
public static abstract Vector512<byte> Invoke(
Vector512<byte> scan,
Vector512<byte> left,
Vector512<byte> above,

6
src/ImageSharp/PixelFormats/PixelBlenders/IPixelBlenderOperator.cs

@ -18,7 +18,7 @@ internal interface IPixelBlenderOperator
/// <param name="source">The source RGBA lanes.</param>
/// <param name="amount">The source opacity in the range 0 through 1.</param>
/// <returns>The blended RGBA lanes.</returns>
static abstract Vector4 Invoke(Vector4 background, Vector4 source, float amount);
public static abstract Vector4 Invoke(Vector4 background, Vector4 source, float amount);
/// <summary>
/// Blends two pixels represented by two consecutive groups of four RGBA lanes.
@ -27,7 +27,7 @@ internal interface IPixelBlenderOperator
/// <param name="source">The source RGBA lanes.</param>
/// <param name="amount">The source opacity repeated across each pixel's four lanes.</param>
/// <returns>The blended RGBA lanes.</returns>
static abstract Vector256<float> Invoke(
public static abstract Vector256<float> Invoke(
Vector256<float> background,
Vector256<float> source,
Vector256<float> amount);
@ -39,7 +39,7 @@ internal interface IPixelBlenderOperator
/// <param name="source">The source RGBA lanes.</param>
/// <param name="amount">The source opacity repeated across each pixel's four lanes.</param>
/// <returns>The blended RGBA lanes.</returns>
static abstract Vector512<float> Invoke(
public static abstract Vector512<float> Invoke(
Vector512<float> background,
Vector512<float> source,
Vector512<float> amount);

4
src/ImageSharp/PixelFormats/Utils/Vector4Converters.Affine.cs

@ -16,7 +16,7 @@ internal static partial class Vector4Converters
/// <param name="vectors">The vectors to transform in place.</param>
/// <param name="multiplier">The component-wise multiplier.</param>
/// <param name="offset">The component-wise offset applied after multiplication.</param>
internal static void MultiplyThenAdd(Span<Vector4> vectors, Vector4 multiplier, Vector4 offset)
public static void MultiplyThenAdd(Span<Vector4> vectors, Vector4 multiplier, Vector4 offset)
=> Apply(vectors, new MultiplyThenAddOperator(multiplier, offset));
/// <summary>
@ -25,7 +25,7 @@ internal static partial class Vector4Converters
/// <param name="vectors">The vectors to transform in place.</param>
/// <param name="offset">The component-wise offset applied before division.</param>
/// <param name="divisor">The component-wise divisor.</param>
internal static void AddThenDivide(Span<Vector4> vectors, Vector4 offset, Vector4 divisor)
public static void AddThenDivide(Span<Vector4> vectors, Vector4 offset, Vector4 divisor)
=> Apply(vectors, new AddThenDivideOperator(offset, divisor));
/// <summary>

8
src/ImageSharp/PixelFormats/Utils/Vector4Converters.AffineOperators.cs

@ -19,28 +19,28 @@ internal static partial class Vector4Converters
/// </summary>
/// <param name="source">The source components.</param>
/// <returns>The transformed components.</returns>
Vector4 Invoke(Vector4 source);
public Vector4 Invoke(Vector4 source);
/// <summary>
/// Transforms one pixel represented by the four single-precision lanes in a 128-bit register.
/// </summary>
/// <param name="source">The source components.</param>
/// <returns>The transformed components.</returns>
Vector128<float> Invoke(Vector128<float> source);
public Vector128<float> Invoke(Vector128<float> source);
/// <summary>
/// Transforms two pixels represented by the eight single-precision lanes in a 256-bit register.
/// </summary>
/// <param name="source">The source components.</param>
/// <returns>The transformed components.</returns>
Vector256<float> Invoke(Vector256<float> source);
public Vector256<float> Invoke(Vector256<float> source);
/// <summary>
/// Transforms four pixels represented by the sixteen single-precision lanes in a 512-bit register.
/// </summary>
/// <param name="source">The source components.</param>
/// <returns>The transformed components.</returns>
Vector512<float> Invoke(Vector512<float> source);
public Vector512<float> Invoke(Vector512<float> source);
}
/// <summary>

Loading…
Cancel
Save