Browse Source

Fix for tests, update reference images

af/octree-no-pixelmap
James Jackson-South 6 years ago
parent
commit
f374d194c5
  1. 6
      src/ImageSharp/Processing/Processors/Transforms/AffineTransformProcessor.cs
  2. 6
      src/ImageSharp/Processing/Processors/Transforms/AffineTransformProcessor{TPixel}.cs
  3. 6
      src/ImageSharp/Processing/Processors/Transforms/ProjectiveTransformProcessor.cs
  4. 6
      src/ImageSharp/Processing/Processors/Transforms/ProjectiveTransformProcessor{TPixel}.cs
  5. 4
      src/ImageSharp/Processing/Processors/Transforms/ResamplerExtensions.Operations.cs
  6. 2
      tests/Images/External

6
src/ImageSharp/Processing/Processors/Transforms/AffineTransformProcessor.cs

@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
Guard.NotNull(sampler, nameof(sampler)); Guard.NotNull(sampler, nameof(sampler));
this.Sampler = sampler; this.Sampler = sampler;
this.TransformMatrix = matrix; this.TransformMatrix = matrix;
this.TargetDimensions = targetDimensions; this.DestinationSize = targetDimensions;
} }
/// <summary> /// <summary>
@ -35,9 +35,9 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
public Matrix3x2 TransformMatrix { get; } public Matrix3x2 TransformMatrix { get; }
/// <summary> /// <summary>
/// Gets the target dimensions to constrain the transformed image to. /// Gets the destination size to constrain the transformed image to.
/// </summary> /// </summary>
public Size TargetDimensions { get; } public Size DestinationSize { get; }
/// <inheritdoc/> /// <inheritdoc/>
public override ICloningImageProcessor<TPixel> CreatePixelSpecificCloningProcessor<TPixel>(Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle) public override ICloningImageProcessor<TPixel> CreatePixelSpecificCloningProcessor<TPixel>(Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle)

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

@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
internal class AffineTransformProcessor<TPixel> : TransformProcessor<TPixel> internal class AffineTransformProcessor<TPixel> : TransformProcessor<TPixel>
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
private readonly Size targetSize; private readonly Size destinationSize;
private readonly Matrix3x2 transformMatrix; private readonly Matrix3x2 transformMatrix;
private readonly IResampler resampler; private readonly IResampler resampler;
@ -27,12 +27,12 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
public AffineTransformProcessor(Configuration configuration, AffineTransformProcessor definition, Image<TPixel> source, Rectangle sourceRectangle) public AffineTransformProcessor(Configuration configuration, AffineTransformProcessor definition, Image<TPixel> source, Rectangle sourceRectangle)
: base(configuration, source, sourceRectangle) : base(configuration, source, sourceRectangle)
{ {
this.targetSize = definition.TargetDimensions; this.destinationSize = definition.DestinationSize;
this.transformMatrix = definition.TransformMatrix; this.transformMatrix = definition.TransformMatrix;
this.resampler = definition.Sampler; this.resampler = definition.Sampler;
} }
protected override Size GetDestinationSize() => this.targetSize; protected override Size GetDestinationSize() => this.destinationSize;
/// <inheritdoc/> /// <inheritdoc/>
protected override void OnFrameApply(ImageFrame<TPixel> source, ImageFrame<TPixel> destination) protected override void OnFrameApply(ImageFrame<TPixel> source, ImageFrame<TPixel> destination)

6
src/ImageSharp/Processing/Processors/Transforms/ProjectiveTransformProcessor.cs

@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
Guard.NotNull(sampler, nameof(sampler)); Guard.NotNull(sampler, nameof(sampler));
this.Sampler = sampler; this.Sampler = sampler;
this.TransformMatrix = matrix; this.TransformMatrix = matrix;
this.TargetDimensions = targetDimensions; this.DestinationSize = targetDimensions;
} }
/// <summary> /// <summary>
@ -35,9 +35,9 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
public Matrix4x4 TransformMatrix { get; } public Matrix4x4 TransformMatrix { get; }
/// <summary> /// <summary>
/// Gets the target dimensions to constrain the transformed image to. /// Gets the destination size to constrain the transformed image to.
/// </summary> /// </summary>
public Size TargetDimensions { get; } public Size DestinationSize { get; }
/// <inheritdoc /> /// <inheritdoc />
public override ICloningImageProcessor<TPixel> CreatePixelSpecificCloningProcessor<TPixel>(Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle) public override ICloningImageProcessor<TPixel> CreatePixelSpecificCloningProcessor<TPixel>(Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle)

6
src/ImageSharp/Processing/Processors/Transforms/ProjectiveTransformProcessor{TPixel}.cs

@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
internal class ProjectiveTransformProcessor<TPixel> : TransformProcessor<TPixel> internal class ProjectiveTransformProcessor<TPixel> : TransformProcessor<TPixel>
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
private readonly Size targetSize; private readonly Size destinationSize;
private readonly IResampler resampler; private readonly IResampler resampler;
private readonly Matrix4x4 transformMatrix; private readonly Matrix4x4 transformMatrix;
@ -27,12 +27,12 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
public ProjectiveTransformProcessor(Configuration configuration, ProjectiveTransformProcessor definition, Image<TPixel> source, Rectangle sourceRectangle) public ProjectiveTransformProcessor(Configuration configuration, ProjectiveTransformProcessor definition, Image<TPixel> source, Rectangle sourceRectangle)
: base(configuration, source, sourceRectangle) : base(configuration, source, sourceRectangle)
{ {
this.targetSize = definition.TargetDimensions; this.destinationSize = definition.DestinationSize;
this.transformMatrix = definition.TransformMatrix; this.transformMatrix = definition.TransformMatrix;
this.resampler = definition.Sampler; this.resampler = definition.Sampler;
} }
protected override Size GetDestinationSize() => this.targetSize; protected override Size GetDestinationSize() => this.destinationSize;
/// <inheritdoc/> /// <inheritdoc/>
protected override void OnFrameApply(ImageFrame<TPixel> source, ImageFrame<TPixel> destination) protected override void OnFrameApply(ImageFrame<TPixel> source, ImageFrame<TPixel> destination)

4
src/ImageSharp/Processing/Processors/Transforms/ResamplerExtensions.Operations.cs

@ -33,7 +33,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
{ {
this.source = source; this.source = source;
this.destination = destination; this.destination = destination;
this.bounds = destination.Bounds(); this.bounds = source.Bounds();
this.matrix = matrix; this.matrix = matrix;
this.maxX = destination.Width; this.maxX = destination.Width;
} }
@ -77,7 +77,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
{ {
this.source = source; this.source = source;
this.destination = destination; this.destination = destination;
this.bounds = destination.Bounds(); this.bounds = source.Bounds();
this.matrix = matrix; this.matrix = matrix;
this.maxX = destination.Width; this.maxX = destination.Width;
} }

2
tests/Images/External

@ -1 +1 @@
Subproject commit f9b4bfe42cacb3eefab02ada92ac771a9b93c080 Subproject commit f8a76fd3a900b90c98df67ac896574383a4d09f3
Loading…
Cancel
Save