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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 for (int32_t d = 0; d < 107; d++) { | 143 for (int32_t d = 0; d < 107; d++) { |
144 int32_t variance = PatternMatchVariance(counters, &CODE_PATTERNS[d][0], | 144 int32_t variance = PatternMatchVariance(counters, &CODE_PATTERNS[d][0], |
145 MAX_INDIVIDUAL_VARIANCE); | 145 MAX_INDIVIDUAL_VARIANCE); |
146 if (variance < bestVariance) { | 146 if (variance < bestVariance) { |
147 bestVariance = variance; | 147 bestVariance = variance; |
148 bestMatch = d; | 148 bestMatch = d; |
149 } | 149 } |
150 } | 150 } |
151 if (bestMatch >= 0) { | 151 if (bestMatch >= 0) { |
152 return bestMatch; | 152 return bestMatch; |
153 } else { | |
154 e = BCExceptionNotFound; | |
155 return 0; | |
156 } | 153 } |
| 154 e = BCExceptionNotFound; |
157 return 0; | 155 return 0; |
158 } | 156 } |
159 CFX_ByteString CBC_OnedCode128Reader::DecodeRow(int32_t rowNumber, | 157 CFX_ByteString CBC_OnedCode128Reader::DecodeRow(int32_t rowNumber, |
160 CBC_CommonBitArray* row, | 158 CBC_CommonBitArray* row, |
161 int32_t hints, | 159 int32_t hints, |
162 int32_t& e) { | 160 int32_t& e) { |
163 CFX_Int32Array* startPatternInfo = FindStartPattern(row, e); | 161 CFX_Int32Array* startPatternInfo = FindStartPattern(row, e); |
164 BC_EXCEPTION_CHECK_ReturnValue(e, ""); | 162 BC_EXCEPTION_CHECK_ReturnValue(e, ""); |
165 int32_t startCode = (*startPatternInfo)[2]; | 163 int32_t startCode = (*startPatternInfo)[2]; |
166 int32_t codeSet; | 164 int32_t codeSet; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 } else { | 340 } else { |
343 result = result.Mid(0, result.GetLength() - 1); | 341 result = result.Mid(0, result.GetLength() - 1); |
344 } | 342 } |
345 } | 343 } |
346 if (result.GetLength() == 0) { | 344 if (result.GetLength() == 0) { |
347 e = BCExceptionFormatException; | 345 e = BCExceptionFormatException; |
348 return ""; | 346 return ""; |
349 } | 347 } |
350 return result; | 348 return result; |
351 } | 349 } |
OLD | NEW |