MCPcopy Create free account
hub / github.com/Recordscript/recordscript / get_image

Method get_image

libs/scrap/src/x11/capturer.rs:75–94  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

73 }
74
75 fn get_image(&self) {
76 let rect = self.display.rect();
77 unsafe {
78 let request = xcb_shm_get_image_unchecked(
79 self.display.server().raw(),
80 self.display.root(),
81 rect.x,
82 rect.y,
83 rect.w,
84 rect.h,
85 !0,
86 XCB_IMAGE_FORMAT_Z_PIXMAP,
87 self.xcbid,
88 0,
89 );
90 let response =
91 xcb_shm_get_image_reply(self.display.server().raw(), request, ptr::null_mut());
92 libc::free(response as *mut _);
93 }
94 }
95
96 pub fn frame<'b>(&'b mut self) -> std::io::Result<&'b [u8]> {
97 self.get_image();

Callers 1

frameMethod · 0.80

Calls 4

rectMethod · 0.80
rawMethod · 0.80
serverMethod · 0.80
rootMethod · 0.80

Tested by

no test coverage detected