BarcodeReader.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright 2016 Nu-book Inc.
  3. */
  4. // SPDX-License-Identifier: Apache-2.0
  5. #pragma once
  6. #include "BarcodeFormat.h"
  7. #include "ReaderOptions.h"
  8. #include <memory>
  9. namespace ZXing {
  10. public enum class BarcodeType : int {
  11. AZTEC,
  12. CODABAR,
  13. CODE_39,
  14. CODE_93,
  15. CODE_128,
  16. DATA_MATRIX,
  17. DX_FILM_EDGE,
  18. EAN_8,
  19. EAN_13,
  20. ITF,
  21. MAXICODE,
  22. PDF_417,
  23. QR_CODE,
  24. MICRO_QR_CODE,
  25. RMQR_CODE,
  26. RSS_14,
  27. RSS_EXPANDED,
  28. DATA_BAR_LIMITED,
  29. UPC_A,
  30. UPC_E
  31. };
  32. ref class ReadResult;
  33. public ref class BarcodeReader sealed
  34. {
  35. public:
  36. BarcodeReader(bool tryHarder, bool tryRotate, const Platform::Array<BarcodeType>^ types);
  37. BarcodeReader(bool tryHarder, bool tryRotate);
  38. BarcodeReader(bool tryHarder);
  39. ReadResult^ Read(Windows::Graphics::Imaging::SoftwareBitmap^ bitmap, int cropWidth, int cropHeight);
  40. private:
  41. ~BarcodeReader();
  42. void init(bool tryHarder, bool tryRotate, const Platform::Array<BarcodeType>^ types);
  43. static BarcodeFormat ConvertRuntimeToNative(BarcodeType type);
  44. static BarcodeType ConvertNativeToRuntime(BarcodeFormat format);
  45. std::unique_ptr<ReaderOptions> m_opts;
  46. };
  47. } // ZXing