You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ZXEncodeHints.h 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Copyright 2012 ZXing authors
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. * Enumeration for DataMatrix symbol shape hint. It can be used to force square or rectangular
  18. * symbols.
  19. */
  20. typedef enum {
  21. ZXDataMatrixSymbolShapeHintForceNone,
  22. ZXDataMatrixSymbolShapeHintForceSquare,
  23. ZXDataMatrixSymbolShapeHintForceRectangle
  24. } ZXDataMatrixSymbolShapeHint;
  25. typedef enum {
  26. ZXPDF417CompactionAuto,
  27. ZXPDF417CompactionText,
  28. ZXPDF417CompactionByte,
  29. ZXPDF417CompactionNumeric
  30. } ZXPDF417Compaction;
  31. @class ZXDimension, ZXPDF417Dimensions, ZXQRCodeErrorCorrectionLevel;
  32. /**
  33. * These are a set of hints that you may pass to Writers to specify their behavior.
  34. */
  35. @interface ZXEncodeHints : NSObject
  36. + (id)hints;
  37. /**
  38. * Specifies what character encoding to use where applicable.
  39. */
  40. @property (nonatomic, assign) NSStringEncoding encoding;
  41. /**
  42. * Specifies the matrix shape for Data Matrix.
  43. */
  44. @property (nonatomic, assign) ZXDataMatrixSymbolShapeHint dataMatrixShape;
  45. /**
  46. * Specifies a minimum barcode size. Only applicable to Data Matrix now.
  47. *
  48. * @deprecated use width/height params in
  49. * ZXDataMatrixWriter encode:format:width:height:error:
  50. */
  51. @property (nonatomic, strong) ZXDimension *minSize DEPRECATED_ATTRIBUTE;
  52. /**
  53. * Specifies a maximum barcode size. Only applicable to Data Matrix now.
  54. *
  55. * @deprecated without replacement
  56. */
  57. @property (nonatomic, strong) ZXDimension *maxSize DEPRECATED_ATTRIBUTE;
  58. /**
  59. * Specifies what degree of error correction to use, for example in QR Codes.
  60. * For Aztec it represents the minimal percentage of error correction words.
  61. * Note: an Aztec symbol should have a minimum of 25% EC words.
  62. */
  63. @property (nonatomic, strong) ZXQRCodeErrorCorrectionLevel *errorCorrectionLevel;
  64. /**
  65. * Specifies what percent of error correction to use.
  66. * For Aztec it represents the minimal percentage of error correction words.
  67. * Note: an Aztec symbol should have a minimum of 25% EC words.
  68. */
  69. @property (nonatomic, strong) NSNumber *errorCorrectionPercent;
  70. /**
  71. * Specifies margin, in pixels, to use when generating the barcode. The meaning can vary
  72. * by format; for example it controls margin before and after the barcode horizontally for
  73. * most 1D formats.
  74. */
  75. @property (nonatomic, strong) NSNumber *margin;
  76. /**
  77. * Specifies whether to use compact mode for PDF417.
  78. */
  79. @property (nonatomic, assign) BOOL pdf417Compact;
  80. /**
  81. * Specifies what compaction mode to use for PDF417.
  82. */
  83. @property (nonatomic, assign) ZXPDF417Compaction pdf417Compaction;
  84. /**
  85. * Specifies the minimum and maximum number of rows and columns for PDF417.
  86. */
  87. @property (nonatomic, strong) ZXPDF417Dimensions *pdf417Dimensions;
  88. /**
  89. * Specifies the required number of layers for an Aztec code:
  90. * a negative number (-1, -2, -3, -4) specifies a compact Aztec code
  91. * 0 indicates to use the minimum number of layers (the default)
  92. * a positive number (1, 2, .. 32) specifies a normaol (non-compact) Aztec code
  93. */
  94. @property (nonatomic, strong) NSNumber *aztecLayers;
  95. @end