linux x11 rgb565 capture (#8580)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2024-07-03 14:20:41 +08:00
committed by GitHub
parent 6d2e985593
commit d00582e929
7 changed files with 165 additions and 45 deletions

View File

@@ -2,6 +2,7 @@ use std::rc::Rc;
use super::ffi::*;
use super::Server;
use crate::Pixfmt;
#[derive(Debug)]
pub struct Display {
@@ -10,6 +11,7 @@ pub struct Display {
rect: Rect,
root: xcb_window_t,
name: String,
pixfmt: Pixfmt,
}
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
@@ -27,6 +29,7 @@ impl Display {
rect: Rect,
root: xcb_window_t,
name: String,
pixfmt: Pixfmt,
) -> Display {
Display {
server,
@@ -34,6 +37,7 @@ impl Display {
rect,
root,
name,
pixfmt,
}
}
@@ -59,4 +63,8 @@ impl Display {
pub fn name(&self) -> String {
self.name.clone()
}
pub fn pixfmt(&self) -> Pixfmt {
self.pixfmt
}
}