rahulch

Untitled

Mar 13th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.28 KB | None | 0 0
  1. import QtQuick 2.3
  2. import QtQuick.Controls 2.12
  3. import QtQuick.Layouts 1.11
  4. import QtQuick.Window 2.12
  5. import QtMultimedia 5.8
  6. import QtQml 2.12
  7. import QtGraphicalEffects 1.12
  8.  
  9. import video.filter 1.0
  10.  
  11. Rectangle {
  12.     anchors.centerIn: parent
  13.     color: "black"
  14.    
  15.     Camera {
  16.         id: inputCamera
  17.         imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash
  18.        
  19.         exposure {
  20.             exposureCompensation: -1.0
  21.             exposureMode: Camera.ExposurePortrait
  22.         }
  23.        
  24.         flash.mode: Camera.FlashRedEyeReduction
  25.        
  26.         onCameraStatusChanged: {
  27.             console.log(cameraStatus)
  28.             if (cameraStatus == Camera.ActiveStatus) {
  29.                 if (!dmsmainwindow.isDMSInitialized)
  30.                     dmsmainwindow.isDMSInitialized = true
  31.             } else if (cameraStatus == Camera.StoppingStatus) {
  32.                 if (dmsmainwindow.isDMSInitialized)
  33.                     dmsmainwindow.isDMSInitialized = false
  34.             }
  35.         }
  36.     }
  37.    
  38.     VideoFilter {
  39.         id: filter
  40.     }
  41.    
  42.     VideoOutput {
  43.         id: videoOutput
  44.         source: inputCamera
  45.         anchors.centerIn: parent
  46.         fillMode: VideoOutput.PreserveAspectFit
  47.         filters: [ filter ]
  48.     }
  49. }
Add Comment
Please, Sign In to add comment