| 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 } | 38 } |
| 39 m_version = ReadVersion(bitMatrix, e); | 39 m_version = ReadVersion(bitMatrix, e); |
| 40 BC_EXCEPTION_CHECK_ReturnVoid(e); | 40 BC_EXCEPTION_CHECK_ReturnVoid(e); |
| 41 m_mappingBitMatrix = ExtractDataRegion(bitMatrix, e); | 41 m_mappingBitMatrix = ExtractDataRegion(bitMatrix, e); |
| 42 BC_EXCEPTION_CHECK_ReturnVoid(e); | 42 BC_EXCEPTION_CHECK_ReturnVoid(e); |
| 43 m_readMappingMatrix = new CBC_CommonBitMatrix(); | 43 m_readMappingMatrix = new CBC_CommonBitMatrix(); |
| 44 m_readMappingMatrix->Init(m_mappingBitMatrix->GetWidth(), | 44 m_readMappingMatrix->Init(m_mappingBitMatrix->GetWidth(), |
| 45 m_mappingBitMatrix->GetHeight()); | 45 m_mappingBitMatrix->GetHeight()); |
| 46 } | 46 } |
| 47 CBC_DataMatrixBitMatrixParser::~CBC_DataMatrixBitMatrixParser() { | 47 CBC_DataMatrixBitMatrixParser::~CBC_DataMatrixBitMatrixParser() { |
| 48 if (m_mappingBitMatrix != NULL) { | 48 delete m_mappingBitMatrix; |
| 49 delete m_mappingBitMatrix; | 49 delete m_readMappingMatrix; |
| 50 } | |
| 51 m_mappingBitMatrix = NULL; | |
| 52 if (m_readMappingMatrix != NULL) { | |
| 53 delete m_readMappingMatrix; | |
| 54 } | |
| 55 m_readMappingMatrix = NULL; | |
| 56 } | 50 } |
| 57 CBC_DataMatrixVersion* CBC_DataMatrixBitMatrixParser::GetVersion() { | 51 CBC_DataMatrixVersion* CBC_DataMatrixBitMatrixParser::GetVersion() { |
| 58 return m_version; | 52 return m_version; |
| 59 } | 53 } |
| 60 CBC_DataMatrixVersion* CBC_DataMatrixBitMatrixParser::ReadVersion( | 54 CBC_DataMatrixVersion* CBC_DataMatrixBitMatrixParser::ReadVersion( |
| 61 CBC_CommonBitMatrix* bitMatrix, | 55 CBC_CommonBitMatrix* bitMatrix, |
| 62 int32_t& e) { | 56 int32_t& e) { |
| 63 int32_t rows = bitMatrix->GetHeight(); | 57 int32_t rows = bitMatrix->GetHeight(); |
| 64 int32_t columns = bitMatrix->GetWidth(); | 58 int32_t columns = bitMatrix->GetWidth(); |
| 65 CBC_DataMatrixVersion* temp = | 59 CBC_DataMatrixVersion* temp = |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 if (bitMatrix->Get(readColumnOffset, readRowOffset)) { | 365 if (bitMatrix->Get(readColumnOffset, readRowOffset)) { |
| 372 int32_t writeColumnOffset = dataRegionColumnOffset + j; | 366 int32_t writeColumnOffset = dataRegionColumnOffset + j; |
| 373 bitMatrixWithoutAlignment->Set(writeColumnOffset, writeRowOffset); | 367 bitMatrixWithoutAlignment->Set(writeColumnOffset, writeRowOffset); |
| 374 } | 368 } |
| 375 } | 369 } |
| 376 } | 370 } |
| 377 } | 371 } |
| 378 } | 372 } |
| 379 return bitMatrixWithoutAlignment; | 373 return bitMatrixWithoutAlignment; |
| 380 } | 374 } |
| OLD | NEW |