Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Scaling of QML VideoOutput/ShaderEffect (bilinear vs nearest-neighbour interpolation)



  • I have a problem with the low-resolution stream of a coloured grid being projected by QML VideoOutput and/or ShaderEffect. It becomes blur when I apply scale or anchors.fill (applies to VideoOutput only). I am not sure I am clear, but let's imagine that our original stream is a grid, e .g. a white-black chessboard. I would imagine that one could scale it to infinity preserving high quality/sharp output view (let's assume integer scale factor). Instead, I have the impression the mentioned QML objects use bilinear interpolation making the image blur, while I think in my case (more categorical than continuous data) the nearest-neighbour interpolation would be more appropriate. How to control this interpolation?
    I have tried to set the smooth property in VideoOutput to false, but it doesn't impact the view at all (it's still blurry).



  • For VideOutput that does the trick:

        VideoOutput {
        ...
            layer.enabled: true
            smooth: false
        }
    

    Unfortunately, it does't work with ShaderEffetct (the image is still blurry):

        ShaderEffect {
        ...
            layer.enabled: true
            smooth: false
            scale = 10
        }
    

Log in to reply