refactoring
This commit is contained in:
parent
696fd07e86
commit
50d32abd49
20 changed files with 334 additions and 225 deletions
|
|
@ -68,6 +68,7 @@ public static class GridLayouts
|
|||
|
||||
public static readonly GridLayout Inventory = All["inventory"];
|
||||
public static readonly GridLayout Seller = All["seller"];
|
||||
public static readonly Region SellerStashOcr = new(20, 140, 630, 750);
|
||||
}
|
||||
|
||||
public class GridReader
|
||||
|
|
|
|||
22
src/Poe2Trade.Screen/IScreenReader.cs
Normal file
22
src/Poe2Trade.Screen/IScreenReader.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using Poe2Trade.Core;
|
||||
|
||||
namespace Poe2Trade.Screen;
|
||||
|
||||
public interface IScreenReader : IDisposable
|
||||
{
|
||||
GridReader Grid { get; }
|
||||
Task Warmup();
|
||||
Task<byte[]> CaptureScreen();
|
||||
Task<byte[]> CaptureRegion(Region region);
|
||||
Task<OcrResponse> Ocr(Region? region = null, string? preprocess = null);
|
||||
Task<(int X, int Y)?> FindTextOnScreen(string searchText, bool fuzzy = false);
|
||||
Task<string> ReadFullScreen();
|
||||
Task<(int X, int Y)?> FindTextInRegion(Region region, string searchText);
|
||||
Task<string> ReadRegionText(Region region);
|
||||
Task<bool> CheckForText(Region region, string searchText);
|
||||
Task Snapshot();
|
||||
Task<DiffOcrResponse> DiffOcr(string? savePath = null, Region? region = null);
|
||||
Task<TemplateMatchResult?> TemplateMatch(string templatePath, Region? region = null);
|
||||
Task SaveScreenshot(string path);
|
||||
Task SaveRegion(Region region, string path);
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ using Serilog;
|
|||
|
||||
namespace Poe2Trade.Screen;
|
||||
|
||||
public class ScreenReader : IDisposable
|
||||
public class ScreenReader : IScreenReader
|
||||
{
|
||||
private readonly DiffCropHandler _diffCrop = new();
|
||||
private readonly GridHandler _gridHandler = new();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue