|
|
|
@ -299,26 +299,6 @@ namespace ImageProcessor |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Crops an image to the area of greatest entropy.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="threshold">
|
|
|
|
/// The threshold in bytes to control the entropy.
|
|
|
|
/// </param>
|
|
|
|
/// <returns>
|
|
|
|
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
|
|
|
|
/// </returns>
|
|
|
|
public ImageFactory EntropyCrop(byte threshold = 128) |
|
|
|
{ |
|
|
|
if (this.ShouldProcess) |
|
|
|
{ |
|
|
|
EntropyCrop autoCrop = new EntropyCrop { DynamicParameter = threshold }; |
|
|
|
this.CurrentImageFormat.ApplyProcessor(autoCrop.ProcessImage, this); |
|
|
|
} |
|
|
|
|
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Performs auto-rotation to ensure that EXIF defined rotation is reflected in
|
|
|
|
/// the final image.
|
|
|
|
@ -495,6 +475,26 @@ namespace ImageProcessor |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Crops an image to the area of greatest entropy.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="threshold">
|
|
|
|
/// The threshold in bytes to control the entropy.
|
|
|
|
/// </param>
|
|
|
|
/// <returns>
|
|
|
|
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
|
|
|
|
/// </returns>
|
|
|
|
public ImageFactory EntropyCrop(byte threshold = 128) |
|
|
|
{ |
|
|
|
if (this.ShouldProcess) |
|
|
|
{ |
|
|
|
EntropyCrop autoCrop = new EntropyCrop { DynamicParameter = threshold }; |
|
|
|
this.CurrentImageFormat.ApplyProcessor(autoCrop.ProcessImage, this); |
|
|
|
} |
|
|
|
|
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Applies a filter to the current image. Use the <see cref="MatrixFilters"/> class to
|
|
|
|
/// assign the correct filter.
|
|
|
|
|