mirror of
https://github.com/hanzoai/rustautogui.git
synced 2026-10-30 18:23:05 +00:00
* opencl first buggy implementation * more work on opencl. Buggy atm * WORKING ALGORITHM ATM but slow * working opencl code with implemented 2 step fully * first reworks. addition of new fields in struct and some cleanup * more changes. added a struct for memory buffers, creation of it, new functions for gui dedicated opencl template match * more changes, no errors * added to main functions in lib. Not tested yet * first tests done, code working. Needs more optimisation * some testing prints, code retested after fix in time measurement. Looks promising * revert back * tested optimisations reimplemented and working * a bit more optimisations * added opencl feature * fmt * added change ocl state, graceful exits * windows fix * small optimisation * macos fix * different variations of tests * currently a fine solution to auto determine treshold of fast segmentation * derivative activation only in opencl mode * readme update * add v2 algorithm * added table of contents to readme * update changelog (no date included yet) * moved all the additional v2 buffers under GpuMemoryPointers struct * additional work on v2 * unifying v1 and v2 kernels + other data * working on adding devices info * more work done on detecting devices, creating kernels and moving kernels to precalculated * working state of code. Implemented different OCL things, Kernel building outside of OCL Kernel storage, most of logic for V2. * added v2 into logic. remaining to create standalone lib.rs functions * various fixes * added precision to buffer passed to GPU and updated * adding more matchmodes and covering * cleaning up code * moving some enums to structs * changes on lots of stuff, including changing device for OCL * implemented lite feature * changes on lite code, removed problems * renamed template match * cleaned unnecesary conditions * fixed issue with memory not cleaned up on v2 * readme update and fix on matchmode * fix for region on ocl matching * fixes for ltie mode * added opencl example * fix for v2 opencl * fix on opencl device choice to not take cpu * lite fixes on macos * linux fixes * windows fix * moved files to CORE folder * full code restructure * full code restructure * started with testing * more tests * additional mac tests * linux additions * linux fixes + cargo.toml editing * more fixes * clippy fixes * github action update --------- Co-authored-by: DavorMar <[email protected]>
28 lines
992 B
Rust
28 lines
992 B
Rust
// run with cargo test --tests --release -- --nocapture
|
|
|
|
#[cfg(feature = "dev")]
|
|
pub mod mouse_tests {
|
|
use rustautogui;
|
|
|
|
#[test]
|
|
fn execute_tests() {
|
|
let mut gui = rustautogui::RustAutoGui::new(false).unwrap();
|
|
let (s_w, s_h) = gui.get_screen_size();
|
|
|
|
let center_x = (s_w / 2) as u32;
|
|
let center_y = (s_h / 2) as u32;
|
|
|
|
// makes a square movement around the center
|
|
gui.move_mouse_to_pos(center_x, center_y, 0.5).unwrap();
|
|
gui.move_mouse(-(center_x as i32 / 2), 0, 0.5).unwrap();
|
|
gui.move_mouse(0, -(center_y as i32 / 2), 0.5).unwrap();
|
|
gui.move_mouse_to(Some(center_x + center_x / 2), None, 0.5)
|
|
.unwrap();
|
|
gui.move_mouse_to_pos(center_x + center_x / 2, center_y + center_y / 2, 0.5)
|
|
.unwrap();
|
|
gui.move_mouse(-3 * s_w / 4, 0, 1.5).unwrap();
|
|
gui.move_mouse_to(None, Some(s_h as u32 / 2), 0.5).unwrap();
|
|
gui.move_mouse(s_w - 1, 0, 1.5).unwrap();
|
|
}
|
|
}
|