{"id":18425259,"url":"https://github.com/uwerat/qpagbm","last_synced_at":"2025-04-07T16:31:40.499Z","repository":{"id":72975377,"uuid":"490627415","full_name":"uwerat/qpagbm","owner":"uwerat","description":"A Qt platform plugin for running Qt/OpenGL applications offscreen","archived":false,"fork":false,"pushed_at":"2022-08-29T14:02:20.000Z","size":25,"stargazers_count":13,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-22T21:07:41.330Z","etag":null,"topics":["gbm","qpa","qt","qtquick"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uwerat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-10T09:24:36.000Z","updated_at":"2025-02-17T15:37:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"6799eaf8-a33a-4402-93a1-64c121ca7c64","html_url":"https://github.com/uwerat/qpagbm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uwerat%2Fqpagbm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uwerat%2Fqpagbm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uwerat%2Fqpagbm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uwerat%2Fqpagbm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uwerat","download_url":"https://codeload.github.com/uwerat/qpagbm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247687938,"owners_count":20979568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gbm","qpa","qt","qtquick"],"created_at":"2024-11-06T05:03:21.056Z","updated_at":"2025-04-07T16:31:40.493Z","avatar_url":"https://github.com/uwerat.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Qt platform plugin for running Qt/OpenGL applications offscreen\n\n- https://doc.qt.io/qt-6/qpa.html\n- https://www.khronos.org/registry/EGL/extensions/MESA/EGL_MESA_platform_gbm.txt\n\nIt is supposed to work with Qt versions \u003e= 5.x in UNIXoid environments, where\nyou find an implementation of the Mesa Generic Buffer Management ( gbm ).\n\nThis platform allows running OpenGL applications without displaying anything\non physical screens. In this respect it is similar to the \"offscreen\" platform plugin,\nbut without being limited to OpenGL/X11.\n\nThe anticipated use cases will postprocess the frames:\n\n- remote desktop solutions ( f.e https://github.com/uwerat/vnc-eglfs )\n- \"screen\" recorder\n- test/development scenarios\n- ...\n\nMy own motivation for this platform plugin is related to the\n[EGLFS/VNC server project]( https://github.com/uwerat/vnc-eglfs ).\n\nThere are 2 environment variables, that can be used to configure the plugin\n\n    - GBM_SCREEN_SIZE\n\n      The size of the platform screen. The default setting is 2000x2000\n\n    - GBM_SCALE_WINDOW\n\n      Setting GBM_SCALE_WINDOW to 1 or true has an effect on the devicePixelRatio\n      of a window on a GBM off-screen: \"ratio = screen-\u003ewidth() / window-\u003ewidth();\"\n\n# Qt/Quick\n\nFor Qt/Quick code might look like this\n\n```\nclass FrameHandler : public QObject\n{\n    public:\n        FrameHandler( QQuickWindow* window )\n            : m_window( window )\n        {\n            connect( window, \u0026QQuickWindow::afterRendering,\n                     this, \u0026FrameHandler::grabFrame, Qt::DirectConnection );\n        }\n\n    private:\n        void grabFrame()\n        {\n            /*\n                Still on the scene graph thread, ready to postprocess the frame.\n                As an example the code below grabs it into an image.\n             */\n\n            extern QImage qt_gl_read_framebuffer(\n                const QSize\u0026, bool alpha_format, bool include_alpha );\n\n            auto frameBuffer = qt_gl_read_framebuffer( m_window.size(), false, false );\n            ...\n        }\n\n        QQuickWindow* m_window;\n};\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuwerat%2Fqpagbm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuwerat%2Fqpagbm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuwerat%2Fqpagbm/lists"}