diff --git a/src/ImageSharp/Processing/Processors/Transforms/ProjectiveTransformProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ProjectiveTransformProcessor.cs index 579a0ac9a..f53585093 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ProjectiveTransformProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ProjectiveTransformProcessor.cs @@ -22,6 +22,7 @@ namespace SixLabors.ImageSharp.Processing.Processors internal class ProjectiveTransformProcessor : InterpolatedTransformProcessorBase where TPixel : struct, IPixel { + // TODO: We should use a Size instead! (See AffineTransformProcessor) private Rectangle targetRectangle; /// diff --git a/src/ImageSharp/Processing/Transforms/Transform.cs b/src/ImageSharp/Processing/Transforms/Transform.cs index 21cd7863a..e39da8dc0 100644 --- a/src/ImageSharp/Processing/Transforms/Transform.cs +++ b/src/ImageSharp/Processing/Transforms/Transform.cs @@ -38,34 +38,38 @@ namespace SixLabors.ImageSharp => Transform(source, matrix, sampler, Size.Empty); /// - /// Transforms an image by the given matrix using the specified sampling algorithm. + /// Transforms an image by the given matrix using the specified sampling algorithm + /// and a rectangle defining the transform origin in the source image and the size of the result image. /// /// The pixel format. /// The image to transform. /// The transformation matrix. /// The to perform the resampling. - /// The rectangle defining the source pixel area to transform. 'sourceRectangle.Location' becomes the origo of the transformed image. + /// + /// The rectangle defining the transform origin in the source image, and the size of the result image. + /// /// The public static IImageProcessingContext Transform( this IImageProcessingContext source, Matrix3x2 matrix, IResampler sampler, - Rectangle sourceRectangle) + Rectangle rectangle) where TPixel : struct, IPixel { - var t = Matrix3x2.CreateTranslation(-sourceRectangle.Location); + var t = Matrix3x2.CreateTranslation(-rectangle.Location); Matrix3x2 combinedMatrix = t * matrix; - return source.ApplyProcessor(new AffineTransformProcessor(combinedMatrix, sampler, sourceRectangle.Size)); + return source.ApplyProcessor(new AffineTransformProcessor(combinedMatrix, sampler, rectangle.Size)); } /// - /// Transforms an image by the given matrix using the specified sampling algorithm. + /// Transforms an image by the given matrix using the specified sampling algorithm, + /// cropping or extending the image according to . /// /// The pixel format. /// The image to transform. /// The transformation matrix. /// The to perform the resampling. - /// The dimensions to constrain the transformed image to. + /// The size of the destination image. /// The public static IImageProcessingContext Transform( this IImageProcessingContext source,