using ImageMagick;

namespace Ocr.Tesseract.Screenshots.Threshold;

public class AutoThresholdProcessor : SingleImageProcessor
{
  private readonly AutoThresholdMethod _method;

  public AutoThresholdProcessor(AutoThresholdMethod method)
  {
    _method = method;
  }

  /// <inheritdoc />
  protected override MagickImage Process(MagickImage image)
  {
    image.AutoThreshold(_method);
    return image;
  }

  #region Overrides of Object

  /// <inheritdoc />
  public override string ToString() => $"{nameof(AutoThresholdProcessor)}({_method})";

  #endregion
}