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.

ZXDataMatrixHighLevelEncoder.h 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * Copyright 2013 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. #import "ZXEncodeHints.h"
  17. @class ZXDimension;
  18. /**
  19. * DataMatrix ECC 200 data encoder following the algorithm described in ISO/IEC 16022:200(E) in
  20. * annex S.
  21. */
  22. @interface ZXDataMatrixHighLevelEncoder : NSObject
  23. /**
  24. * mode latch to C40 encodation mode
  25. */
  26. + (unichar)latchToC40;
  27. /**
  28. * mode latch to Base 256 encodation mode
  29. */
  30. + (unichar)latchToBase256;
  31. /**
  32. * Upper Shift
  33. */
  34. + (unichar)upperShift;
  35. /**
  36. * 05 Macro
  37. */
  38. + (unichar)macro05;
  39. /**
  40. * 06 Macro
  41. */
  42. + (unichar)macro06;
  43. /**
  44. * mode latch to ANSI X.12 encodation mode
  45. */
  46. + (unichar)latchToAnsiX12;
  47. /**
  48. * mode latch to Text encodation mode
  49. */
  50. + (unichar)latchToText;
  51. /**
  52. * mode latch to EDIFACT encodation mode
  53. */
  54. + (unichar)latchToEdifact;
  55. /**
  56. * Unlatch from C40 encodation
  57. */
  58. + (unichar)c40Unlatch;
  59. /**
  60. * Unlatch from X12 encodation
  61. */
  62. + (unichar)x12Unlatch;
  63. + (int)asciiEncodation;
  64. + (int)c40Encodation;
  65. + (int)textEncodation;
  66. + (int)x12Encodation;
  67. + (int)edifactEncodation;
  68. + (int)base256Encodation;
  69. /*
  70. * Converts the message to a byte array using the default encoding (cp437) as defined by the
  71. * specification
  72. *
  73. * @param msg the message
  74. * @return the byte array of the message
  75. */
  76. /*
  77. + (int8_t *)bytesForMessage:(NSString *)msg;
  78. */
  79. /**
  80. * Performs message encoding of a DataMatrix message using the algorithm described in annex P
  81. * of ISO/IEC 16022:2000(E).
  82. *
  83. * @param msg the message
  84. * @return the encoded message (the char values range from 0 to 255)
  85. */
  86. + (NSString *)encodeHighLevel:(NSString *)msg;
  87. /**
  88. * Performs message encoding of a DataMatrix message using the algorithm described in annex P
  89. * of ISO/IEC 16022:2000(E).
  90. *
  91. * @param msg the message
  92. * @param shape requested shape. May be {@code SymbolShapeHint.FORCE_NONE},
  93. * {@code SymbolShapeHint.FORCE_SQUARE} or {@code SymbolShapeHint.FORCE_RECTANGLE}.
  94. * @param minSize the minimum symbol size constraint or null for no constraint
  95. * @param maxSize the maximum symbol size constraint or null for no constraint
  96. * @return the encoded message (the char values range from 0 to 255)
  97. */
  98. + (NSString *)encodeHighLevel:(NSString *)msg shape:(ZXDataMatrixSymbolShapeHint)shape
  99. minSize:(ZXDimension *)minSize maxSize:(ZXDimension *)maxSize;
  100. + (int)lookAheadTest:(NSString *)msg startpos:(int)startpos currentMode:(int)currentMode;
  101. /**
  102. * Determines the number of consecutive characters that are encodable using numeric compaction.
  103. *
  104. * @param msg the message
  105. * @param startpos the start position within the message
  106. * @return the requested character count
  107. */
  108. + (int)determineConsecutiveDigitCount:(NSString *)msg startpos:(int)startpos;
  109. + (BOOL)isDigit:(unichar)ch;
  110. + (BOOL)isExtendedASCII:(unichar)ch;
  111. + (void)illegalCharacter:(unichar)c;
  112. @end