visual-cortex 0.2.1

Watch screen regions and receive typed events over async streams when patterns match: OCR, template matching, and pixel conditions on live captures.
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Manual smoke test — run on macOS with Screen Recording permission granted:
//!   cargo test -p visual_cortex --test real_capture -- --ignored
#![cfg(target_os = "macos")]

use visual_cortex::{FrameSource, ScapSource, Target};

#[tokio::test]
#[ignore = "requires macOS Screen Recording permission and a live display"]
async fn captures_one_display_frame() {
    let mut src = ScapSource::new(&Target::display(0), true).expect("start capturer");
    let frame = src.capture_frame().await.expect("capture a frame");
    assert!(frame.width() > 0 && frame.height() > 0);
}