| 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 27 matching lines...) Expand all Loading... |
| 38 CBC_QRFinderPattern *CBC_QRFinderPattern::Clone() | 38 CBC_QRFinderPattern *CBC_QRFinderPattern::Clone() |
| 39 { | 39 { |
| 40 CBC_QRFinderPattern *temp = FX_NEW CBC_QRFinderPattern(m_x, m_y, m_estimated
ModuleSize); | 40 CBC_QRFinderPattern *temp = FX_NEW CBC_QRFinderPattern(m_x, m_y, m_estimated
ModuleSize); |
| 41 temp->m_count = m_count; | 41 temp->m_count = m_count; |
| 42 return temp; | 42 return temp; |
| 43 } | 43 } |
| 44 FX_FLOAT CBC_QRFinderPattern::GetEstimatedModuleSize() | 44 FX_FLOAT CBC_QRFinderPattern::GetEstimatedModuleSize() |
| 45 { | 45 { |
| 46 return m_estimatedModuleSize; | 46 return m_estimatedModuleSize; |
| 47 } | 47 } |
| 48 FX_INT32 CBC_QRFinderPattern::GetCount() | 48 int32_t CBC_QRFinderPattern::GetCount() |
| 49 { | 49 { |
| 50 return m_count; | 50 return m_count; |
| 51 } | 51 } |
| 52 void CBC_QRFinderPattern::IncrementCount() | 52 void CBC_QRFinderPattern::IncrementCount() |
| 53 { | 53 { |
| 54 m_count++; | 54 m_count++; |
| 55 } | 55 } |
| 56 FX_BOOL CBC_QRFinderPattern::AboutEquals(FX_FLOAT moduleSize, FX_FLOAT i, FX_FLO
AT j) | 56 FX_BOOL CBC_QRFinderPattern::AboutEquals(FX_FLOAT moduleSize, FX_FLOAT i, FX_FLO
AT j) |
| 57 { | 57 { |
| 58 if((fabs(i - GetY()) <= moduleSize) && (fabs(j - GetX()) <= moduleSize)) { | 58 if((fabs(i - GetY()) <= moduleSize) && (fabs(j - GetX()) <= moduleSize)) { |
| 59 FX_FLOAT moduleSizeDiff = fabs(moduleSize - m_estimatedModuleSize); | 59 FX_FLOAT moduleSizeDiff = fabs(moduleSize - m_estimatedModuleSize); |
| 60 return (moduleSizeDiff <= 1.0f) || (moduleSizeDiff / m_estimatedModuleSi
ze <= 1.0f); | 60 return (moduleSizeDiff <= 1.0f) || (moduleSizeDiff / m_estimatedModuleSi
ze <= 1.0f); |
| 61 } | 61 } |
| 62 return false; | 62 return false; |
| 63 } | 63 } |
| 64 FX_FLOAT CBC_QRFinderPattern::GetX() | 64 FX_FLOAT CBC_QRFinderPattern::GetX() |
| 65 { | 65 { |
| 66 return m_x; | 66 return m_x; |
| 67 } | 67 } |
| 68 FX_FLOAT CBC_QRFinderPattern::GetY() | 68 FX_FLOAT CBC_QRFinderPattern::GetY() |
| 69 { | 69 { |
| 70 return m_y; | 70 return m_y; |
| 71 } | 71 } |
| OLD | NEW |