Browse Source

Fixed old struct pixel format type constraints

pull/1574/head
Sergio Pedri 6 years ago
parent
commit
68b34aaaf6
  1. 2
      src/ImageSharp/Processing/Processors/Transforms/IResampler.cs
  2. 2
      src/ImageSharp/Processing/Processors/Transforms/IResamplingTransformImageProcessor{TPixel}.cs
  3. 2
      src/ImageSharp/Processing/Processors/Transforms/Linear/AffineTransformProcessor{TPixel}.cs
  4. 2
      src/ImageSharp/Processing/Processors/Transforms/Linear/LinearTransformUtilities.cs
  5. 2
      src/ImageSharp/Processing/Processors/Transforms/Resamplers/BicubicResampler.cs
  6. 2
      src/ImageSharp/Processing/Processors/Transforms/Resamplers/BoxResampler.cs
  7. 2
      src/ImageSharp/Processing/Processors/Transforms/Resamplers/CubicResampler.cs
  8. 2
      src/ImageSharp/Processing/Processors/Transforms/Resamplers/LanczosResampler.cs
  9. 2
      src/ImageSharp/Processing/Processors/Transforms/Resamplers/NearestNeighborResampler.cs
  10. 2
      src/ImageSharp/Processing/Processors/Transforms/Resamplers/TriangleResampler.cs
  11. 2
      src/ImageSharp/Processing/Processors/Transforms/Resamplers/WelchResampler.cs

2
src/ImageSharp/Processing/Processors/Transforms/IResampler.cs

@ -30,6 +30,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="processor">The transforming image processor.</param>
void ApplyTransform<TPixel>(IResamplingTransformImageProcessor<TPixel> processor)
where TPixel : struct, IPixel<TPixel>;
where TPixel : unmanaged, IPixel<TPixel>;
}
}

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

@ -10,7 +10,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
/// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam>
public interface IResamplingTransformImageProcessor<TPixel> : IImageProcessor<TPixel>
where TPixel : struct, IPixel<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
/// <summary>
/// Applies a resampling transform with the given sampler.

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

@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
/// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam>
internal class AffineTransformProcessor<TPixel> : TransformProcessor<TPixel>, IResamplingTransformImageProcessor<TPixel>
where TPixel : struct, IPixel<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
private readonly Size destinationSize;
private readonly Matrix3x2 transformMatrix;

2
src/ImageSharp/Processing/Processors/Transforms/Linear/LinearTransformUtilities.cs

@ -39,7 +39,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
Vector2 radialExtents,
Vector4 maxSourceExtents)
where TResampler : struct, IResampler
where TPixel : struct, IPixel<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
// Clamp sampling pixel radial extents to the source image edges
Vector2 minXY = transformedPoint - radialExtents;

2
src/ImageSharp/Processing/Processors/Transforms/Resamplers/BicubicResampler.cs

@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public void ApplyTransform<TPixel>(IResamplingTransformImageProcessor<TPixel> processor)
where TPixel : struct, IPixel<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
=> processor.ApplyTransform(in this);
}
}

2
src/ImageSharp/Processing/Processors/Transforms/Resamplers/BoxResampler.cs

@ -30,7 +30,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public void ApplyTransform<TPixel>(IResamplingTransformImageProcessor<TPixel> processor)
where TPixel : struct, IPixel<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
=> processor.ApplyTransform(in this);
}
}

2
src/ImageSharp/Processing/Processors/Transforms/Resamplers/CubicResampler.cs

@ -106,7 +106,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public void ApplyTransform<TPixel>(IResamplingTransformImageProcessor<TPixel> processor)
where TPixel : struct, IPixel<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
=> processor.ApplyTransform(in this);
}
}

2
src/ImageSharp/Processing/Processors/Transforms/Resamplers/LanczosResampler.cs

@ -62,7 +62,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public void ApplyTransform<TPixel>(IResamplingTransformImageProcessor<TPixel> processor)
where TPixel : struct, IPixel<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
=> processor.ApplyTransform(in this);
}
}

2
src/ImageSharp/Processing/Processors/Transforms/Resamplers/NearestNeighborResampler.cs

@ -22,7 +22,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public void ApplyTransform<TPixel>(IResamplingTransformImageProcessor<TPixel> processor)
where TPixel : struct, IPixel<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
=> processor.ApplyTransform(in this);
}
}

2
src/ImageSharp/Processing/Processors/Transforms/Resamplers/TriangleResampler.cs

@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public void ApplyTransform<TPixel>(IResamplingTransformImageProcessor<TPixel> processor)
where TPixel : struct, IPixel<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
=> processor.ApplyTransform(in this);
}
}

2
src/ImageSharp/Processing/Processors/Transforms/Resamplers/WelchResampler.cs

@ -35,7 +35,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public void ApplyTransform<TPixel>(IResamplingTransformImageProcessor<TPixel> processor)
where TPixel : struct, IPixel<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
=> processor.ApplyTransform(in this);
}
}

Loading…
Cancel
Save