Screen-capturer: A cross-platform screenshots library for MacOS、Windows、Linux(X11).

Overview

screen-capturer

A cross-platform screen capturer library for MacOS、Windows、Linux(X11).

example

use screen_capturer::ScreenCapturer;
use std::{fs::File, io::Write, time::Instant};

fn main() {
  let start = Instant::now();

  let screen_capturers = ScreenCapturer::all();

  for screen_capturer in screen_capturers {
    println!("capturer {:?}", screen_capturer);
    let image = screen_capturer.capture().unwrap();
    let buffer = image.png().unwrap();
    let display_id = screen_capturer.display_info.id.to_string();
    let path = String::from("") + &display_id + ".png";
    let mut file = File::create(path).unwrap();
    file.write_all(&buffer[..]).unwrap();
  }

  let screen_capturer = ScreenCapturer::from_point(100, 100).unwrap();
  println!("capturer {:?}", screen_capturer);

  let image = screen_capturer.capture().unwrap();
  let buffer = image.png().unwrap();
  let mut file = File::create("capture_display_with_point.png").unwrap();
  file.write_all(&buffer[..]).unwrap();

  println!("运行耗时: {:?}", start.elapsed());
}
Comments
  • no method named `capture` found for struct `Vec<Screen>` in the current scope

    no method named `capture` found for struct `Vec` in the current scope

    error[E0599]: no method named capture found for struct Vec<Screen> in the current scope --> src/main.rs:10:28 | 10 | let mut image = screen.capture().unwrap(); | ^^^^^^^ method not found in Vec<Screen>

    error[E0609]: no field id on type Vec<Screen> --> src/main.rs:12:47 | 12 | fs::write(format!("target/{}.png", screen.id.to_string()), &buffer).unwrap(); | ^^ unknown field

    error[E0599]: no method named capture_area found for struct Vec<Screen> in the current scope --> src/main.rs:14:20 | 14 | image = screen.capture_area(300, 300, 300, 300).unwrap(); | ^^^^^^^^^^^^ method not found in Vec<Screen>

    error[E0609]: no field id on type Vec<Screen> --> src/main.rs:16:49 | 16 | fs::write(format!("target/{}-2.png", screen.id.to_string()), &buffer).unwrap(); | ^^ unknown field

    Some errors have detailed explanations: E0599, E0609. For more information about an error, try rustc --explain E0599. error: could not compile screen_shot due to 4 previous errors

    opened by LeeeSe 5
  • Feature Request: Screenshot Region of Screen

    Feature Request: Screenshot Region of Screen

    First of all, thank you very much for your work! I would like to request a specific feature, which I've found missing both in this crate and in many similar ones:

    • Screenshotting only a region of the screen

    Similar to what PyAutoGUI does with its region optional argument

    opened by mdacach 3
  • Why screenshot making process takes 5 seconds?

    Why screenshot making process takes 5 seconds?

    Hello, your library is a big help as I did not find anything easier to work with but I wonder what makes the process of taking a screenshot take a whole of 5 seconds? For me on MacOS m1 it takes 5 seconds. Can this be improved? Thanks

    opened by OlegGulevskyy 3
  • cross-compiling from linux to windows fails

    cross-compiling from linux to windows fails

    error: linking with cc failed: exit status: 1 | = note: "cc" "-m64" "/tmp/rustcwUf8e2/symbols.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/screenshots-2a5ce0adf1b1ace7/build_script_build-2a5ce0adf1b1ace7.build_script_build.643d639c-cgu.0.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/screenshots-2a5ce0adf1b1ace7/build_script_build-2a5ce0adf1b1ace7.build_script_build.643d639c-cgu.1.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/screenshots-2a5ce0adf1b1ace7/build_script_build-2a5ce0adf1b1ace7.build_script_build.643d639c-cgu.2.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/screenshots-2a5ce0adf1b1ace7/build_script_build-2a5ce0adf1b1ace7.build_script_build.643d639c-cgu.3.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/screenshots-2a5ce0adf1b1ace7/build_script_build-2a5ce0adf1b1ace7.build_script_build.643d639c-cgu.4.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/screenshots-2a5ce0adf1b1ace7/build_script_build-2a5ce0adf1b1ace7.build_script_build.643d639c-cgu.5.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/screenshots-2a5ce0adf1b1ace7/build_script_build-2a5ce0adf1b1ace7.build_script_build.643d639c-cgu.6.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/screenshots-2a5ce0adf1b1ace7/build_script_build-2a5ce0adf1b1ace7.build_script_build.643d639c-cgu.7.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/screenshots-2a5ce0adf1b1ace7/build_script_build-2a5ce0adf1b1ace7.36p8dj9b6t45s9f7.rcgu.o" "-Wl,--as-needed" "-L" "/home/morgan/programming/rust/screeninfo_test/target/release/deps" "-L" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-5670385a2fe8b60b.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-fd56ba6dbf7aaecc.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-b8acf8e5c2e85baa.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-1706edefffdca0a2.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-f483302e0b13708e.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-725b0718fc18e1ed.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-de685fcf2157e6fb.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-f613ac3eda05b9ff.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-3de98a7d049af6a1.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-c12183655bdce152.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-0fc7beea925de7e3.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-8c34825485bf59dc.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-ba5f7e926e729d81.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-643de0950163a839.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-539ea2f72ef89687.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-871432094bb4c885.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-ef1a8ee61f2e39bf.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-f1646747442c1c7b.rlib" "-Wl,--end-group" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-ff283b4bf550fa1c.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/screenshots-2a5ce0adf1b1ace7/build_script_build-2a5ce0adf1b1ace7" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs" = note: /usr/x86_64-w64-mingw32/bin/ld: unrecognised emulation mode: elf_x86_64 Supported emulations: i386pep i386pe collect2: error: ld returned 1 exit status

    error: could not compile screenshots due to previous error warning: build failed, waiting for other jobs to finish... error: linking with cc failed: exit status: 1 | = note: "cc" "-m64" "/tmp/rustcKg3gu9/symbols.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.0.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.1.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.10.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.11.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.12.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.13.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.14.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.15.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.2.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.3.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.4.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.5.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.6.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.7.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.8.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.build_script_build.35cb89b0-cgu.9.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917.49nzjwdncc56ijce.rcgu.o" "-Wl,--as-needed" "-L" "/home/morgan/programming/rust/screeninfo_test/target/release/deps" "-L" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-5670385a2fe8b60b.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-fd56ba6dbf7aaecc.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-b8acf8e5c2e85baa.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-1706edefffdca0a2.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-f483302e0b13708e.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-725b0718fc18e1ed.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-de685fcf2157e6fb.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-f613ac3eda05b9ff.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-3de98a7d049af6a1.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-c12183655bdce152.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-0fc7beea925de7e3.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-8c34825485bf59dc.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-ba5f7e926e729d81.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-643de0950163a839.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-539ea2f72ef89687.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-871432094bb4c885.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-ef1a8ee61f2e39bf.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-f1646747442c1c7b.rlib" "-Wl,--end-group" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-ff283b4bf550fa1c.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-a00b4f76f52ef917/build_script_build-a00b4f76f52ef917" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs" = note: /usr/x86_64-w64-mingw32/bin/ld: unrecognised emulation mode: elf_x86_64 Supported emulations: i386pep i386pe collect2: error: ld returned 1 exit status

    error: could not compile windows_x86_64_gnu due to previous error error: linking with cc failed: exit status: 1 | = note: "cc" "-m64" "/tmp/rustcbszz2n/symbols.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.0.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.1.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.10.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.11.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.12.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.13.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.14.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.15.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.2.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.3.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.4.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.5.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.6.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.7.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.8.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.build_script_build.8b59c8bd-cgu.9.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897.4nbrrbyk8zthh2os.rcgu.o" "-Wl,--as-needed" "-L" "/home/morgan/programming/rust/screeninfo_test/target/release/deps" "-L" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-5670385a2fe8b60b.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-fd56ba6dbf7aaecc.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-b8acf8e5c2e85baa.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-1706edefffdca0a2.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-f483302e0b13708e.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-725b0718fc18e1ed.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-de685fcf2157e6fb.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-f613ac3eda05b9ff.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-3de98a7d049af6a1.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-c12183655bdce152.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-0fc7beea925de7e3.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-8c34825485bf59dc.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-ba5f7e926e729d81.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-643de0950163a839.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-539ea2f72ef89687.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-871432094bb4c885.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-ef1a8ee61f2e39bf.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-f1646747442c1c7b.rlib" "-Wl,--end-group" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-ff283b4bf550fa1c.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/windows_x86_64_gnu-0a7dbf4e76120897/build_script_build-0a7dbf4e76120897" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs" = note: /usr/x86_64-w64-mingw32/bin/ld: unrecognised emulation mode: elf_x86_64 Supported emulations: i386pep i386pe collect2: error: ld returned 1 exit status

    error: could not compile windows_x86_64_gnu due to previous error error: linking with cc failed: exit status: 1 | = note: "cc" "-m64" "/tmp/rustcRLpQUj/symbols.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.0.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.1.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.10.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.11.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.12.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.13.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.14.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.15.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.2.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.3.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.4.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.5.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.6.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.7.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.8.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.build_script_build.89cd8602-cgu.9.rcgu.o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64.11mbwdirp3969nk9.rcgu.o" "-Wl,--as-needed" "-L" "/home/morgan/programming/rust/screeninfo_test/target/release/deps" "-L" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-5670385a2fe8b60b.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-fd56ba6dbf7aaecc.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-b8acf8e5c2e85baa.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-1706edefffdca0a2.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-f483302e0b13708e.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-725b0718fc18e1ed.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-de685fcf2157e6fb.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-f613ac3eda05b9ff.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-3de98a7d049af6a1.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-c12183655bdce152.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-0fc7beea925de7e3.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-8c34825485bf59dc.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-ba5f7e926e729d81.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-643de0950163a839.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-539ea2f72ef89687.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-871432094bb4c885.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-ef1a8ee61f2e39bf.rlib" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-f1646747442c1c7b.rlib" "-Wl,--end-group" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-ff283b4bf550fa1c.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/morgan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/morgan/programming/rust/screeninfo_test/target/release/build/crc32fast-ec59e83ab7b5bc64/build_script_build-ec59e83ab7b5bc64" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs" = note: /usr/x86_64-w64-mingw32/bin/ld: unrecognised emulation mode: elf_x86_64 Supported emulations: i386pep i386pe collect2: error: ld returned 1 exit status

    error: could not compile crc32fast due to previous error

    opened by mtlhdnrd 1
  • fix: Fix memory leak issue in screen.capture() [Linux]

    fix: Fix memory leak issue in screen.capture() [Linux]

    XImage pointer was not being released at the end of the function.

    I've found the following function which seems to have solved the issue: https://tronche.com/gui/x/xlib/utilities/XDestroyImage.html

    The following test script was used. It does not keep consuming memory anymore, so I think the issue is solved. https://gist.github.com/mdacach/3ccc93751af3ee125739b2f994b85e03

    P.S. I've found a simple XFree(data as *mut _) to also solve the issue, which I don't fully understand because the image pointer would still leak, I think.

    opened by mdacach 1
  • Memory leak when running screen.capture() multiple times [Linux]

    Memory leak when running screen.capture() multiple times [Linux]

    Hello, hope this message finds you well!

    [Manjaro 21.3.2]

    The Issue

    When calling screen.capture() multiple times, the program increasingly consumes memory.

    Example

    Running screen.capture() in an infinite loop eventually leads to an OS freeze. image

    opened by mdacach 1
  • capture() fn returning none is some mac

    capture() fn returning none is some mac

    My friend uses this crate for taking screenshots in Mac OS X (version 12.2.1), but after the Mac OS X update (version 13.0.1), In capture fn, it returns null. Is this crate dependent on any driver or software on the Mac?

    opened by rapidshaurya 1
  • Added support to get all pixels(x,y,r,g,b) or specfic pixel.

    Added support to get all pixels(x,y,r,g,b) or specfic pixel.

    I added two functions to get all or individual pixels of the image returning the position and the RGB. I also updated the readme with the 2 examples (all pixels and a specific pixel).

    I hope you see the benefit and believe it's an improvement. Any questions please contact me and feel free to edit the code (today is my first day with rust so suggestions for improvement are very welcome).

    opened by WilgnerFSDev 2
Owner
nashaofu
Stay hungry. Stay foolish. ✨🐢🚀✨
nashaofu
A Simple-to-use, cross-platform Rust Webcam Capture Library

Cross Platform Rust Library for powerful Webcam Capture and Virtual Webcams

null 246 Jan 8, 2023
A cross platform reloading image viewer combined with a command executor

Watchout A cross platform reloading image viewer combined with a command executor. Watchout will do any of the following: Run a command when any file

Benedikt Terhechte 6 Oct 7, 2022
A cross-platform tool for embedding GPS data into photographs

nya-exif 中文 | English 介绍 nya-exif 是一个用于匹配照片 GPS 信息, 并写入文件 EXIF 信息的工具, 支持 JPEG 和 PNG 及各大相机厂商的主流RAW格式. 本工具基于 Rust 编写, 支持全平台使用 Features 支持 JPEG 和 PNG 及各大

Lyn Chen 32 Nov 16, 2023
An experimental gif encoder for Windows 10.

giffun An experimental gif encoder for Windows 10. Resources Based on "Techniques for GPU-based Color Quantization" (2019) by Matthias Trapp, Sebastia

Robert Mikhayelyan 3 Dec 22, 2021
Control Google Pixel Buds Pro from the Linux command line.

pbpctrl Control Google Pixel Buds Pro from the Linux command line. Might or might not work on other Pixel Buds devices. Allows reading of battery, har

Maximilian Luz 6 Jan 10, 2023
A Rust library for calculating perceptual hash values of images

img_hash Now builds on stable Rust! (But needs nightly to bench.) A library for getting perceptual hash values of images. Thanks to Dr. Neal Krawetz f

Austin Bonander 264 Dec 9, 2022
A simple steganography library written in rust

steganography A stable steganography library written in rust Crates.io Usage Add the following to the Cargo.toml in your project: [dependencies] stega

Teodor Voinea 79 Dec 9, 2022
Face detection library for the Rust programming language

Rustface SeetaFace detection library for the Rust programming language Example of demo program output SEETAFACE C++ – Github repository for the origin

Andrei Tomashpolskiy 323 Dec 27, 2022
2D polyline/shape library for offsetting, combining, etc.

This project is a continuation of the C++ CavalierContours library rewritten in Rust with the goal of building out more functionality, better

Jedidiah Buck McCready 59 Jan 6, 2023
resvg is an SVG rendering library.

resvg can be used as a Rust library, a C library and as a CLI application to render SVG files based on a static SVG Full 1.1 subset.

Evgeniy Reizner 1.8k Dec 30, 2022
A linear algebra and mathematics library for computer graphics.

cgmath-rs A linear algebra and mathematics library for computer graphics. The library provides: vectors: Vector2, Vector3, Vector4 square matrices: Ma

rustgd 998 Jan 2, 2023
😱 Dead fast thumbnail library for browser and NodeJs! Built with Rust 🦀 and WebAssembly 🕸

thumbo-core ?? Dead fast thumbnail library for browser and NodeJs Built with Rust ?? & WebAssembly ?? ?? About thumbo-core is a thubnail library for b

Victor Aremu 12 Dec 2, 2022
Rust library for fast image resizing with using of SIMD instructions.

fast_image_resize Rust library for fast image resizing with using of SIMD instructions. CHANGELOG Supported pixel formats and available optimisations:

Kirill Kuzminykh 115 Jan 5, 2023
PNG decoding and encoding library in pure Rust

PNG Decoder/Encoder PNG decoder/encoder in pure Rust. It contains all features required to handle the entirety of the PngSuite by Willem van Schack. p

image-rs 247 Dec 25, 2022
An advanced image processing library for Rust.

ImageProc Maintainers: @chyh1990 Note: this project is under active depvelopment, API may change! imageproc is a advanced image proccessing library fo

Chen Yuheng 97 Oct 18, 2022
Rust library to get image size and format without loading/decoding

imageinfo-rs Rust library to get image size and format without loading/decoding. The imageinfo don't get image format by file ext name, but infer by f

xiaozhuai, Weihang Ding 47 Dec 30, 2022
Image operation rust library

Image operation rust library

LongYinan 166 Dec 20, 2022
ePaperify: Framebuffer/image pre-processing library for e-Paper displays

ePaperify: Framebuffer/image pre-processing library for e-Paper displays

Jackson Ming Hu 5 Mar 15, 2022
Antialiased 2D vector drawing library in Rust for Android, Web, Desktop

nonaquad Vector anti-aliased graphics renderer for Android, WASM, Desktop in Rust, using miniquad. This library started as a port of NanoVG for miniqu

Nokola 33 Nov 14, 2022