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