Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: third_party/WebKit/Source/modules/shapedetection/DetectedFace.cpp

Issue 2859413002: Shape Detection: add idl and mojom for face landmarks and wire for Mac (Closed)
Patch Set: service-worker's global-interface-listing-expected.txt updated Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/shapedetection/DetectedFace.h" 5 #include "modules/shapedetection/DetectedFace.h"
6 6
7 #include "core/geometry/DOMRect.h" 7 #include "core/geometry/DOMRect.h"
8 #include "modules/shapedetection/Landmark.h"
8 9
9 namespace blink { 10 namespace blink {
10 11
11 DetectedFace* DetectedFace::Create() { 12 DetectedFace* DetectedFace::Create() {
12 return new DetectedFace(DOMRect::Create()); 13 return new DetectedFace(DOMRect::Create());
13 } 14 }
14 15
15 DetectedFace* DetectedFace::Create(DOMRect* bounding_box) { 16 DetectedFace* DetectedFace::Create(DOMRect* bounding_box) {
16 return new DetectedFace(bounding_box); 17 return new DetectedFace(bounding_box);
17 } 18 }
18 19
20 DetectedFace* DetectedFace::Create(DOMRect* bounding_box,
21 const HeapVector<Landmark>& landmarks) {
22 return new DetectedFace(bounding_box, landmarks);
23 }
24
19 DOMRect* DetectedFace::boundingBox() const { 25 DOMRect* DetectedFace::boundingBox() const {
20 return bounding_box_.Get(); 26 return bounding_box_.Get();
21 } 27 }
22 28
29 const HeapVector<Landmark>& DetectedFace::landmarks() const {
30 return landmarks_;
31 }
32
23 DetectedFace::DetectedFace(DOMRect* bounding_box) 33 DetectedFace::DetectedFace(DOMRect* bounding_box)
24 : bounding_box_(bounding_box) {} 34 : bounding_box_(bounding_box) {}
25 35
36 DetectedFace::DetectedFace(DOMRect* bounding_box,
37 const HeapVector<Landmark>& landmarks)
38 : bounding_box_(bounding_box), landmarks_(landmarks) {}
39
26 DEFINE_TRACE(DetectedFace) { 40 DEFINE_TRACE(DetectedFace) {
27 visitor->Trace(bounding_box_); 41 visitor->Trace(bounding_box_);
42 visitor->Trace(landmarks_);
28 } 43 }
29 44
30 } // namespace blink 45 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698