2
* Copyright 2016 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by Florian Boucault <florian.boucault@canonical.com>
23
property alias textureSource: segmentRenderer.source
24
property alias boxesSource: segmentBoundingBoxes.source
26
implicitWidth: segmentRenderer.implicitWidth
27
implicitHeight: segmentRenderer.implicitHeight
32
function enrollMasks(masks) {
33
if (masks && masks.length) {
35
masks.forEach(function (mask, i) {
36
var hitBox = [mask.x, mask.y, mask.width, mask.height];
37
segments = segments.concat(segmentBoundingBoxes.computeIntersections(hitBox));
39
segmentRenderer.animate(segments);
45
segmentsCount: segmentBoundingBoxes.count
48
SegmentBoundingBoxes {
49
id: segmentBoundingBoxes
50
onReady: segImg.ready()