From 3d6cbf6530854ba0448fb88d356009495cd8c7ec Mon Sep 17 00:00:00 2001 From: qiannian <40210590@qq.com> Date: Sun, 5 Jul 2026 19:18:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Refactor(doc):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 183 ++++++++++++++++++++++++------------------------ README_EN.md | 169 +++++++++++++++++++++++++++++++------------- libop/readme.md | 27 ++++--- 3 files changed, 230 insertions(+), 149 deletions(-) diff --git a/README.md b/README.md index f6019ea..ee4ad32 100644 --- a/README.md +++ b/README.md @@ -7,76 +7,84 @@ [English](README_EN.md) -OP (Operator & Open) 是一个面向 Windows 的开源自动化插件,提供窗口操作、后台键鼠、截图、找色找图、OCR、OpenCV 图像处理、内存读写等能力。项目以 C++ 实现,提供 COM 接口,支持 x86/x64。 +OP(Operator & Open)是一个面向 Windows 的自动化插件。它把窗口查找、后台绑定、截图、键鼠输入、找色找图、OCR、OpenCV、YOLO HTTP 检测和进程内存读写放在同一套接口里,方便脚本工具和桌面自动化程序直接调用。 -OCR 同时支持两条路径:固定字体场景可以使用本地点阵字库,兼容 OP 二进制字库和大漠文本点阵字库格式;不使用点阵字库时,可以接入独立 OCR HTTP 服务 [op_ocr_engine](https://github.com/WallBreaker2/op_ocr_engine),支持 Tesseract 和 PaddleOCR 等通用/模型 OCR 后端。 +核心代码使用 C++ 实现,提供 COM、C API、Python 和 Go 绑定,支持 x86/x64。截图后端覆盖普通窗口、GDI、DXGI、WGC、DirectX Hook、OpenGL 和 OpenGL ES;字库、图片模板可以从本地文件加载,也可以从内存加载,适合把资源随程序一起打包。 -YOLO 检测采用同类外部 HTTP 服务模式:OP 负责截图、读图和 HTTP 调用,YOLO11/YOLOv11 模型推理由独立服务完成。接口与返回格式见 [YOLO HTTP 检测](doc/yolo.md)。 -仓库内提供了最小服务样例:`tools/op_yolo_engine.py`。 +OCR 目前有两条路线:固定字体场景使用点阵字库,兼容 OP 二进制字库和大漠文本点阵字库;通用 OCR 可以接入独立 HTTP 服务 [op_ocr_engine](https://github.com/WallBreaker2/op_ocr_engine),由 Tesseract、PaddleOCR 等后端完成识别。 + +YOLO 检测同样走外部 HTTP 服务模式。OP 负责截图、读图和请求封装,模型推理由独立服务完成。接口格式见 [YOLO HTTP 检测](doc/yolo.md),仓库里也放了一个最小服务样例:`tools/op_yolo_engine.py`。 ## 文档 - [GitHub Wiki](https://github.com/WallBreaker2/op/wiki):安装、接口说明、OpenCV、OCR、免注册、多语言示例 - [插件下载](https://github.com/WallBreaker2/op/releases) +- [本地 OCR 说明](doc/ocr.md) +- [YOLO HTTP 检测](doc/yolo.md) - [测试工具 OPTestTool](https://github.com/flaot/OPTestTool) ## 主要能力 -- 窗口查询、窗口状态、窗口布局和后台绑定 -- 前台/后台鼠标键盘模拟 -- GDI、DXGI、WGC、DirectX、OpenGL 等截图方式 -- 找色、找图、图片输入源和内存图片输入 -- 点阵字库 OCR,兼容 OP 字库和大漠文本点阵字库格式 -- 独立 OCR HTTP 服务接入,支持 Tesseract、PaddleOCR 等通用/模型 OCR 后端 -- 独立 YOLO HTTP 检测服务接入,支持 YOLO11/YOLOv11 等外部检测后端 -- OpenCV 模板匹配、特征匹配和文件预处理 -- 进程内存读写、汇编调用和基础算法工具 +- 窗口枚举、进程查询、窗口状态控制、批量窗口布局 +- 普通绑定、后台绑定、显示句柄和输入句柄分离绑定 +- GDI、DXGI、WGC、DX Hook、OpenGL、OpenGL ES 等截图方式 +- 前台/后台鼠标键盘模拟,支持平滑移动、轨迹移动和 DX 输入锁定 +- 找色、找图、透明图片模板、OpenCV 模板匹配和特征匹配 +- 点阵字库 OCR,支持本地字库和内存字库 +- OCR / YOLO HTTP 服务接入 +- C API、COM、Python、Go 等调用方式 +- 进程内存读写、汇编调用和常用算法工具 ## 目录概览 ```text op/ -├─ libop/ 核心插件源码 -│ ├─ com/ COM 注册、IDL、类型库和 IOpAutomation 对外接口实现 -│ ├─ binding/ 窗口绑定与后台模式调度 -│ ├─ capture/ 截图输入源和 GDI/DXGI/WGC/Hook 采集后端 -│ ├─ input/ 鼠标、键盘和 DX 输入后端 -│ ├─ hook/ 显示/输入 hook、注入协议和导出入口 -│ ├─ image/ 找色、找图、点阵 OCR、OCR HTTP 服务封装 -│ ├─ opencv/ OpenCV 模板匹配、特征匹配、预处理和桥接层 -│ ├─ windows/ 窗口、进程、内存、注入等 Windows API 封装 -│ ├─ op/ C++ 主接口 op::Op 的分文件实现 -│ ├─ common/ 图像、颜色、字库、共享内存等内部基础结构 -│ ├─ algorithm/ A* 等通用算法 -│ ├─ libop.cpp op::Op 构造、析构和上下文初始化 -├─ include/ 对外头文件和导出接口 -├─ tools/ 免注册加载工具源码,生成 tools.dll -├─ swig/ Python SWIG 绑定文件 -├─ python/ pip wheel 包源码(python/pyop) -├─ examples/ 本地测试示例和测试资源 -├─ tests/ C++ 单元测试和集成测试 -├─ doc/op.wiki/ GitHub Wiki 文档源码 -├─ 3rd_party/ 第三方源码或本地依赖 -├─ ci/ CI 辅助脚本 -├─ bin/ 预置或构建后的运行文件 -├─ out/ 历史或可选输出目录 -├─ build.py 推荐的一键构建入口 -└─ CMakeLists.txt CMake 工程入口 +├─ libop/ 核心 C++ 源码 +│ ├─ op/ op::Op 对外接口的分文件实现 +│ ├─ c_api/ C API 封装 +│ ├─ com/ COM 组件、IDL 和自动化接口实现 +│ ├─ binding/ 窗口绑定和后台模式调度 +│ ├─ capture/ GDI、DXGI、WGC、Hook 等截图后端 +│ ├─ hook/ 远端注入、显示 hook、输入 hook 和共享帧写入 +│ ├─ input/ 鼠标、键盘输入后端 +│ ├─ image/ 图片加载、找色、找图和图像搜索服务 +│ ├─ ocr/ 字库管理和 OCR 识别 +│ ├─ opencv/ OpenCV 桥接、模板匹配和图像处理 +│ ├─ window/ 窗口、进程和 DLL 注入相关能力 +│ ├─ base/ 基础类型、运行环境和工具函数 +│ ├─ ipc/ 共享内存、互斥量、管道等进程间通信封装 +│ ├─ memory/ 目标进程内存读写 +│ ├─ network/ HTTP 客户端等网络辅助能力 +│ ├─ algorithm/ 内部算法与通用计算逻辑 +│ └─ yolo/ YOLO 检测器封装 +├─ include/ 对外头文件 +├─ bindings/ C API 的 Python、Go 包装 +├─ swig/ SWIG 绑定生成文件 +├─ python/ `pyop` Python 包源码 +├─ tools/ 免注册加载工具和 YOLO 服务样例 +├─ examples/ 本地示例和测试资源 +├─ tests/ C++ 单元测试和集成测试 +├─ doc/ 项目内补充文档和流程图 +├─ scripts/ wheel 构建脚本 +├─ ci/ CI triplet 和辅助配置 +├─ 3rd_party/ 第三方源码或本地依赖 +├─ build.py 推荐的一键构建入口 +└─ CMakeLists.txt CMake 工程入口 ``` ## 快速开始 -下载 Release 后,根据宿主程序位数注册对应 DLL: +下载 Release 后,根据宿主程序位数使用对应 DLL。COM 方式需要注册: ```powershell # 32 位宿主程序 -regsvr32 op_x86.dll +regsvr32 .\op_x86.dll # 64 位宿主程序 -regsvr32 op_x64.dll +regsvr32 .\op_x64.dll ``` -Python 最小示例(COM,与 Python 版本无关): +Python 通过 COM 调用: ```python from win32com.client import Dispatch @@ -85,23 +93,20 @@ op = Dispatch("op.opsoft") print("op version:", op.Ver()) ``` -### pip 安装(推荐 Python 用户使用) +免注册调用请看 Wiki: -`op-plugins` 通过 PyPI 发布多版本 wheel(Python 3.9–3.12,win32/win_amd64),自动匹配本地 Python 版本,无需手动挑选 `_pyop.pyd`: +- [安装与免注册](https://github.com/WallBreaker2/op/wiki/docs/install) +- [Python 免注册示例](https://github.com/WallBreaker2/op/wiki/demo/python-regfree) +- [C# / Lua / Golang / Rust / Node.js / Java 示例](https://github.com/WallBreaker2/op/wiki/Home) -```powershell -# 从 PyPI 安装(推荐) -pip install op-plugins +## Python -# 或从 GitHub Release 安装指定 wheel(将 替换为实际文件名) -pip install https://github.com/WallBreaker2/op/releases/download//.whl +`op-plugins` wheel 面向直接使用 `pyop` 的用户,支持 Python 3.9-3.12,提供 `win32` 和 `win_amd64` 两种架构: -# 示例:64 位 Python 3.12 -pip install https://github.com/WallBreaker2/op/releases/download/v1.0.0/op_plugins-1.0.0-cp312-cp312-win_amd64.whl +```powershell +pip install op-plugins ``` -安装后使用 SWIG 绑定: - ```python from pyop import Op @@ -109,11 +114,17 @@ op = Op() print("op version:", op.Ver()) ``` +如果从 Release 安装指定 wheel,把 `` 和 `` 换成实际文件名: + +```powershell +pip install https://github.com/WallBreaker2/op/releases/download//.whl +``` + 注意: -- 64 位 Python 请安装 `win_amd64` wheel;32 位 Python / 32 位游戏场景请安装 `win32` wheel -- wheel 已内置 `op_x64.dll` / `op_x86.dll` 和 `tools.dll`,无需单独下载 zip -- 若仍使用 zip 分发,须确保 `_pyop.pyd` 与本地 Python 版本一致(如 cp312 对应 Python 3.12) +- 64 位 Python 使用 `win_amd64` wheel,32 位 Python 使用 `win32` wheel +- wheel 已内置对应架构的 OP 运行文件,不需要再手动复制 zip 里的 DLL +- `bindings/python` 是基于 `ctypes` 的 C API 包装,和 SWIG 版 `pyop` 相互独立,适合需要直接调用 `op_c_api_*.dll` 的场景 验证安装: @@ -121,66 +132,56 @@ print("op version:", op.Ver()) python -c "from pyop import Op; print(Op().Ver())" ``` -免注册调用请参考 Wiki: - -- [安装与免注册](https://github.com/WallBreaker2/op/wiki/install) -- [Python 免注册示例](https://github.com/WallBreaker2/op/wiki/python-regfree) -- [C# / Lua / Golang / Rust / Node.js / Java 示例](https://github.com/WallBreaker2/op/wiki#demo) - ## 源码编译 环境要求: +- Windows 10 或更新版本 - Visual Studio 2022 或更新版本 - CMake 3.24 或更新版本 -- Windows SDK 10.0.19041.0 或更新版本 +- Python 3.12(用于构建脚本、SWIG 绑定和测试工具) 推荐使用根目录 `build.py`: ```powershell -# 默认 Release + x64 -python build.py +# 当前 CI 使用的 Release x64 构建 +python build.py -g vs2026 -t Release -a x64 # 构建 x86 -python build.py -a x86 +python build.py -g vs2026 -t Release -a x86 # Debug -python build.py -t Debug +python build.py -g vs2026 -t Debug -a x64 -# 指定环境 -python build.py -t Release -a x64 -g vs2022 +# 如果本机是 VS2022,可以把 -g 改成 vs2022 +python build.py -g vs2022 -t Release -a x64 ``` -Release 产物会安装到 `bin/x86` 或 `bin/x64`。 +Release 产物会安装到 `bin/x86` 或 `bin/x64`。发布包通常包含: + +```text +op_x86.dll / op_x64.dll +op_c_api_x86.dll / op_c_api_x64.dll +tools.dll +_pyop.pyd +pyop.py +lib/op_c_api_x86.lib / lib/op_c_api_x64.lib +``` -本地构建 pip wheel(推荐用脚本自动 bootstrap 依赖并设置 CMake 参数): +本地构建 wheel: ```powershell -# 先确保已安装构建依赖 pip install scikit-build-core setuptools-scm +.\scripts\build_wheel.ps1 +``` -# 一键构建(默认 x64,自动检测 VS 版本) -./scripts/build_wheel.ps1 +如果手动构建,先跑一次 `build.py` 完成依赖引导: -# 或手动:先 bootstrap,再 pip wheel -python build.py -t Release -a x64 +```powershell +python build.py -g vs2026 -t Release -a x64 pip wheel . --no-deps -w wheelhouse - -# 本地模拟 CI 的单版本双架构 wheel 构建 -pip install cibuildwheel==2.23.4 -$env:CIBW_BUILD="cp312-*" -$env:CIBW_ARCHS_WINDOWS="AMD64" -$env:CIBW_BEFORE_BUILD_WINDOWS="powershell ./scripts/cibw_before_build.ps1" -$env:CIBW_ENVIRONMENT_WINDOWS='CMAKE_GENERATOR="Visual Studio 17 2022" CMAKE_ARGS="-A x64 -DOP_PYTHON_WHEEL=ON -DOP_BUILD_TESTS=OFF -Dbuild_swig_py=ON"' -python -m cibuildwheel --platform windows - -$env:CIBW_ARCHS_WINDOWS="x86" -$env:CIBW_ENVIRONMENT_WINDOWS='CMAKE_GENERATOR="Visual Studio 17 2022" CMAKE_ARGS="-A Win32 -DOP_PYTHON_WHEEL=ON -DOP_BUILD_TESTS=OFF -Dbuild_swig_py=ON"' -python -m cibuildwheel --platform windows ``` -若 `pip wheel` 报 BlackBone 未找到,说明尚未运行 `python build.py` 或 `./scripts/build_wheel.ps1` 完成依赖引导。 - ## 社区 - [GitHub Issues](https://github.com/WallBreaker2/op/issues) diff --git a/README_EN.md b/README_EN.md index 106ed14..e3b97c3 100644 --- a/README_EN.md +++ b/README_EN.md @@ -7,72 +7,84 @@ [中文](README.md) -OP (Operator & Open) is an open-source automation plugin for Windows. It provides window automation, background mouse and keyboard input, screen capture, image/color search, OCR, YOLO HTTP detection, OpenCV image processing, memory access, and related desktop automation features. The core is written in C++ and exposed through COM interfaces with x86/x64 support. +OP (Operator & Open) is a Windows automation plugin. It brings window discovery, background binding, screen capture, mouse and keyboard input, color and image search, OCR, OpenCV, YOLO HTTP detection, and process memory access into one set of APIs for scripting tools and desktop automation programs. -OCR supports two paths: fixed-font scenarios can use local bitmap dictionaries, including OP binary dictionaries and the text bitmap dictionary format compatible with DaMo; when no bitmap dictionary is used, OP can call the standalone OCR HTTP service [op_ocr_engine](https://github.com/WallBreaker2/op_ocr_engine), with Tesseract, PaddleOCR, and other general/model OCR backends. YOLO detection uses the same external HTTP service pattern: OP captures or loads images, then sends them to a separate YOLO11/YOLOv11 backend. See [YOLO HTTP detection](doc/yolo.md). A minimal sample service is available at `tools/op_yolo_engine.py`. +The core is written in C++. It exposes COM, C API, Python, and Go bindings, with x86 and x64 builds. Capture backends cover normal windows, GDI, DXGI, WGC, DirectX hooks, OpenGL, and OpenGL ES. Image templates and OCR dictionaries can be loaded from files or from memory, which makes it easier to ship resources inside your own program. + +OCR has two practical paths. Fixed-font scenes can use local bitmap dictionaries, including OP binary dictionaries and the text bitmap dictionary format compatible with DaMo. General OCR can be delegated to the standalone HTTP service [op_ocr_engine](https://github.com/WallBreaker2/op_ocr_engine), backed by engines such as Tesseract or PaddleOCR. + +YOLO detection follows the same external-service model. OP captures or loads the image and wraps the HTTP request; model inference runs in a separate service. See [YOLO HTTP detection](doc/yolo.md) for the API format. A minimal sample service is included at `tools/op_yolo_engine.py`. ## Documentation -- [GitHub Wiki](https://github.com/WallBreaker2/op/wiki): installation, APIs, OpenCV, OCR, registration-free usage, and language demos +- [GitHub Wiki](https://github.com/WallBreaker2/op/wiki): installation, API reference, OpenCV, OCR, registration-free usage, and language demos - [Releases](https://github.com/WallBreaker2/op/releases) +- [Local OCR notes](doc/ocr.md) +- [YOLO HTTP detection](doc/yolo.md) - [OPTestTool](https://github.com/flaot/OPTestTool) ## Features -- Window search, window state control, window layout, and background binding -- Foreground and background mouse/keyboard simulation -- GDI, DXGI, WGC, DirectX, and OpenGL capture modes -- Color search, image search, image input sources, and memory image input -- Bitmap-dictionary OCR, compatible with OP dictionaries and DaMo text bitmap dictionaries -- Standalone OCR HTTP service integration for Tesseract, PaddleOCR, and other general/model OCR backends -- Standalone YOLO HTTP detection service integration for YOLO11/YOLOv11 and other external detection backends -- OpenCV template matching, feature matching, and file preprocessing -- Process memory access, assembly calls, and utility algorithms +- Window enumeration, process lookup, window state control, and batch window layout +- Normal binding, background binding, and separated display/input window handles +- GDI, DXGI, WGC, DX hook, OpenGL, and OpenGL ES capture modes +- Foreground/background mouse and keyboard input, smooth movement, path movement, and DX input locking +- Color search, image search, transparent templates, OpenCV template matching, and feature matching +- Bitmap-dictionary OCR with file and memory dictionary loading +- OCR and YOLO HTTP service integration +- COM, C API, Python, and Go access +- Process memory read/write, assembly calls, and utility algorithms ## Repository Layout ```text op/ -├─ libop/ Core plugin source -│ ├─ com/ COM registration, IDL, type library, and IOpAutomation implementation -│ ├─ binding/ Window binding and background-mode dispatch -│ ├─ capture/ Capture sources and GDI/DXGI/WGC/Hook capture backends -│ ├─ input/ Mouse, keyboard, and DX input backends -│ ├─ hook/ Display/input hooks, injection protocol, and exported hook entrypoints -│ ├─ image/ Color/image search, bitmap OCR, OCR HTTP wrapper, and YOLO HTTP wrapper -│ ├─ opencv/ OpenCV template matching, feature matching, preprocessing, and bridge layer -│ ├─ windows/ Windows API wrappers for windows, processes, memory, and injection -│ ├─ op/ Split implementation of the public C++ op::Op class -│ ├─ common/ Internal image, color, dictionary, and shared-memory structures -│ ├─ algorithm/ Common algorithms such as A* -│ ├─ libop.cpp op::Op construction, destruction, and context initialization -├─ include/ Public headers and exported interfaces -├─ tools/ Registration-free loader source, builds tools.dll -├─ swig/ Python SWIG binding files -├─ examples/ Local examples and test assets -├─ tests/ C++ unit and integration tests -├─ doc/op.wiki/ GitHub Wiki documentation source -├─ 3rd_party/ Third-party source or local dependencies -├─ ci/ CI helper scripts -├─ bin/ Runtime files or built binaries -├─ out/ Historical or optional output directory -├─ build.py Recommended one-command build entry -└─ CMakeLists.txt CMake project entry +├─ libop/ Core C++ source +│ ├─ op/ Split implementation of the public op::Op API +│ ├─ c_api/ C API wrapper +│ ├─ com/ COM component, IDL, and automation interface +│ ├─ binding/ Window binding and background-mode dispatch +│ ├─ capture/ GDI, DXGI, WGC, Hook, and related capture backends +│ ├─ hook/ Remote injection, display/input hooks, and shared-frame writing +│ ├─ input/ Mouse and keyboard input backends +│ ├─ image/ Image loading, color search, image search, and image services +│ ├─ ocr/ Dictionary management and OCR implementation +│ ├─ opencv/ OpenCV bridge, template matching, and image processing +│ ├─ window/ Window, process, and DLL injection helpers +│ ├─ base/ Basic types, runtime environment, and utility functions +│ ├─ ipc/ Shared memory, mutexes, pipes, and other IPC helpers +│ ├─ memory/ Target-process memory access +│ ├─ network/ HTTP client and network helpers +│ ├─ algorithm/ Internal algorithms and shared calculation logic +│ └─ yolo/ YOLO detector wrapper +├─ include/ Public headers +├─ bindings/ Python and Go wrappers over the C API +├─ swig/ SWIG-generated binding files +├─ python/ `pyop` Python package source +├─ tools/ Registration-free loader tools and YOLO sample service +├─ examples/ Local examples and test assets +├─ tests/ C++ unit and integration tests +├─ doc/ In-repository notes and diagrams +├─ scripts/ Wheel build scripts +├─ ci/ CI triplets and helper configuration +├─ 3rd_party/ Third-party source or local dependencies +├─ build.py Recommended one-command build entry +└─ CMakeLists.txt CMake project entry ``` ## Quick Start -Download a release package, then register the DLL that matches your host process bitness: +Download a release package and use the DLL that matches the bitness of your host process. COM usage requires registration: ```powershell # 32-bit host process -regsvr32 op_x86.dll +regsvr32 .\op_x86.dll # 64-bit host process -regsvr32 op_x64.dll +regsvr32 .\op_x64.dll ``` -Minimal Python example: +Minimal Python example through COM: ```python from win32com.client import Dispatch @@ -87,28 +99,88 @@ For registration-free usage, see the Wiki: - [Python registration-free example](https://github.com/WallBreaker2/op/wiki/demo/python-regfree) - [C# / Lua / Golang / Rust / Node.js / Java demos](https://github.com/WallBreaker2/op/wiki/Home) +## Python + +The `op-plugins` wheel is for users who want to use `pyop` directly. It supports Python 3.9-3.12 and provides both `win32` and `win_amd64` builds: + +```powershell +pip install op-plugins +``` + +```python +from pyop import Op + +op = Op() +print("op version:", op.Ver()) +``` + +To install a specific wheel from GitHub Releases, replace `` and `` with the actual names: + +```powershell +pip install https://github.com/WallBreaker2/op/releases/download//.whl +``` + +Notes: + +- 64-bit Python needs a `win_amd64` wheel; 32-bit Python needs a `win32` wheel +- The wheel already includes the OP runtime files for the matching architecture +- `bindings/python` is a separate `ctypes` wrapper over the C API. Use it when you want to call `op_c_api_*.dll` directly instead of going through the SWIG `pyop` module + +Verify the installation: + +```powershell +python -c "from pyop import Op; print(Op().Ver())" +``` + ## Build Requirements: +- Windows 10 or newer - Visual Studio 2022 or newer - CMake 3.24 or newer -- Windows SDK 10.0.19041.0 or newer +- Python 3.12 for build scripts, SWIG bindings, and test tools -Recommended build entry: +Use `build.py` from the repository root: ```powershell -# Default: Release + x64 -python build.py +# Release x64, matching the current CI setup +python build.py -g vs2026 -t Release -a x64 # Build x86 -python build.py -a x86 +python build.py -g vs2026 -t Release -a x86 # Debug build -python build.py -t Debug +python build.py -g vs2026 -t Debug -a x64 + +# If your machine uses VS2022, switch the generator +python build.py -g vs2022 -t Release -a x64 +``` + +Release artifacts are installed to `bin/x86` or `bin/x64`. A release package normally contains: + +```text +op_x86.dll / op_x64.dll +op_c_api_x86.dll / op_c_api_x64.dll +tools.dll +_pyop.pyd +pyop.py +lib/op_c_api_x86.lib / lib/op_c_api_x64.lib ``` -Release artifacts are installed to `bin/x86` or `bin/x64`. +Build a local wheel: + +```powershell +pip install scikit-build-core setuptools-scm +.\scripts\build_wheel.ps1 +``` + +For a manual wheel build, run `build.py` once first so native dependencies are bootstrapped: + +```powershell +python build.py -g vs2026 -t Release -a x64 +pip wheel . --no-deps -w wheelhouse +``` ## Community @@ -124,4 +196,3 @@ Release artifacts are installed to `bin/x86` or `bin/x64`. - [TSPLUG](https://github.com/tcplugins/tsplug) - [Kiero](https://github.com/Rebzzel/kiero) - diff --git a/libop/readme.md b/libop/readme.md index 5833e3a..ae38ad5 100644 --- a/libop/readme.md +++ b/libop/readme.md @@ -1,10 +1,19 @@ # 文件目录 -* op:C++ 主接口 op::Op 的分文件实现 -* binding:窗口绑定与后台模式调度 -* capture:前台截图、后台(gdi,opengl,dx,wgc)截图和采集后端 -* input:鼠标键盘操作 -* hook:显示/输入 hook、注入协议和导出入口 -* common:图像、颜色、字库、共享内存等内部基础结构 -* image:找图,OCR等图像操作功能的实现 -* algorithm:op项目实现的一些算法 -* com: op插件提供给用户的com接口 + +* algorithm:内部算法与通用计算逻辑 +* base:基础类型、运行环境、工具函数和平台判断 +* binding:窗口绑定、后台模式选择和截图/输入调度 +* c_api:C 接口封装,供其他语言绑定调用 +* capture:GDI、DXGI、WGC、Hook 等截图后端 +* com:COM 组件导出和自动化接口实现 +* hook:显示/输入 hook、远端注入入口和共享帧写入 +* image:图片加载、颜色查找、模板匹配和图像搜索服务 +* input:鼠标、键盘输入后端和消息辅助逻辑 +* ipc:共享内存、互斥量、管道等进程间通信封装 +* memory:目标进程内存读写相关能力 +* network:HTTP 客户端等网络辅助能力 +* ocr:字库管理和 OCR 识别实现 +* op:C++ 主接口 `op::Op` 的分文件实现 +* opencv:OpenCV 功能桥接、模板匹配和图像处理接口 +* window:窗口枚举、进程信息、DLL 注入等窗口相关能力 +* yolo:YOLO 检测器封装 From b85702798470bf0678191f73bcd9438ebbea47aa Mon Sep 17 00:00:00 2001 From: qiannian <40210590@qq.com> Date: Sun, 5 Jul 2026 19:18:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?Chore(version):=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E5=88=B0=200.4.8.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bindings/python/pyproject.toml | 2 +- libop/CMakeLists.txt | 2 +- libop/base/AutomationModes.h | 2 +- libop/c_api/op_c_api.rc | 8 ++++---- libop/com/op.rc | Bin 5816 -> 5816 bytes pyproject.toml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bindings/python/pyproject.toml b/bindings/python/pyproject.toml index a40287c..d2d60ae 100644 --- a/bindings/python/pyproject.toml +++ b/bindings/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "op-capi" -version = "0.1.0" +version = "0.4.8.2" description = "ctypes wrapper for OP C API DLL" readme = "README.md" requires-python = ">=3.10" diff --git a/libop/CMakeLists.txt b/libop/CMakeLists.txt index 5cd40bc..5fc319b 100644 --- a/libop/CMakeLists.txt +++ b/libop/CMakeLists.txt @@ -285,7 +285,7 @@ set(OP_COMMON_DEFINITIONS _SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING _UNICODE UNICODE - OP_VERSION="0.4.8.1" + OP_VERSION="0.4.8.2" ) if(DEFINED OP_ARCH_DEFINITION AND NOT OP_ARCH_DEFINITION STREQUAL "") list(APPEND OP_COMMON_DEFINITIONS "${OP_ARCH_DEFINITION}") diff --git a/libop/base/AutomationModes.h b/libop/base/AutomationModes.h index 79e35b2..c0fefc1 100644 --- a/libop/base/AutomationModes.h +++ b/libop/base/AutomationModes.h @@ -102,7 +102,7 @@ extern long MOUSE_DX_DELAY; #define MAKE_OP_VERSION(a, b, c, d) _TOSTRING(a##.##b##.##c##.##d) #ifndef OP_VERSION -#define OP_VERSION MAKE_OP_VERSION(0, 4, 8, 1) +#define OP_VERSION MAKE_OP_VERSION(0, 4, 8, 2) #endif // OP_VERSION // 模块句柄 // extern HINSTANCE gInstance; diff --git a/libop/c_api/op_c_api.rc b/libop/c_api/op_c_api.rc index f8e6301..aebd9ce 100644 --- a/libop/c_api/op_c_api.rc +++ b/libop/c_api/op_c_api.rc @@ -6,8 +6,8 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,4,8,1 - PRODUCTVERSION 0,4,8,1 + FILEVERSION 0,4,8,2 + PRODUCTVERSION 0,4,8,2 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -24,11 +24,11 @@ BEGIN BEGIN VALUE "CompanyName", "op" VALUE "FileDescription", "op C API DLL" - VALUE "FileVersion", "0.4.8.1" + VALUE "FileVersion", "0.4.8.2" VALUE "InternalName", "op_c_api.dll" VALUE "OriginalFilename", "op_c_api.dll" VALUE "ProductName", "op" - VALUE "ProductVersion", "0.4.8.1" + VALUE "ProductVersion", "0.4.8.2" END END BLOCK "VarFileInfo" diff --git a/libop/com/op.rc b/libop/com/op.rc index ca3980242f1190f44d43943ecc7fff954f310880..a91633226b1267e39291843ac553ea6f5098642e 100644 GIT binary patch delta 38 scmdm?yF+(_7Z;<^WN$7*Mx)KOT+f++oP|8Pn=0.10", "setuptools-scm>=8"] build-backend = "scikit_build_core.build" [tool.setuptools_scm] -fallback_version = "0.0.0" +fallback_version = "0.4.8.2" [tool.scikit-build] minimum-version = "build-system.requires"