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

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

Issue 2575943002: Barcode Detection: Add |cornerPoints| to DetectedBarcode.idl (Closed)
Patch Set: Correct coordinates (in clockwise direction starting with top-left) Created 4 years 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/DetectedBarcode.h" 5 #include "modules/shapedetection/DetectedBarcode.h"
6 6
7 #include "core/dom/DOMRect.h" 7 #include "core/dom/DOMRect.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 DetectedBarcode* DetectedBarcode::create() { 11 DetectedBarcode* DetectedBarcode::create() {
12 return new DetectedBarcode(emptyString(), DOMRect::create(0, 0, 0, 0)); 12 HeapVector<Point2D> emptyList;
13 return new DetectedBarcode(emptyString(), DOMRect::create(0, 0, 0, 0),
14 emptyList);
13 } 15 }
14 16
15 DetectedBarcode* DetectedBarcode::create(String rawValue, 17 DetectedBarcode* DetectedBarcode::create(String rawValue,
16 DOMRect* boundingBox) { 18 DOMRect* boundingBox,
17 return new DetectedBarcode(rawValue, boundingBox); 19 HeapVector<Point2D> cornerPoints) {
20 return new DetectedBarcode(rawValue, boundingBox, cornerPoints);
18 } 21 }
19 22
20 const String& DetectedBarcode::rawValue() const { 23 const String& DetectedBarcode::rawValue() const {
21 return m_rawValue; 24 return m_rawValue;
22 } 25 }
23 26
24 DOMRect* DetectedBarcode::boundingBox() const { 27 DOMRect* DetectedBarcode::boundingBox() const {
25 return m_boundingBox.get(); 28 return m_boundingBox.get();
26 } 29 }
27 30
28 DetectedBarcode::DetectedBarcode(String rawValue, DOMRect* boundingBox) 31 const HeapVector<Point2D>& DetectedBarcode::cornerPoints() const {
29 : m_rawValue(rawValue), m_boundingBox(boundingBox) {} 32 return m_cornerPoints;
33 }
34
35 DetectedBarcode::DetectedBarcode(String rawValue,
36 DOMRect* boundingBox,
37 HeapVector<Point2D> cornerPoints)
38 : m_rawValue(rawValue),
39 m_boundingBox(boundingBox),
40 m_cornerPoints(cornerPoints) {}
30 41
31 DEFINE_TRACE(DetectedBarcode) { 42 DEFINE_TRACE(DetectedBarcode) {
32 visitor->trace(m_boundingBox); 43 visitor->trace(m_boundingBox);
44 visitor->trace(m_cornerPoints);
33 } 45 }
34 46
35 } // namespace blink 47 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698