barcode_detection_impl_barhopper.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef SERVICES_SHAPE_DETECTION_BARCODE_DETECTION_IMPL_BARHOPPER_H_
  5. #define SERVICES_SHAPE_DETECTION_BARCODE_DETECTION_IMPL_BARHOPPER_H_
  6. #include "services/shape_detection/public/mojom/barcodedetection.mojom.h"
  7. #include "services/shape_detection/public/mojom/barcodedetection_provider.mojom.h"
  8. #include "third_party/barhopper/barhopper/barhopper.h"
  9. #include "third_party/skia/include/core/SkBitmap.h"
  10. namespace shape_detection {
  11. class BarcodeDetectionImplBarhopper : public mojom::BarcodeDetection {
  12. public:
  13. explicit BarcodeDetectionImplBarhopper(
  14. mojom::BarcodeDetectorOptionsPtr options);
  15. BarcodeDetectionImplBarhopper(const BarcodeDetectionImplBarhopper&) = delete;
  16. BarcodeDetectionImplBarhopper& operator=(
  17. const BarcodeDetectionImplBarhopper&) = delete;
  18. ~BarcodeDetectionImplBarhopper() override;
  19. // mojom::BarcodeDetection:
  20. void Detect(const SkBitmap& bitmap,
  21. shape_detection::mojom::BarcodeDetection::DetectCallback callback)
  22. override;
  23. static std::vector<shape_detection::mojom::BarcodeFormat>
  24. GetSupportedFormats();
  25. private:
  26. barhopper::RecognitionOptions recognition_options_;
  27. };
  28. } // namespace shape_detection
  29. #endif // SERVICES_SHAPE_DETECTION_BARCODE_DETECTION_IMPL_BARHOPPER_H_