summaryrefslogtreecommitdiff
path: root/src/apps/common/stream_options.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-09-09 16:13:20 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-09-11 18:24:51 +0300
commite6441ec4f4a68518c3f01c753ef179226f56ebfc (patch)
treed7eb078494b0861c8a62cc49ec93b273e6c37fb3 /src/apps/common/stream_options.cpp
parent583901a714d50adf28f248ccdad5867050979058 (diff)
qcam: viewfinder_gl: Render image centered in letterbox
Mimic the letterbox behaviour of the Qt viewfinder by rendering the image centered. This is done by adding a projection matrix to the vertex shader to scale the rendered rectangle. Another option would have been to keep using glViewport() (which would have needed to be moved to paintGL(), as Qt resets the viewport to span the full widget before calling). Hidpi displays would then need special handling of the device pixel ratio, which is done automatically by Qt when it sets the default viewport. Using a projection matrix avoids this complication. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/apps/common/stream_options.cpp')
0 files changed, 0 insertions, 0 deletions