GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
Loading...
Searching...
No Matches
OCRInterfaces.cs
1// =============================================================================
2// GPAL - Generally Positive Automation Library
3// Copyright © 2026 Software Decisions, Inc. All rights reserved.
4//
5// This file is part of GPAL.
6// Licensed under the Business Source License 1.1
7//
8// Primary development, architecture, and vision by Michael B. Vederman,
9// CEO of Software Decisions, Inc., Texas.
10//
11// Internal development maintained privately.
12// Public releases appear on GitHub: https://github.com/SoftwareDecisionsInc/GPAL.
13//
14// See LICENSE for full terms, including Additional Use Grant.
15// =============================================================================
16
17using System;
18using System.Collections.Generic;
19using System.Linq;
20using System.Text;
21using System.Threading.Tasks;
22using static GenerallyPositive.Enums;
23
24namespace GenerallyPositive
25{
26 public class OCRInterfaces
27 {
28 #region <Application Interfaces>
29 #region <Base Application Interfaces>
30 public interface IAllowOCRRegion
31 {
32 [Settings(Description = "The part of the image to read")]
33 IAllowOCRSettings WithRegion(ClientRectangle region);
34 }
35
36 public interface IAllowOCRSettings : IAllowOCRRegion, IAllowToGPALObject<IGPALOCR>
37 {
38 [Settings(Description = "The direction the text runs in")]
39 IAllowOCRSettingsOrExecute WithScanDirection(OCRScanDirection direction);
40 [Settings(Description = "The language of the text")]
41 IAllowOCRSettingsOrExecute WithLanguage(OCRLanguage lang);
42 [Settings(Description = "Which OCR engine reads the image")]
43 IAllowOCRSettingsOrExecute WithEngineMode(EngineMode mode);
44 [Settings(Description = "Only these characters can be read")]
45 IAllowOCRSettingsOrExecute WithCharacterWhitelist(string chars);
46 [Settings(Description = "Only read a standard set of characters, such as digits")]
47 IAllowOCRSettingsOrExecute WithStandardWhitelist(OCRWhitelist preset);
48 [Settings(Description = "The resolution the image is read at")]
49 IAllowOCRSettingsOrExecute WithDPI(int dpi);
50 [Settings(Description = "How many times to try again when nothing is read")]
51 IAllowOCRSettingsOrExecute WithRetryCount(int count);
52 [Settings(Description = "How long reading may take")]
53 IAllowOCRSettingsOrExecute WithTimeout(TimeSpan timeout);
54 }
55
57 {
58 [Action(Description = "Save the text that was read into a grid")]
59 IAllowOCRSettings SaveTo(IGPALGrid<string> grid);
60 }
61 public interface IGPALOCR : IAllowOCRSettingsOrExecute { }
62
63 #endregion <Base Application Interfaces>
64 #endregion <Application Interfaces>
65
66 public interface IAllowToGPALObject<TResult>
67 {
68 TResult ToGPALObject();
69 }
70
71 }
72}
73
Represents a client-side bounding rectangle (similar to DOMRect) with additional convenience properti...