import {type CapturedResultItem, EnumCrossVerificationStatus, type ImageData, type Quadrilateral, EnumCapturedResultItemType} from "../core";
import { type ProcessedDocumentResult } from "./ProcessedDocumentResult";
import {CaptureVisionRouter} from "../cvr";
import {MultiFrameResultCrossFilter} from "../utility"

/**
 * The DeskewedImageResultItem interface extends the {@link CapturedResultItem} interface and represents a deskewed image.
 * @see {@link EnumCapturedResultItemType.CRIT_DESKEWED_IMAGE}
 * @see {@link ProcessedDocumentResult.deskewedImageResultItems}
 * */
export interface DeskewedImageResultItem extends CapturedResultItem {
  /**
   * The quadrilateral from which you get the deskewed image result item.
   * @see {@link Quadrilateral}
  * */
  sourceDeskewQuad: Quadrilateral;

  /**
   * The cross verification status of type {@link EnumCrossVerificationStatus}.
   *
   * @remarks If {@link CaptureVisionRouter} doesn't add {@link MultiFrameResultCrossFilter} via {@link CaptureVisionRouter.addFilter}
   * or added {@link MultiFrameResultCrossFilter} doesn't enable verification for the corresponding type,
   * the crossVerificationStatus property of the item for that type will always remain {@link EnumCrossVerificationStatus.CVS_NOT_VERIFIED}.
   *
   * @see {@link EnumCrossVerificationStatus}
   * @see {@link MultiFrameResultCrossFilter.enableResultCrossVerification}
   * */
  crossVerificationStatus: EnumCrossVerificationStatus | number;

  /**
   * The transformation matrix from the original image coordinate system to the local coordinate system.
   * */
  originalToLocalMatrix: Array<number>;

  /**
   * An ImageData object as the deskewed image.
   * @see {@link ImageData}
   * */
  imageData: ImageData;
}
