Advice on modifying display from QCameraViewfinder



  • I'm writing a stop-motion animation package and right now I'm displaying the output from the live camera feed to a QCameraViewfinder. I need to add a modifier to this feed (it will show a half-opacity version of the previously captured frame blended with the current live feed when a certain key is held down, used to line up your next shot). What is the best way to do this? Should I subclass QCameraViewfinder and override its draw function, or is there a better, more "Qt" way of doing this sort of thing via a filter of some kind, etc.?


  • Lifetime Qt Champion

    Hi,

    Not a direct answer but if QtQuick is an option, it could be easier to get the kind of effect you are after.

    Other wise you could use an overlay widget with a transparent background.



  • QtQuick isn't an option, but I'm not really worried about the actual calculation of the effect: just how to implement an effect in general. It looks like the answer is actually to subclass QGraphicsEffect and implement my code in that draw() function, rather than directly in the QCameraView's draw() function. I can then install that effect at startup, and enable/disable it based on a keydown state.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.