(MAJOR) Removed all in paramters as their performance impact is too hard to predict

This commit is contained in:
DarthAffe committed 2024-07-21 23:10:56 +02:00
1 parent 6f0711564c
commit c39849949a
38 files changed
+157 -155

No files matched your search

@@ -21,10 +21,10 @@ public abstract class AbstractGradientTexture : AbstractBindable, ITexture
public Size Size { get; }
/// <inheritdoc />
public Color this[in Point point] => GetColor(point);
public Color this[Point point] => GetColor(point);
/// <inheritdoc />
public Color this[in Rectangle rectangle] => GetColor(rectangle.Center);
public Color this[Rectangle rectangle] => GetColor(rectangle.Center);
#endregion
@@ -50,7 +50,7 @@ public abstract class AbstractGradientTexture : AbstractBindable, ITexture
/// </summary>
/// <param name="point">The location to get the color from.</param>
/// <returns>The color at the specified location.</returns>
protected abstract Color GetColor(in Point point);
protected abstract Color GetColor(Point point);
#endregion
}
@@ -88,7 +88,7 @@ public sealed class ConicalGradientTexture : AbstractGradientTexture
#region Methods
/// <inheritdoc />
protected override Color GetColor(in Point point)
protected override Color GetColor(Point point)
{
float angle = MathF.Atan2(point.Y - Center.Y, point.X - Center.X) - Origin;
if (angle < 0) angle += PI2;
@@ -71,7 +71,7 @@ public sealed class LinearGradientTexture : AbstractGradientTexture
#region Methods
/// <inheritdoc />
protected override Color GetColor(in Point point)
protected override Color GetColor(Point point)
{
float offset = GradientHelper.CalculateLinearGradientOffset(StartPoint, EndPoint, point);
return Gradient.GetColor(offset);
@@ -69,7 +69,7 @@ public sealed class RadialGradientTexture : AbstractGradientTexture
}
/// <inheritdoc />
protected override Color GetColor(in Point point)
protected override Color GetColor(Point point)
{
float distance = GradientHelper.CalculateDistance(point, Center);
float offset = distance / _referenceDistance;
@@ -18,7 +18,7 @@ public sealed class AverageByteSampler : ISampler<byte>
#region Methods
/// <inheritdoc />
public unsafe void Sample(in SamplerInfo<byte> info, Span<byte> pixelData)
public unsafe void Sample(SamplerInfo<byte> info, Span<byte> pixelData)
{
int count = info.Width * info.Height;
if (count == 0) return;
@@ -12,7 +12,7 @@ public sealed class AverageFloatSampler : ISampler<float>
#region Methods
/// <inheritdoc />
public unsafe void Sample(in SamplerInfo<float> info, Span<float> pixelData)
public unsafe void Sample(SamplerInfo<float> info, Span<float> pixelData)
{
int count = info.Width * info.Height;
if (count == 0) return;