Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shotgun Rust Library #46

Open
Swivelgames opened this issue Oct 10, 2023 · 1 comment
Open

Shotgun Rust Library #46

Swivelgames opened this issue Oct 10, 2023 · 1 comment

Comments

@Swivelgames
Copy link

I use shotgun daily for taking screenshots. But it just occurred to me that it's written in Rust.

I have need for capturing screenshots, and I was wondering if there was any interest in providing shotgun as a lib, in addition to a cli tool.

Any chance the functionality here could be split out into a lib.rs that could be used by other Rust projects? If that was done, it may be relatively straightforward to have the main.rs as a wrapper for the lib to continue to provide functionality.

Thoughts?

@9ary
Copy link
Member

9ary commented Oct 10, 2023

This was previously requested in #6, and attempted in #21. I won't work on this but I'll review a PR implementing it.
The previous work may or may not be usable because the code has evolved since.

Here's what I would expect this to look like:

  • an options struct as a builder pattern
  • a single capture function that returns an unencoded image, with all the processing done
  • error reporting needs to be improved, right now we mostly discard error information but a library user should reasonably expect all errors to be propagated
  • the CLI should use the library API
  • ideally, the library user should be able to pass their own x11 connection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants