| 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 2009 ZXing authors | 8 * Copyright 2009 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 18 matching lines...) Expand all Loading... |
| 29 CBC_BinaryBitmap::CBC_BinaryBitmap(CBC_Binarizer *binarizer): m_binarizer(binari
zer), m_matrix(NULL) | 29 CBC_BinaryBitmap::CBC_BinaryBitmap(CBC_Binarizer *binarizer): m_binarizer(binari
zer), m_matrix(NULL) |
| 30 { | 30 { |
| 31 } | 31 } |
| 32 CBC_BinaryBitmap::~CBC_BinaryBitmap() | 32 CBC_BinaryBitmap::~CBC_BinaryBitmap() |
| 33 { | 33 { |
| 34 if (m_matrix != NULL) { | 34 if (m_matrix != NULL) { |
| 35 delete m_matrix; | 35 delete m_matrix; |
| 36 } | 36 } |
| 37 m_matrix = NULL; | 37 m_matrix = NULL; |
| 38 } | 38 } |
| 39 FX_INT32 CBC_BinaryBitmap::GetHeight() | 39 int32_t CBC_BinaryBitmap::GetHeight() |
| 40 { | 40 { |
| 41 return m_binarizer->GetLuminanceSource()->GetHeight(); | 41 return m_binarizer->GetLuminanceSource()->GetHeight(); |
| 42 } | 42 } |
| 43 FX_INT32 CBC_BinaryBitmap::GetWidth() | 43 int32_t CBC_BinaryBitmap::GetWidth() |
| 44 { | 44 { |
| 45 return m_binarizer->GetLuminanceSource()->GetWidth(); | 45 return m_binarizer->GetLuminanceSource()->GetWidth(); |
| 46 } | 46 } |
| 47 CBC_CommonBitMatrix *CBC_BinaryBitmap::GetMatrix(FX_INT32 &e) | 47 CBC_CommonBitMatrix *CBC_BinaryBitmap::GetMatrix(int32_t &e) |
| 48 { | 48 { |
| 49 if (m_matrix == NULL) { | 49 if (m_matrix == NULL) { |
| 50 m_matrix = m_binarizer->GetBlackMatrix(e); | 50 m_matrix = m_binarizer->GetBlackMatrix(e); |
| 51 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 51 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
| 52 } | 52 } |
| 53 return m_matrix; | 53 return m_matrix; |
| 54 } | 54 } |
| 55 FX_BOOL CBC_BinaryBitmap::IsCropSupported() | 55 FX_BOOL CBC_BinaryBitmap::IsCropSupported() |
| 56 { | 56 { |
| 57 return m_binarizer->GetLuminanceSource()->IsCropSupported(); | 57 return m_binarizer->GetLuminanceSource()->IsCropSupported(); |
| 58 } | 58 } |
| 59 FX_BOOL CBC_BinaryBitmap::IsRotateSupported() | 59 FX_BOOL CBC_BinaryBitmap::IsRotateSupported() |
| 60 { | 60 { |
| 61 return m_binarizer->GetLuminanceSource()->IsRotateSupported(); | 61 return m_binarizer->GetLuminanceSource()->IsRotateSupported(); |
| 62 } | 62 } |
| 63 CBC_CommonBitArray *CBC_BinaryBitmap::GetBlackRow(FX_INT32 y, CBC_CommonBitArray
*row, FX_INT32 &e) | 63 CBC_CommonBitArray *CBC_BinaryBitmap::GetBlackRow(int32_t y, CBC_CommonBitArray
*row, int32_t &e) |
| 64 { | 64 { |
| 65 CBC_CommonBitArray *temp = m_binarizer->GetBlackRow(y, row, e); | 65 CBC_CommonBitArray *temp = m_binarizer->GetBlackRow(y, row, e); |
| 66 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 66 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
| 67 return temp; | 67 return temp; |
| 68 } | 68 } |
| 69 CBC_CommonBitMatrix *CBC_BinaryBitmap::GetBlackMatrix(FX_INT32 &e) | 69 CBC_CommonBitMatrix *CBC_BinaryBitmap::GetBlackMatrix(int32_t &e) |
| 70 { | 70 { |
| 71 if (m_matrix == NULL) { | 71 if (m_matrix == NULL) { |
| 72 m_matrix = m_binarizer->GetBlackMatrix(e); | 72 m_matrix = m_binarizer->GetBlackMatrix(e); |
| 73 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 73 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
| 74 } | 74 } |
| 75 return m_matrix; | 75 return m_matrix; |
| 76 } | 76 } |
| OLD | NEW |