Upscale window content effect

Hello,
I would like to try to create a KWin QML effect, but I’m not sure, if what I want to do is even possible with the QML.

The effect I would like to create would be the “Upscale window effect”. Basically take an old game running in a small window (e.g. 640x480) and upscale it to fullscreen. The game can be anything from a DOSBox to the Wine Desktop wndow or even some emulator app. The effect would be activated and deactivated via keyboard shortcut.

I’m not sure, whether it is possible to pass the mouse inputs to the upscaled window in the QML effect. In e.g. upscaled Age of Empires, or Diablo etc., the mouse coordinates passed to the window would have to be corrected (just like in the built-in zoom effect). The built-in zoom effect almost does exactly what I need, but it currently can’t zoom to exactly fit the selected window.

There are many additional ideas to improve the effect later, if the basic concept works (including possible applying of custom GLSL shader).

Thanks for any help.