OcrEngine.swift
20 lignes · 516 octets
import UIKit /// Port of android `ocr/OcrEngine.kt`. /// Input image + engine-configured language(s) -> `OcrResult`. protocol OcrEngine { func recognize(_ image: UIImage) async throws -> OcrResult } /// Port of Kotlin `OcrException`. struct OcrException: Error, LocalizedError { let message: String let underlying: Error? init(_ message: String, underlying: Error? = nil) { self.message = message self.underlying = underlying } var errorDescription: String? { message } }
GitRust