using ImageMagick;

namespace Ocr.Tesseract.Screenshots.Threshold;

public class ThresholdProcessor : SingleImageProcessor
{
  private readonly Percentage _percentage;


  public ThresholdProcessor(int percentage)
  {
    _percentage = new Percentage(percentage);
  }

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

  #region Overrides of Object

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

  #endregion
}
