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

Unified Diff: third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.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 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..647bf501722e2ff5e2a3e0a81521ba2ad38f45bf 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 (const auto& corner_point : barcode->corner_points) {
+ Point2D point;
+ point.setX(corner_point->x);
+ point.setY(corner_point->y);
+ cornerPoints.append(point);
+ }
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