This project provides a Rust-based implementation for capturing, processing, and displaying graphics on Windows using the Windows Graphics Capture API. The project includes custom handling of pixel data, image processing algorithms, and terminal-based rendering.
To build and run this project, you'll need to have Rust installed. You can install Rust from here.
The project relies on the following crates:
windows_capturefor window capturing and frame handling.crosstermfor terminal manipulation.winapiandkernel32for Windows API interactions.
Add the following to your Cargo.toml file:
[dependencies]
windows_capture = "0.1"
crossterm = "0.26"
winapi = { version = "0.3", features = ["wincon", "winnls"] }
kernel32 = "0.1"- Build the project
cargo build - Run the project
cargo run
Currently you need to specify the window title of the window you want to capture within main.rs. And any postprocessing needs to be applied onto the pixel map in canvas.
- Follow Rust's standard coding style guidelines. This includes conventions like using
snake_casefor variable and function names,CamelCasefor structs and enums, andUPPER_SNAKE_CASEfor constants. - Indentation: Use 4 spaces per indentation.
- Line Length: Keep lines under 120 characters.
- Error Handling: Use
ResultandOptiontypes to propagate errors using the?operator where applicable. - Code Structure: Keep functions short and focused, and group related functions and structs in modules.