简体   繁体   English

如何操作屏幕输出?

[英]How can I manipulate screen output?

I'm planning a new project tha would probably involve the manipulation of screen outputs on Linux systems. 我正在计划一个新项目,可能会涉及在Linux系统上操纵屏幕输出。 The idea is to use a camera to detect a person standing in front of a projector and remove that part of the image that would be projected onto the person. 这个想法是使用相机检测站在投影仪前面的人,并去除将被投影到该人的那部分图像。 (So that at least the person is not blinded). (这样至少该人不会失明)。

So basically, I need a man-in-the-middle attack for a secondary monitor. 因此,基本上,我需要对辅助监视器进行中间人攻击。 I found XvfB which (as far as I understand it) can simulate a screen. 我发现XvfB(据我了解)可以模拟屏幕。 My idea is now to set up such a simulated screen, modify the content of the image and then send the new image to the real projector. 我的想法是现在建立一个模拟屏幕,修改图像内容,然后将新图像发送到真实的投影仪。

Has someone done something like this or has a completely different approach? 有人做了这样的事情还是采用了完全不同的方法?

I would use the Composite extension to do this. 我将使用Composite扩展来做到这一点。 You can take a simple composite manager, like compton as a base. 您可以使用简单的复合管理器(例如compton)作为基础。

The composite manager receives all other X11 client windows as framebuffers. 复合管理器将所有其他X11客户端窗口接收为帧缓冲区。 It can then render them in whatever fashion it likes on its own fullscreen window. 然后,它可以在自己的全屏窗口上以任意方式渲染它们。

In your case, the composite manager would deviate from its usual behaviour by masking out a specific region. 在您的情况下,复合管理器会屏蔽特定区域,从而偏离其通常的行为。 It seems to be a rather small change to do on existing codebase. 在现有代码库上进行的更改似乎很小。

Note that the window managers of the big desktops (KDE, Gnome, Unity…) all have a composite manager included. 请注意,大型桌面(KDE,Gnome,Unity…)的窗口管理器都包含一个复合管理器。 In this case, you cannot run your own but need to patch the composite module of the respective window manager. 在这种情况下,您将无法运行自己的程序,而需要修补相应窗口管理器的复合模块。

For your purpose however I guess it doesn't hurt to much to change to a simpler window manager + your custom composite manager solution. 但是,出于您的目的,我认为更改为更简单的窗口管理器+您的自定义复合管理器解决方案不会有多大伤害。

You could use X SHAPE extension: http://www.x.org/releases/X11R7.7/doc/xextproto/shape.html 您可以使用X SHAPE扩展名: http : //www.x.org/releases/X11R7.7/doc/xextproto/shape.html

Using that, you can create windows with irregular shapes. 使用它,您可以创建具有不规则形状的窗口。 (Like program xeyes does.) You could create a black fullscreen bordeless always-on-top window that will continuously change shape based on the mask you give it. (就像xeyes程序一样。)您可以创建一个黑色的全屏无色“总是在顶部”窗口,该窗口将根据您提供的蒙版不断更改形状。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM