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 2007 ZXing authors | 8 * Copyright 2007 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 HandlePossibleCenter(stateCount, i, maxJ); | 98 HandlePossibleCenter(stateCount, i, maxJ); |
99 if (confirmed) { | 99 if (confirmed) { |
100 return confirmed; | 100 return confirmed; |
101 } | 101 } |
102 } | 102 } |
103 } | 103 } |
104 if (m_possibleCenters.GetSize() != 0) { | 104 if (m_possibleCenters.GetSize() != 0) { |
105 return m_possibleCenters[0]->Clone(); | 105 return m_possibleCenters[0]->Clone(); |
106 } | 106 } |
107 e = BCExceptionRead; | 107 e = BCExceptionRead; |
108 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 108 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); |
109 return NULL; | 109 return nullptr; |
110 } | 110 } |
111 FX_FLOAT CBC_QRAlignmentPatternFinder::CenterFromEnd( | 111 FX_FLOAT CBC_QRAlignmentPatternFinder::CenterFromEnd( |
112 const CFX_Int32Array& stateCount, | 112 const CFX_Int32Array& stateCount, |
113 int32_t end) { | 113 int32_t end) { |
114 return (FX_FLOAT)(end - stateCount[2]) - stateCount[1] / 2.0f; | 114 return (FX_FLOAT)(end - stateCount[2]) - stateCount[1] / 2.0f; |
115 } | 115 } |
116 FX_BOOL CBC_QRAlignmentPatternFinder::FoundPatternCross( | 116 FX_BOOL CBC_QRAlignmentPatternFinder::FoundPatternCross( |
117 const CFX_Int32Array& stateCount) { | 117 const CFX_Int32Array& stateCount) { |
118 FX_FLOAT moduleSize = m_moduleSize; | 118 FX_FLOAT moduleSize = m_moduleSize; |
119 FX_FLOAT maxVariance = moduleSize / 2.0f; | 119 FX_FLOAT maxVariance = moduleSize / 2.0f; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 for (int32_t index = 0; index < max; index++) { | 188 for (int32_t index = 0; index < max; index++) { |
189 CBC_QRAlignmentPattern* center = m_possibleCenters[index]; | 189 CBC_QRAlignmentPattern* center = m_possibleCenters[index]; |
190 if (center->AboutEquals(estimatedModuleSize, centerI, centerJ)) { | 190 if (center->AboutEquals(estimatedModuleSize, centerI, centerJ)) { |
191 return new CBC_QRAlignmentPattern(centerJ, centerI, | 191 return new CBC_QRAlignmentPattern(centerJ, centerI, |
192 estimatedModuleSize); | 192 estimatedModuleSize); |
193 } | 193 } |
194 } | 194 } |
195 m_possibleCenters.Add( | 195 m_possibleCenters.Add( |
196 new CBC_QRAlignmentPattern(centerJ, centerI, estimatedModuleSize)); | 196 new CBC_QRAlignmentPattern(centerJ, centerI, estimatedModuleSize)); |
197 } | 197 } |
198 return NULL; | 198 return nullptr; |
199 } | 199 } |
OLD | NEW |