visual-cortex 0.9.0

Watch screen regions and receive typed events over async streams when patterns match: OCR, template matching, and pixel conditions on live captures.
//! Dump real frames from a display to prove the macOS capture path end to end.
//! Run on macOS (grant Screen Recording permission when prompted):
//!   cargo run -p visual_cortex --example mirror

#[cfg(target_os = "macos")]
#[tokio::main]
async fn main() -> visual_cortex::Result<()> {
    use visual_cortex::{FrameSource, ScapSource, Target};

    let mut src = ScapSource::new(&Target::display(0), true)?;
    println!("capturing 5 frames from display 0...");
    for i in 0..5 {
        let frame = src.capture_frame().await?;
        println!(
            "frame {i}: {}x{}, {} bytes",
            frame.width(),
            frame.height(),
            frame.data().len()
        );
    }
    println!("done");
    Ok(())
}

#[cfg(not(target_os = "macos"))]
fn main() {
    eprintln!(
        "the mirror example requires macOS (ScreenCaptureKit); \
         other platforms arrive in milestone 5."
    );
}