AndrewFromMelbourne / raspi2fb

Program to copy the Raspberry Pi display to a secondary framebuffer.
MIT License
94 stars 27 forks source link

add support for copying arbitrary rectangle from src fb to dest fb #7

Closed tangentaudio closed 4 years ago

tangentaudio commented 6 years ago

By default raspi2fb will copy the entire source framebuffer and scale it to fit on the destination framebuffer. I have an application where I want to copy a small window from the source framebuffer to a destination framebuffer, with a 1:1 pixel mapping and no scaling. I added a few new command line args to support this option.

--copyrect enables this new mode --rectx specifies the X position in the source framebuffer --recty specifies the Y position in the source framebuffer

The photo below shows a PyQt5/QML application directly rendering a 1024x768 image to the primary framebuffer via EGLFS. The actual user interface is rendered in a small 160x128 window inside of that larger window, and the modified raspi2fb is used to replicate only that portion on a 1.8" SPI TFT. The remaining area of the large window will be used for diagnostics and debug in my application.

img_20180211_083535178_2