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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 case 3: | 239 case 3: |
240 if (upperShift) { | 240 if (upperShift) { |
241 result += (FX_CHAR)(cValue + 224); | 241 result += (FX_CHAR)(cValue + 224); |
242 upperShift = FALSE; | 242 upperShift = FALSE; |
243 } else { | 243 } else { |
244 result += (FX_CHAR)(cValue + 96); | 244 result += (FX_CHAR)(cValue + 96); |
245 } | 245 } |
246 shift = 0; | 246 shift = 0; |
247 break; | 247 break; |
248 default: | 248 default: |
249 break; | 249 // Should never be reached. |
250 e = BCExceptionFormatException; | 250 e = BCExceptionFormatException; |
251 return; | 251 return; |
252 } | 252 } |
253 } | 253 } |
254 } while (bits->Available() > 0); | 254 } while (bits->Available() > 0); |
255 } | 255 } |
256 void CBC_DataMatrixDecodedBitStreamParser::DecodeTextSegment( | 256 void CBC_DataMatrixDecodedBitStreamParser::DecodeTextSegment( |
257 CBC_CommonBitSource* bits, | 257 CBC_CommonBitSource* bits, |
258 CFX_ByteString& result, | 258 CFX_ByteString& result, |
259 int32_t& e) { | 259 int32_t& e) { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } else { | 330 } else { |
331 result += textChar; | 331 result += textChar; |
332 } | 332 } |
333 shift = 0; | 333 shift = 0; |
334 } else { | 334 } else { |
335 e = BCExceptionFormatException; | 335 e = BCExceptionFormatException; |
336 return; | 336 return; |
337 } | 337 } |
338 break; | 338 break; |
339 default: | 339 default: |
340 break; | 340 // Should never be reached. |
341 e = BCExceptionFormatException; | 341 e = BCExceptionFormatException; |
342 return; | 342 return; |
343 } | 343 } |
344 } | 344 } |
345 } while (bits->Available() > 0); | 345 } while (bits->Available() > 0); |
346 } | 346 } |
347 void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment( | 347 void CBC_DataMatrixDecodedBitStreamParser::DecodeAnsiX12Segment( |
348 CBC_CommonBitSource* bits, | 348 CBC_CommonBitSource* bits, |
349 CFX_ByteString& result, | 349 CFX_ByteString& result, |
350 int32_t& e) { | 350 int32_t& e) { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 BC_FX_ByteString_Append(result, *bytes); | 464 BC_FX_ByteString_Append(result, *bytes); |
465 delete bytes; | 465 delete bytes; |
466 } | 466 } |
467 uint8_t CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State( | 467 uint8_t CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State( |
468 int32_t randomizedBase256Codeword, | 468 int32_t randomizedBase256Codeword, |
469 int32_t base256CodewordPosition) { | 469 int32_t base256CodewordPosition) { |
470 int32_t pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1; | 470 int32_t pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1; |
471 int32_t tempVariable = randomizedBase256Codeword - pseudoRandomNumber; | 471 int32_t tempVariable = randomizedBase256Codeword - pseudoRandomNumber; |
472 return (uint8_t)(tempVariable >= 0 ? tempVariable : tempVariable + 256); | 472 return (uint8_t)(tempVariable >= 0 ? tempVariable : tempVariable + 256); |
473 } | 473 } |
OLD | NEW |