Browse Source

adding a few TODO notes

af/merge-core
Anton Firszov 8 years ago
parent
commit
a7a2b0b519
  1. 3
      src/ImageSharp/Processing/Processors/CloningImageProcessor.cs
  2. 3
      src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs

3
src/ImageSharp/Processing/Processors/CloningImageProcessor.cs

@ -96,6 +96,7 @@ namespace SixLabors.ImageSharp.Processing
/// <summary>
/// This method is called before the process is applied to prepare the processor.
/// TODO: We should probably name this 'BeforeFrameApply'
/// </summary>
/// <param name="source">The source image. Cannot be null.</param>
/// <param name="destination">The cloned/destination image. Cannot be null.</param>
@ -108,6 +109,7 @@ namespace SixLabors.ImageSharp.Processing
/// <summary>
/// Applies the process to the specified portion of the specified <see cref="ImageFrame{TPixel}" /> at the specified location
/// and with the specified size.
/// TODO: We should probably name this 'ApplyToFrame'
/// </summary>
/// <param name="source">The source image. Cannot be null.</param>
/// <param name="destination">The cloned/destination image. Cannot be null.</param>
@ -117,6 +119,7 @@ namespace SixLabors.ImageSharp.Processing
/// <summary>
/// This method is called after the process is applied to prepare the processor.
/// TODO: We should probably name this 'AfterFrameApply'
/// </summary>
/// <param name="source">The source image. Cannot be null.</param>
/// <param name="destination">The cloned/destination image. Cannot be null.</param>

3
src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs

@ -223,6 +223,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
{
if (!(this.Sampler is NearestNeighborResampler))
{
// TODO: Optimization opportunity: if we could assume that all frames are of the same size, we can move this into 'BeforeImageApply()`
this.horizontalWeights = this.PrecomputeWeights(
this.ResizeRectangle.Width,
sourceRectangle.Width);
@ -367,6 +368,8 @@ namespace SixLabors.ImageSharp.Processing.Processors
protected override void AfterApply(ImageFrame<TPixel> source, ImageFrame<TPixel> destination, Rectangle sourceRectangle, Configuration configuration)
{
base.AfterApply(source, destination, sourceRectangle, configuration);
// TODO: An exception in the processing chain can leave these buffers undisposed. We should consider making image processors IDisposable!
this.horizontalWeights?.Dispose();
this.horizontalWeights = null;
this.verticalWeights?.Dispose();

Loading…
Cancel
Save