Browse Source

Add resize overload

Former-commit-id: f4c7cb3a87ffdf88a55339c10967c8b35225c37a
Former-commit-id: 538c2a48e661b6563fbd9f3be82237b6552f793b
Former-commit-id: 7bdd802e524bd1480e22c09da91499ea21f80ea4
pull/1/head
James Jackson-South 10 years ago
parent
commit
acbdcf05f4
  1. 19
      src/ImageProcessorCore/Samplers/Resize.cs

19
src/ImageProcessorCore/Samplers/Resize.cs

@ -79,6 +79,25 @@ namespace ImageProcessorCore
return Resize(source, width, height, new BicubicResampler(), compand, progressHandler);
}
/// <summary>
/// Resizes an image to the given width and height with the given sampler.
/// </summary>
/// <typeparam name="TColor">The pixel format.</typeparam>
/// <typeparam name="TPacked">The packed format. <example>uint, long, float.</example></typeparam>
/// <param name="source">The image to resize.</param>
/// <param name="width">The target image width.</param>
/// <param name="height">The target image height.</param>
/// <param name="sampler">The <see cref="IResampler"/> to perform the resampling.</param>
/// <param name="progressHandler">A delegate which is called as progress is made processing the image.</param>
/// <returns>The <see cref="Image{TColor, TPacked}"/></returns>
/// <remarks>Passing zero for one of height or width will automatically preserve the aspect ratio of the original image</remarks>
public static Image<TColor, TPacked> Resize<TColor, TPacked>(this Image<TColor, TPacked> source, int width, int height, IResampler sampler, ProgressEventHandler progressHandler = null)
where TColor : IPackedVector<TPacked>
where TPacked : struct
{
return Resize(source, width, height, sampler, false, progressHandler);
}
/// <summary>
/// Resizes an image to the given width and height with the given sampler.
/// </summary>

Loading…
Cancel
Save