Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ImageSharp/PixelFormats/PixelConversionModifiers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// knowing the pixel type.
/// </summary>
[Flags]
internal enum PixelConversionModifiers
public enum PixelConversionModifiers
{
/// <summary>
/// No special operation is selected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Runtime.InteropServices;



namespace SixLabors.ImageSharp.PixelFormats
{
/// <content>
Expand Down Expand Up @@ -42,13 +43,13 @@ internal override void ToArgb32(Configuration configuration, ReadOnlySpan<Argb32
}

/// <inheritdoc />
internal override void FromVector4Destructive(Configuration configuration, Span<Vector4> sourceVectors, Span<Argb32> destPixels, PixelConversionModifiers modifiers)
public override void FromVector4Destructive(Configuration configuration, Span<Vector4> sourceVectors, Span<Argb32> destPixels, PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destPixels, modifiers.Remove(PixelConversionModifiers.Scale));
}

/// <inheritdoc />
internal override void ToVector4(Configuration configuration, ReadOnlySpan<Argb32> sourcePixels, Span<Vector4> destVectors, PixelConversionModifiers modifiers)
public override void ToVector4(Configuration configuration, ReadOnlySpan<Argb32> sourcePixels, Span<Vector4> destVectors, PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, modifiers.Remove(PixelConversionModifiers.Scale));
}
Expand Down Expand Up @@ -284,6 +285,7 @@ internal override void From<TSourcePixel>(
{
PixelOperations<TSourcePixel>.Instance.ToArgb32(configuration, sourcePixels, destinationPixels);
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ internal override void ToBgr24(Configuration configuration, ReadOnlySpan<Bgr24>
}

/// <inheritdoc />
internal override void FromVector4Destructive(Configuration configuration, Span<Vector4> sourceVectors, Span<Bgr24> destPixels, PixelConversionModifiers modifiers)
public override void FromVector4Destructive(Configuration configuration, Span<Vector4> sourceVectors, Span<Bgr24> destPixels, PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destPixels, modifiers.Remove(PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply));
}

/// <inheritdoc />
internal override void ToVector4(Configuration configuration, ReadOnlySpan<Bgr24> sourcePixels, Span<Vector4> destVectors, PixelConversionModifiers modifiers)
public override void ToVector4(Configuration configuration, ReadOnlySpan<Bgr24> sourcePixels, Span<Vector4> destVectors, PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, modifiers.Remove(PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Runtime.InteropServices;



namespace SixLabors.ImageSharp.PixelFormats
{
/// <content>
Expand Down Expand Up @@ -42,13 +43,13 @@ internal override void ToBgra32(Configuration configuration, ReadOnlySpan<Bgra32
}

/// <inheritdoc />
internal override void FromVector4Destructive(Configuration configuration, Span<Vector4> sourceVectors, Span<Bgra32> destPixels, PixelConversionModifiers modifiers)
public override void FromVector4Destructive(Configuration configuration, Span<Vector4> sourceVectors, Span<Bgra32> destPixels, PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destPixels, modifiers.Remove(PixelConversionModifiers.Scale));
}

/// <inheritdoc />
internal override void ToVector4(Configuration configuration, ReadOnlySpan<Bgra32> sourcePixels, Span<Vector4> destVectors, PixelConversionModifiers modifiers)
public override void ToVector4(Configuration configuration, ReadOnlySpan<Bgra32> sourcePixels, Span<Vector4> destVectors, PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, modifiers.Remove(PixelConversionModifiers.Scale));
}
Expand Down Expand Up @@ -284,6 +285,7 @@ internal override void From<TSourcePixel>(
{
PixelOperations<TSourcePixel>.Instance.ToBgra32(configuration, sourcePixels, destinationPixels);
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System.Runtime.InteropServices;



namespace SixLabors.ImageSharp.PixelFormats
{
/// <content>
Expand Down Expand Up @@ -248,7 +247,6 @@ internal override void From<TSourcePixel>(
{
PixelOperations<TSourcePixel>.Instance.ToBgra5551(configuration, sourcePixels, destinationPixels);
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Runtime.InteropServices;



namespace SixLabors.ImageSharp.PixelFormats
{
/// <content>
Expand Down Expand Up @@ -42,13 +43,13 @@ internal override void ToRgb24(Configuration configuration, ReadOnlySpan<Rgb24>
}

/// <inheritdoc />
internal override void FromVector4Destructive(Configuration configuration, Span<Vector4> sourceVectors, Span<Rgb24> destPixels, PixelConversionModifiers modifiers)
public override void FromVector4Destructive(Configuration configuration, Span<Vector4> sourceVectors, Span<Rgb24> destPixels, PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destPixels, modifiers.Remove(PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply));
}

/// <inheritdoc />
internal override void ToVector4(Configuration configuration, ReadOnlySpan<Rgb24> sourcePixels, Span<Vector4> destVectors, PixelConversionModifiers modifiers)
public override void ToVector4(Configuration configuration, ReadOnlySpan<Rgb24> sourcePixels, Span<Vector4> destVectors, PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, modifiers.Remove(PixelConversionModifiers.Scale | PixelConversionModifiers.Premultiply));
}
Expand Down Expand Up @@ -258,6 +259,7 @@ internal override void From<TSourcePixel>(
{
PixelOperations<TSourcePixel>.Instance.ToRgb24(configuration, sourcePixels, destinationPixels);
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Runtime.InteropServices;



namespace SixLabors.ImageSharp.PixelFormats
{
/// <content>
Expand Down Expand Up @@ -247,6 +248,7 @@ internal override void From<TSourcePixel>(
{
PixelOperations<TSourcePixel>.Instance.ToRgb48(configuration, sourcePixels, destinationPixels);
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Runtime.InteropServices;



namespace SixLabors.ImageSharp.PixelFormats
{
/// <content>
Expand Down Expand Up @@ -273,6 +274,7 @@ internal override void From<TSourcePixel>(
{
PixelOperations<TSourcePixel>.Instance.ToRgba32(configuration, sourcePixels, destinationPixels);
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Runtime.InteropServices;



namespace SixLabors.ImageSharp.PixelFormats
{
/// <content>
Expand Down Expand Up @@ -247,6 +248,7 @@ internal override void From<TSourcePixel>(
{
PixelOperations<TSourcePixel>.Instance.ToRgba64(configuration, sourcePixels, destinationPixels);
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ using System.Runtime.InteropServices;
}
#>
/// <inheritdoc />
internal override void FromVector4Destructive(Configuration configuration, Span<Vector4> sourceVectors, Span<<#=pixelType#>> destPixels, PixelConversionModifiers modifiers)
public override void FromVector4Destructive(Configuration configuration, Span<Vector4> sourceVectors, Span<<#=pixelType#>> destPixels, PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.FromVector4(configuration, this, sourceVectors, destPixels, modifiers.Remove(<#=removeTheseModifiers#>));
}

/// <inheritdoc />
internal override void ToVector4(Configuration configuration, ReadOnlySpan<<#=pixelType#>> sourcePixels, Span<Vector4> destVectors, PixelConversionModifiers modifiers)
public override void ToVector4(Configuration configuration, ReadOnlySpan<<#=pixelType#>> sourcePixels, Span<Vector4> destVectors, PixelConversionModifiers modifiers)
{
Vector4Converters.RgbaCompatible.ToVector4(configuration, this, sourcePixels, destVectors, modifiers.Remove(<#=removeTheseModifiers#>));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial struct Rgba32
internal partial class PixelOperations : PixelOperations<Rgba32>
{
/// <inheritdoc />
internal override void ToVector4(
public override void ToVector4(
Configuration configuration,
ReadOnlySpan<Rgba32> sourcePixels,
Span<Vector4> destVectors,
Expand All @@ -36,7 +36,7 @@ internal override void ToVector4(
}

/// <inheritdoc />
internal override void FromVector4Destructive(
public override void FromVector4Destructive(
Configuration configuration,
Span<Vector4> sourceVectors,
Span<Rgba32> destPixels,
Expand All @@ -52,4 +52,4 @@ internal override void FromVector4Destructive(
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.

using System;
Expand All @@ -21,7 +21,7 @@ public partial struct RgbaVector
internal class PixelOperations : PixelOperations<RgbaVector>
{
/// <inheritdoc />
internal override void FromVector4Destructive(
public override void FromVector4Destructive(
Configuration configuration,
Span<Vector4> sourceVectors,
Span<RgbaVector> destinationColors,
Expand All @@ -34,7 +34,7 @@ internal override void FromVector4Destructive(
}

/// <inheritdoc />
internal override void ToVector4(
public override void ToVector4(
Configuration configuration,
ReadOnlySpan<RgbaVector> sourcePixels,
Span<Vector4> destVectors,
Expand Down
19 changes: 11 additions & 8 deletions src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors.
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.

using System;
Expand Down Expand Up @@ -34,7 +34,7 @@ public partial class PixelOperations<TPixel>
/// <param name="sourceVectors">The <see cref="Span{T}"/> to the source vectors.</param>
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination colors.</param>
/// <param name="modifiers">The <see cref="PixelConversionModifiers"/> to apply during the conversion</param>
internal virtual void FromVector4Destructive(
public virtual void FromVector4Destructive(
Configuration configuration,
Span<Vector4> sourceVectors,
Span<TPixel> destPixels,
Expand All @@ -56,8 +56,11 @@ internal virtual void FromVector4Destructive(
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
/// <param name="sourceVectors">The <see cref="Span{T}"/> to the source vectors.</param>
/// <param name="destPixels">The <see cref="Span{T}"/> to the destination colors.</param>
internal void FromVector4Destructive(Configuration configuration, Span<Vector4> sourceVectors, Span<TPixel> destPixels) =>
this.FromVector4Destructive(configuration, sourceVectors, destPixels, PixelConversionModifiers.None);
public void FromVector4Destructive(
Configuration configuration,
Span<Vector4> sourceVectors,
Span<TPixel> destPixels)
=> this.FromVector4Destructive(configuration, sourceVectors, destPixels, PixelConversionModifiers.None);

/// <summary>
/// Bulk version of <see cref="IPixel.ToVector4()"/> converting 'sourceColors.Length' pixels into 'destinationVectors'.
Expand All @@ -66,7 +69,7 @@ internal void FromVector4Destructive(Configuration configuration, Span<Vector4>
/// <param name="sourcePixels">The <see cref="Span{T}"/> to the source colors.</param>
/// <param name="destVectors">The <see cref="Span{T}"/> to the destination vectors.</param>
/// <param name="modifiers">The <see cref="PixelConversionModifiers"/> to apply during the conversion</param>
internal virtual void ToVector4(
public virtual void ToVector4(
Configuration configuration,
ReadOnlySpan<TPixel> sourcePixels,
Span<Vector4> destVectors,
Expand All @@ -83,11 +86,11 @@ internal virtual void ToVector4(
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations</param>
/// <param name="sourcePixels">The <see cref="Span{T}"/> to the source colors.</param>
/// <param name="destVectors">The <see cref="Span{T}"/> to the destination vectors.</param>
internal virtual void ToVector4(
public void ToVector4(
Configuration configuration,
ReadOnlySpan<TPixel> sourcePixels,
Span<Vector4> destVectors) =>
this.ToVector4(configuration, sourcePixels, destVectors, PixelConversionModifiers.None);
Span<Vector4> destVectors)
=> this.ToVector4(configuration, sourcePixels, destVectors, PixelConversionModifiers.None);

internal virtual void From<TSourcePixel>(
Configuration configuration,
Expand Down