OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 // Original code is licensed as follows: | 6 // Original code is licensed as follows: |
7 /* | 7 /* |
8 * Copyright 2008 ZXing authors | 8 * Copyright 2008 ZXing authors |
9 * | 9 * |
10 * Licensed under the Apache License, Version 2.0 (the "License"); | 10 * Licensed under the Apache License, Version 2.0 (the "License"); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 m_numRSBlocks = -1; | 55 m_numRSBlocks = -1; |
56 } | 56 } |
57 CBC_QRCoderMode* CBC_QRCoder::GetMode() | 57 CBC_QRCoderMode* CBC_QRCoder::GetMode() |
58 { | 58 { |
59 return m_mode; | 59 return m_mode; |
60 } | 60 } |
61 CBC_QRCoderErrorCorrectionLevel* CBC_QRCoder::GetECLevel() | 61 CBC_QRCoderErrorCorrectionLevel* CBC_QRCoder::GetECLevel() |
62 { | 62 { |
63 return m_ecLevel; | 63 return m_ecLevel; |
64 } | 64 } |
65 FX_INT32 CBC_QRCoder::GetVersion() | 65 int32_t CBC_QRCoder::GetVersion() |
66 { | 66 { |
67 return m_version; | 67 return m_version; |
68 } | 68 } |
69 FX_INT32 CBC_QRCoder::GetMatrixWidth() | 69 int32_t CBC_QRCoder::GetMatrixWidth() |
70 { | 70 { |
71 return m_matrixWidth; | 71 return m_matrixWidth; |
72 } | 72 } |
73 FX_INT32 CBC_QRCoder::GetMaskPattern() | 73 int32_t CBC_QRCoder::GetMaskPattern() |
74 { | 74 { |
75 return m_maskPattern; | 75 return m_maskPattern; |
76 } | 76 } |
77 FX_INT32 CBC_QRCoder::GetNumTotalBytes() | 77 int32_t CBC_QRCoder::GetNumTotalBytes() |
78 { | 78 { |
79 return m_numTotalBytes; | 79 return m_numTotalBytes; |
80 } | 80 } |
81 FX_INT32 CBC_QRCoder::GetNumDataBytes() | 81 int32_t CBC_QRCoder::GetNumDataBytes() |
82 { | 82 { |
83 return m_numDataBytes; | 83 return m_numDataBytes; |
84 } | 84 } |
85 FX_INT32 CBC_QRCoder::GetNumECBytes() | 85 int32_t CBC_QRCoder::GetNumECBytes() |
86 { | 86 { |
87 return m_numECBytes; | 87 return m_numECBytes; |
88 } | 88 } |
89 FX_INT32 CBC_QRCoder::GetNumRSBlocks() | 89 int32_t CBC_QRCoder::GetNumRSBlocks() |
90 { | 90 { |
91 return m_numRSBlocks; | 91 return m_numRSBlocks; |
92 } | 92 } |
93 CBC_CommonByteMatrix* CBC_QRCoder::GetMatrix() | 93 CBC_CommonByteMatrix* CBC_QRCoder::GetMatrix() |
94 { | 94 { |
95 return m_matrix; | 95 return m_matrix; |
96 } | 96 } |
97 FX_INT32 CBC_QRCoder::At(FX_INT32 x, FX_INT32 y, FX_INT32 &e) | 97 int32_t CBC_QRCoder::At(int32_t x, int32_t y, int32_t &e) |
98 { | 98 { |
99 FX_INT32 value = m_matrix->Get(x, y); | 99 int32_t value = m_matrix->Get(x, y); |
100 if(!(value == 0 || value == 1)) { | 100 if(!(value == 0 || value == 1)) { |
101 e = BCExceptionValueMustBeEither0or1; | 101 e = BCExceptionValueMustBeEither0or1; |
102 BC_EXCEPTION_CHECK_ReturnValue(e, 0); | 102 BC_EXCEPTION_CHECK_ReturnValue(e, 0); |
103 } | 103 } |
104 return value; | 104 return value; |
105 } | 105 } |
106 FX_BOOL CBC_QRCoder::IsValid() | 106 FX_BOOL CBC_QRCoder::IsValid() |
107 { | 107 { |
108 return | 108 return |
109 m_mode != NULL && | 109 m_mode != NULL && |
(...skipping 12 matching lines...) Expand all Loading... |
122 m_matrix->GetWidth() == m_matrix->GetHeight(); | 122 m_matrix->GetWidth() == m_matrix->GetHeight(); |
123 } | 123 } |
124 void CBC_QRCoder::SetMode(CBC_QRCoderMode* value) | 124 void CBC_QRCoder::SetMode(CBC_QRCoderMode* value) |
125 { | 125 { |
126 m_mode = value; | 126 m_mode = value; |
127 } | 127 } |
128 void CBC_QRCoder::SetECLevel(CBC_QRCoderErrorCorrectionLevel* ecLevel) | 128 void CBC_QRCoder::SetECLevel(CBC_QRCoderErrorCorrectionLevel* ecLevel) |
129 { | 129 { |
130 m_ecLevel = ecLevel; | 130 m_ecLevel = ecLevel; |
131 } | 131 } |
132 void CBC_QRCoder::SetVersion(FX_INT32 version) | 132 void CBC_QRCoder::SetVersion(int32_t version) |
133 { | 133 { |
134 m_version = version; | 134 m_version = version; |
135 } | 135 } |
136 void CBC_QRCoder::SetMatrixWidth(FX_INT32 width) | 136 void CBC_QRCoder::SetMatrixWidth(int32_t width) |
137 { | 137 { |
138 m_matrixWidth = width; | 138 m_matrixWidth = width; |
139 } | 139 } |
140 void CBC_QRCoder::SetMaskPattern(FX_INT32 pattern) | 140 void CBC_QRCoder::SetMaskPattern(int32_t pattern) |
141 { | 141 { |
142 m_maskPattern = pattern; | 142 m_maskPattern = pattern; |
143 } | 143 } |
144 void CBC_QRCoder::SetNumDataBytes(FX_INT32 bytes) | 144 void CBC_QRCoder::SetNumDataBytes(int32_t bytes) |
145 { | 145 { |
146 m_numDataBytes = bytes; | 146 m_numDataBytes = bytes; |
147 } | 147 } |
148 void CBC_QRCoder::SetNumTotalBytes(FX_INT32 value) | 148 void CBC_QRCoder::SetNumTotalBytes(int32_t value) |
149 { | 149 { |
150 m_numTotalBytes = value; | 150 m_numTotalBytes = value; |
151 } | 151 } |
152 void CBC_QRCoder::SetNumRSBlocks(FX_INT32 block) | 152 void CBC_QRCoder::SetNumRSBlocks(int32_t block) |
153 { | 153 { |
154 m_numRSBlocks = block; | 154 m_numRSBlocks = block; |
155 } | 155 } |
156 void CBC_QRCoder::SetNumECBytes(FX_INT32 value) | 156 void CBC_QRCoder::SetNumECBytes(int32_t value) |
157 { | 157 { |
158 m_numECBytes = value; | 158 m_numECBytes = value; |
159 } | 159 } |
160 FX_BOOL CBC_QRCoder::IsValidMaskPattern(FX_INT32 maskPattern) | 160 FX_BOOL CBC_QRCoder::IsValidMaskPattern(int32_t maskPattern) |
161 { | 161 { |
162 return maskPattern >= 0 && maskPattern < NUM_MASK_PATTERNS; | 162 return maskPattern >= 0 && maskPattern < NUM_MASK_PATTERNS; |
163 } | 163 } |
164 void CBC_QRCoder::SetMatrix(CBC_CommonByteMatrix* value) | 164 void CBC_QRCoder::SetMatrix(CBC_CommonByteMatrix* value) |
165 { | 165 { |
166 m_matrix = value; | 166 m_matrix = value; |
167 } | 167 } |
168 const FX_INT32 CBC_QRCoder::NUM_MASK_PATTERNS = 8; | 168 const int32_t CBC_QRCoder::NUM_MASK_PATTERNS = 8; |
OLD | NEW |