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

Unified Diff: third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp

Issue 2575943002: Barcode Detection: Add |cornerPoints| to DetectedBarcode.idl (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp
diff --git a/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp b/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp
index b76da099e0b33f6c5b3a313b9a1beb3295acd430..a281a7fec09cf105d089fc6a1725a3589383217d 100644
--- a/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp
+++ b/third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp
@@ -9,6 +9,7 @@
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
#include "core/html/canvas/CanvasImageSource.h"
+#include "modules/imagecapture/Point2D.h"
#include "modules/shapedetection/DetectedBarcode.h"
#include "public/platform/InterfaceProvider.h"
@@ -53,11 +54,19 @@ void BarcodeDetector::onDetectBarcodes(
HeapVector<Member<DetectedBarcode>> detectedBarcodes;
for (const auto& barcode : barcodeDetectionResults) {
+ HeapVector<Point2D> cornerPoints;
+ for (int i = 0; i < 4; i++) {
+ Point2D point;
+ point.setX((barcode->corner_points)[i]->x);
+ point.setY((barcode->corner_points)[i]->y);
+ cornerPoints.append(point);
+ }
mcasas 2016/12/15 19:01:58 for (const auto& point: barcode->corner_points) {
xianglu 2016/12/16 00:01:25 Done.
detectedBarcodes.append(DetectedBarcode::create(
barcode->raw_value,
DOMRect::create(barcode->bounding_box->x, barcode->bounding_box->y,
barcode->bounding_box->width,
- barcode->bounding_box->height)));
+ barcode->bounding_box->height),
+ cornerPoints));
}
resolver->resolve(detectedBarcodes);

Powered by Google App Engine
This is Rietveld 408576698