Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. * Encapsulates a set of error-correction blocks in one symbol version. Most versions will
  18. * use blocks of differing sizes within one version, so, this encapsulates the parameters for
  19. * each set of blocks. It also holds the number of error-correction codewords per block since it
  20. * will be the same across all blocks within one version.
  21. */
  22. @interface ZXDataMatrixECBlocks : NSObject
  23. @property (nonatomic, strong, readonly) NSArray *ecBlocks;
  24. @property (nonatomic, assign, readonly) int ecCodewords;
  25. @end
  26. /**
  27. * Encapsualtes the parameters for one error-correction block in one symbol version.
  28. * This includes the number of data codewords, and the number of times a block with these
  29. * parameters is used consecutively in the Data Matrix code version's format.
  30. */
  31. @interface ZXDataMatrixECB : NSObject
  32. @property (nonatomic, assign, readonly) int count;
  33. @property (nonatomic, assign, readonly) int dataCodewords;
  34. @end
  35. /**
  36. * The Version object encapsulates attributes about a particular
  37. * size Data Matrix Code.
  38. */
  39. @interface ZXDataMatrixVersion : NSObject
  40. @property (nonatomic, strong, readonly) ZXDataMatrixECBlocks *ecBlocks;
  41. @property (nonatomic, assign, readonly) int dataRegionSizeColumns;
  42. @property (nonatomic, assign, readonly) int dataRegionSizeRows;
  43. @property (nonatomic, assign, readonly) int symbolSizeColumns;
  44. @property (nonatomic, assign, readonly) int symbolSizeRows;
  45. @property (nonatomic, assign, readonly) int totalCodewords;
  46. @property (nonatomic, assign, readonly) int versionNumber;
  47. /**
  48. * <p>Deduces version information from Data Matrix dimensions.</p>
  49. *
  50. * @param numRows Number of rows in modules
  51. * @param numColumns Number of columns in modules
  52. * @return Version for a Data Matrix Code of those dimensions or nil
  53. * if dimensions do correspond to a valid Data Matrix size
  54. */
  55. + (ZXDataMatrixVersion *)versionForDimensions:(int)numRows numColumns:(int)numColumns;
  56. @end