Socket
Socket
Sign inDemoInstall

github.com/efunn/go-scrap

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/efunn/go-scrap

Package scrap is a Go wrapper around the Rust https://github.com/quadrupleslap/scrap library. It supports reasonably fast capturing of raw screen pixels. The library dependency is only at compile time and statically compiled into the binary. Since go-scrap statically links the Scrap library, the scrap-sys subdirectory Rust project must be built in release mode before compiling this project. See the README at https://github.com/cretz/go-scrap for more info.


Version published

Readme

Source

go-scrap GoDoc

go-scrap is a Go wrapper around the Rust scrap library. It supports reasonably fast capturing of raw screen pixels. The library dependency is only at compile time and statically compiled into the binary. It works on Windows, Linux, and macOS.

Building

Obtain the library, e.g. use go get with -d to not install yet:

go get -d github.com/cretz/go-scrap

Now, the Rust subproject scrap-sys must be compiled which is glue between the Go library and the Rust library. With Rust installed, this can is done by running the following in the scrap-sys/ subdirectory:

cargo build --release

Note: On Windows this must use the same gcc that Cgo would. Go does not support MSVC-compiled libraries yet. The easiest way to ensure this is with rustup by running rustup default stable-x86_64-pc-windows-gnu before building.

Note: On Linux this needs the X11 XCB libraries with the Shm and RandR extensions. On Ubuntu (18.04+ since RandR must be >= 1.12) they are packages named libx11-xcb-dev, libxcb-shm0-dev, and libxcb-randr0-dev respectively.

Now that the dependency is built, the library can be built. For example, take a screenshot:

go run ./example/screenshot

See the Godoc for more documentation and examples.

FAQs

Last updated on 13 Mar 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc