/src/ZXing.Net/pdf417/encoder/PDF417EncodingOptions.cs

https://github.com/benhenderson/ZXing.Net.Mobile · C# · 89 lines · 55 code · 5 blank · 29 comment · 3 complexity · e1687b405688cf2ee21c3bf9245e93b8 MD5 · raw file

  1. /*
  2. * Copyright 2012 ZXing.Net 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. using System;
  17. using ZXing.Common;
  18. using ZXing.PDF417.Internal;
  19. namespace ZXing.PDF417
  20. {
  21. /// <summary>
  22. /// The class holds the available options for the <see cref="PDF417Writer" />
  23. /// </summary>
  24. [Serializable]
  25. public class PDF417EncodingOptions : EncodingOptions
  26. {
  27. /// <summary>
  28. /// Specifies whether to use compact mode for PDF417 (type <see cref="bool" />).
  29. /// </summary>
  30. public bool Compact
  31. {
  32. get
  33. {
  34. if (Hints.ContainsKey(EncodeHintType.PDF417_COMPACT))
  35. {
  36. return (bool)Hints[EncodeHintType.PDF417_COMPACT];
  37. }
  38. return false;
  39. }
  40. set
  41. {
  42. Hints[EncodeHintType.PDF417_COMPACT] = value;
  43. }
  44. }
  45. /// <summary>
  46. /// Specifies what compaction mode to use for PDF417 (type
  47. /// <see cref="Compaction" />).
  48. /// </summary>
  49. public Compaction Compaction
  50. {
  51. get
  52. {
  53. if (Hints.ContainsKey(EncodeHintType.PDF417_COMPACTION))
  54. {
  55. return (Compaction)Hints[EncodeHintType.PDF417_COMPACTION];
  56. }
  57. return Compaction.AUTO;
  58. }
  59. set
  60. {
  61. Hints[EncodeHintType.PDF417_COMPACTION] = value;
  62. }
  63. }
  64. /// <summary>
  65. /// Specifies the minimum and maximum number of rows and columns for PDF417 (type
  66. /// <see cref="Dimensions" />).
  67. /// </summary>
  68. public Dimensions Dimensions
  69. {
  70. get
  71. {
  72. if (Hints.ContainsKey(EncodeHintType.PDF417_DIMENSIONS))
  73. {
  74. return (Dimensions)Hints[EncodeHintType.PDF417_DIMENSIONS];
  75. }
  76. return null;
  77. }
  78. set
  79. {
  80. Hints[EncodeHintType.PDF417_DIMENSIONS] = value;
  81. }
  82. }
  83. }
  84. }