using ImageMagick;
using System.Text.Json.Serialization;

namespace Ocr.Tesseract.Models;

/// <summary>
/// Struct for storing <see cref="TesseractProcessor"/> results
/// </summary>
public struct ScanResult
{
  /// <summary>
  /// Constructor
  /// </summary>
  /// <param name="word"></param>
  /// <param name="image"></param>
  public ScanResult(Word word, MagickImage image)
  {
    Word = word;
    Image = image;
  }

  /// <summary>
  /// Key referencing <see cref="Image"/>
  /// </summary>
  public Word Word { get; set; }

  /// <summary>
  /// Value referenced by <see cref="Word"/>
  /// </summary>
  [JsonIgnore]
  public MagickImage Image { get; set; }


  /// <inheritdoc />
  public override string ToString()
  {
    return Word.ToString();
  }
}
