@@ -60,9 +60,18 @@ Item {
6060 id: imageCapture
6161
6262 onImageSaved : (_ , fileName ) => {
63- renderer .state = " preview"
64- savedPhoto (" file:" + fileName)
65- console .log (" Saved: " + fileName)
63+
64+ if (backgroundFilterEnabled)
65+ {
66+ console .log (" Process file: " + fileName)
67+ backgroundFilter .processCapture (fileName)
68+ }
69+ else
70+ {
71+ renderer .state = " preview"
72+ savedPhoto (" file:" + fileName)
73+ console .log (" Saved: " + fileName)
74+ }
6675 }
6776 onImageCaptured: {
6877 whiteOverlay .state = " released"
@@ -108,6 +117,16 @@ Item {
108117 ReplaceBackgroundVideoFilter {
109118 id: backgroundFilter
110119 videoSink: output .videoSink
120+ background: " qrc:/images/backgrounds/pexels-pixabay-259915.jpg"
121+
122+ onCaptureProcessingFinished: {
123+ console .log (" Capture processing finished" )
124+ if (backgroundFilterEnabled) {
125+ renderer .state = " preview"
126+ savedPhoto (" file:" + fileName)
127+ console .log (" Saved: " + fileName)
128+ }
129+ }
111130 }
112131
113132 Connections {
@@ -203,6 +222,10 @@ Item {
203222 state = " snapshot"
204223 console .log (applicationSettings .foldername .toString ())
205224 var path = applicationSettings .foldername .toString ()
225+ if (backgroundFilterEnabled)
226+ {
227+ path = path + " /raw"
228+ }
206229 path = path .replace (/ ^ (file:\/ {2} )/ , " " )
207230 var cleanPath = decodeURIComponent (path)
208231 console .log (cleanPath)
@@ -215,6 +238,12 @@ Item {
215238 }
216239 }
217240
241+ BusyIndicator {
242+ id: busyIndicator
243+ anchors .centerIn : parent
244+ visible: false
245+ }
246+
218247 states: [
219248 State {
220249 name: " idle"
@@ -229,6 +258,10 @@ Item {
229258 target: shutterButton
230259 state: " idle"
231260 }
261+ PropertyChanges {
262+ target: busyIndicator
263+ visible: false
264+ }
232265 StateChangeScript {
233266 script: {
234267 camera .start ()
@@ -246,7 +279,11 @@ Item {
246279 name: " store"
247280 PropertyChanges {
248281 target: whiteOverlay
249- state: " released"
282+ state: " processing"
283+ }
284+ PropertyChanges {
285+ target: busyIndicator
286+ visible: true
250287 }
251288 }
252289 ]
0 commit comments