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