This is the sample program that can see the decode result of barcode data on Watson IoT.
Dependencies: AsciiFont DisplayApp GR-PEACH_video LCD_shield_config LWIPBP3595Interface_STA_for_mbed-os USBDevice
zxing_lib/zxing/DecodeHints.h@0:7d720671e6dc, 2016-11-10 (annotated)
- Committer:
- Osamu Nakamura
- Date:
- Thu Nov 10 20:04:48 2016 +0900
- Revision:
- 0:7d720671e6dc
Initial Commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Osamu Nakamura |
0:7d720671e6dc | 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- |
Osamu Nakamura |
0:7d720671e6dc | 2 | #ifndef __DECODEHINTS_H_ |
Osamu Nakamura |
0:7d720671e6dc | 3 | #define __DECODEHINTS_H_ |
Osamu Nakamura |
0:7d720671e6dc | 4 | /* |
Osamu Nakamura |
0:7d720671e6dc | 5 | * DecodeHintType.h |
Osamu Nakamura |
0:7d720671e6dc | 6 | * zxing |
Osamu Nakamura |
0:7d720671e6dc | 7 | * |
Osamu Nakamura |
0:7d720671e6dc | 8 | * Copyright 2010 ZXing authors All rights reserved. |
Osamu Nakamura |
0:7d720671e6dc | 9 | * |
Osamu Nakamura |
0:7d720671e6dc | 10 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Osamu Nakamura |
0:7d720671e6dc | 11 | * you may not use this file except in compliance with the License. |
Osamu Nakamura |
0:7d720671e6dc | 12 | * You may obtain a copy of the License at |
Osamu Nakamura |
0:7d720671e6dc | 13 | * |
Osamu Nakamura |
0:7d720671e6dc | 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
Osamu Nakamura |
0:7d720671e6dc | 15 | * |
Osamu Nakamura |
0:7d720671e6dc | 16 | * Unless required by applicable law or agreed to in writing, software |
Osamu Nakamura |
0:7d720671e6dc | 17 | * distributed under the License is distributed on an "AS IS" BASIS, |
Osamu Nakamura |
0:7d720671e6dc | 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Osamu Nakamura |
0:7d720671e6dc | 19 | * See the License for the specific language governing permissions and |
Osamu Nakamura |
0:7d720671e6dc | 20 | * limitations under the License. |
Osamu Nakamura |
0:7d720671e6dc | 21 | */ |
Osamu Nakamura |
0:7d720671e6dc | 22 | |
Osamu Nakamura |
0:7d720671e6dc | 23 | #include <zxing/BarcodeFormat.h> |
Osamu Nakamura |
0:7d720671e6dc | 24 | #include <zxing/ResultPointCallback.h> |
Osamu Nakamura |
0:7d720671e6dc | 25 | |
Osamu Nakamura |
0:7d720671e6dc | 26 | namespace zxing { |
Osamu Nakamura |
0:7d720671e6dc | 27 | |
Osamu Nakamura |
0:7d720671e6dc | 28 | typedef unsigned int DecodeHintType; |
Osamu Nakamura |
0:7d720671e6dc | 29 | class DecodeHints; |
Osamu Nakamura |
0:7d720671e6dc | 30 | DecodeHints operator | (DecodeHints const&, DecodeHints const&); |
Osamu Nakamura |
0:7d720671e6dc | 31 | |
Osamu Nakamura |
0:7d720671e6dc | 32 | class DecodeHints { |
Osamu Nakamura |
0:7d720671e6dc | 33 | private: |
Osamu Nakamura |
0:7d720671e6dc | 34 | DecodeHintType hints; |
Osamu Nakamura |
0:7d720671e6dc | 35 | Ref<ResultPointCallback> callback; |
Osamu Nakamura |
0:7d720671e6dc | 36 | |
Osamu Nakamura |
0:7d720671e6dc | 37 | public: |
Osamu Nakamura |
0:7d720671e6dc | 38 | static const DecodeHintType AZTEC_HINT = 1 << BarcodeFormat::AZTEC; |
Osamu Nakamura |
0:7d720671e6dc | 39 | static const DecodeHintType CODABAR_HINT = 1 << BarcodeFormat::CODABAR; |
Osamu Nakamura |
0:7d720671e6dc | 40 | static const DecodeHintType CODE_39_HINT = 1 << BarcodeFormat::CODE_39; |
Osamu Nakamura |
0:7d720671e6dc | 41 | static const DecodeHintType CODE_93_HINT = 1 << BarcodeFormat::CODE_93; |
Osamu Nakamura |
0:7d720671e6dc | 42 | static const DecodeHintType CODE_128_HINT = 1 << BarcodeFormat::CODE_128; |
Osamu Nakamura |
0:7d720671e6dc | 43 | static const DecodeHintType DATA_MATRIX_HINT = 1 << BarcodeFormat::DATA_MATRIX; |
Osamu Nakamura |
0:7d720671e6dc | 44 | static const DecodeHintType EAN_8_HINT = 1 << BarcodeFormat::EAN_8; |
Osamu Nakamura |
0:7d720671e6dc | 45 | static const DecodeHintType EAN_13_HINT = 1 << BarcodeFormat::EAN_13; |
Osamu Nakamura |
0:7d720671e6dc | 46 | static const DecodeHintType ITF_HINT = 1 << BarcodeFormat::ITF; |
Osamu Nakamura |
0:7d720671e6dc | 47 | static const DecodeHintType MAXICODE_HINT = 1 << BarcodeFormat::MAXICODE; |
Osamu Nakamura |
0:7d720671e6dc | 48 | static const DecodeHintType PDF_417_HINT = 1 << BarcodeFormat::PDF_417; |
Osamu Nakamura |
0:7d720671e6dc | 49 | static const DecodeHintType QR_CODE_HINT = 1 << BarcodeFormat::QR_CODE; |
Osamu Nakamura |
0:7d720671e6dc | 50 | static const DecodeHintType RSS_14_HINT = 1 << BarcodeFormat::RSS_14; |
Osamu Nakamura |
0:7d720671e6dc | 51 | static const DecodeHintType RSS_EXPANDED_HINT = 1 << BarcodeFormat::RSS_EXPANDED; |
Osamu Nakamura |
0:7d720671e6dc | 52 | static const DecodeHintType UPC_A_HINT = 1 << BarcodeFormat::UPC_A; |
Osamu Nakamura |
0:7d720671e6dc | 53 | static const DecodeHintType UPC_E_HINT = 1 << BarcodeFormat::UPC_E; |
Osamu Nakamura |
0:7d720671e6dc | 54 | static const DecodeHintType UPC_EAN_EXTENSION_HINT = 1 << BarcodeFormat::UPC_EAN_EXTENSION; |
Osamu Nakamura |
0:7d720671e6dc | 55 | |
Osamu Nakamura |
0:7d720671e6dc | 56 | #if defined(__ICCARM__) // |
Osamu Nakamura |
0:7d720671e6dc | 57 | static const DecodeHintType TRYHARDER_HINT = 0x80000000; |
Osamu Nakamura |
0:7d720671e6dc | 58 | #else |
Osamu Nakamura |
0:7d720671e6dc | 59 | static const DecodeHintType TRYHARDER_HINT = 1 << 31; |
Osamu Nakamura |
0:7d720671e6dc | 60 | #endif // |
Osamu Nakamura |
0:7d720671e6dc | 61 | static const DecodeHintType CHARACTER_SET = 1 << 30; |
Osamu Nakamura |
0:7d720671e6dc | 62 | // static const DecodeHintType ALLOWED_LENGTHS = 1 << 29; |
Osamu Nakamura |
0:7d720671e6dc | 63 | // static const DecodeHintType ASSUME_CODE_39_CHECK_DIGIT = 1 << 28; |
Osamu Nakamura |
0:7d720671e6dc | 64 | static const DecodeHintType ASSUME_GS1 = 1 << 27; |
Osamu Nakamura |
0:7d720671e6dc | 65 | // static const DecodeHintType NEED_RESULT_POINT_CALLBACK = 1 << 26; |
Osamu Nakamura |
0:7d720671e6dc | 66 | |
Osamu Nakamura |
0:7d720671e6dc | 67 | static const DecodeHints PRODUCT_HINT; |
Osamu Nakamura |
0:7d720671e6dc | 68 | static const DecodeHints ONED_HINT; |
Osamu Nakamura |
0:7d720671e6dc | 69 | static const DecodeHints DEFAULT_HINT; |
Osamu Nakamura |
0:7d720671e6dc | 70 | |
Osamu Nakamura |
0:7d720671e6dc | 71 | DecodeHints(); |
Osamu Nakamura |
0:7d720671e6dc | 72 | DecodeHints(DecodeHintType init); |
Osamu Nakamura |
0:7d720671e6dc | 73 | |
Osamu Nakamura |
0:7d720671e6dc | 74 | void addFormat(BarcodeFormat toadd); |
Osamu Nakamura |
0:7d720671e6dc | 75 | bool containsFormat(BarcodeFormat tocheck) const; |
Osamu Nakamura |
0:7d720671e6dc | 76 | bool isEmpty() const {return (hints==0);} |
Osamu Nakamura |
0:7d720671e6dc | 77 | void clear() {hints=0;} |
Osamu Nakamura |
0:7d720671e6dc | 78 | void setTryHarder(bool toset); |
Osamu Nakamura |
0:7d720671e6dc | 79 | bool getTryHarder() const; |
Osamu Nakamura |
0:7d720671e6dc | 80 | |
Osamu Nakamura |
0:7d720671e6dc | 81 | void setResultPointCallback(Ref<ResultPointCallback> const&); |
Osamu Nakamura |
0:7d720671e6dc | 82 | Ref<ResultPointCallback> getResultPointCallback() const; |
Osamu Nakamura |
0:7d720671e6dc | 83 | |
Osamu Nakamura |
0:7d720671e6dc | 84 | friend DecodeHints operator | (DecodeHints const&, DecodeHints const&); |
Osamu Nakamura |
0:7d720671e6dc | 85 | }; |
Osamu Nakamura |
0:7d720671e6dc | 86 | |
Osamu Nakamura |
0:7d720671e6dc | 87 | } |
Osamu Nakamura |
0:7d720671e6dc | 88 | |
Osamu Nakamura |
0:7d720671e6dc | 89 | #endif |