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 25 matching lines...) Expand all Loading... |
36 BC_EXCEPTION_CHECK_ReturnValue(e, ""); | 36 BC_EXCEPTION_CHECK_ReturnValue(e, ""); |
37 return strtemp; | 37 return strtemp; |
38 } | 38 } |
39 CFX_ByteString CBC_OneDReader::Decode(CBC_BinaryBitmap* image, | 39 CFX_ByteString CBC_OneDReader::Decode(CBC_BinaryBitmap* image, |
40 int32_t hints, | 40 int32_t hints, |
41 int32_t& e) { | 41 int32_t& e) { |
42 CFX_ByteString strtemp = DeDecode(image, hints, e); | 42 CFX_ByteString strtemp = DeDecode(image, hints, e); |
43 BC_EXCEPTION_CHECK_ReturnValue(e, ""); | 43 BC_EXCEPTION_CHECK_ReturnValue(e, ""); |
44 return strtemp; | 44 return strtemp; |
45 } | 45 } |
| 46 CFX_ByteString CBC_OneDReader::DecodeRow(int32_t rowNumber, |
| 47 CBC_CommonBitArray* row, |
| 48 int32_t hints, |
| 49 int32_t& e) { |
| 50 return ""; |
| 51 } |
46 CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap* image, | 52 CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap* image, |
47 int32_t hints, | 53 int32_t hints, |
48 int32_t& e) { | 54 int32_t& e) { |
49 int32_t height = image->GetHeight(); | 55 int32_t height = image->GetHeight(); |
50 int32_t middle = height >> 1; | 56 int32_t middle = height >> 1; |
51 FX_BOOL tryHarder = FALSE; | 57 FX_BOOL tryHarder = FALSE; |
52 int32_t rowStep = std::max(1, height >> (tryHarder ? 8 : 5)); | 58 int32_t rowStep = std::max(1, height >> (tryHarder ? 8 : 5)); |
53 int32_t maxLines; | 59 int32_t maxLines; |
54 if (tryHarder) { | 60 if (tryHarder) { |
55 maxLines = height; | 61 maxLines = height; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 int32_t variance = counter > scaledPattern ? counter - scaledPattern | 172 int32_t variance = counter > scaledPattern ? counter - scaledPattern |
167 : scaledPattern - counter; | 173 : scaledPattern - counter; |
168 if (variance > maxIndividualVariance) { | 174 if (variance > maxIndividualVariance) { |
169 #undef max | 175 #undef max |
170 return FXSYS_IntMax; | 176 return FXSYS_IntMax; |
171 } | 177 } |
172 totalVariance += variance; | 178 totalVariance += variance; |
173 } | 179 } |
174 return totalVariance / total; | 180 return totalVariance / total; |
175 } | 181 } |
OLD | NEW |