| 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 | 6 |
| 7 #include "core/src/fpdfapi/fpdf_page/pageint.h" | 7 #include "core/fpdfapi/fpdf_page/pageint.h" |
| 8 | 8 |
| 9 #include <limits.h> | 9 #include <limits.h> |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <utility> | 12 #include <utility> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "core/include/fpdfapi/cpdf_array.h" | 15 #include "core/include/fpdfapi/cpdf_array.h" |
| 16 #include "core/include/fpdfapi/cpdf_dictionary.h" | 16 #include "core/include/fpdfapi/cpdf_dictionary.h" |
| 17 #include "core/include/fpdfapi/cpdf_simple_parser.h" | 17 #include "core/include/fpdfapi/cpdf_simple_parser.h" |
| (...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 FX_FLOAT* m_pBeginValues; | 707 FX_FLOAT* m_pBeginValues; |
| 708 FX_FLOAT* m_pEndValues; | 708 FX_FLOAT* m_pEndValues; |
| 709 int m_nOrigOutputs; | 709 int m_nOrigOutputs; |
| 710 }; | 710 }; |
| 711 | 711 |
| 712 CPDF_ExpIntFunc::CPDF_ExpIntFunc() { | 712 CPDF_ExpIntFunc::CPDF_ExpIntFunc() { |
| 713 m_pBeginValues = NULL; | 713 m_pBeginValues = NULL; |
| 714 m_pEndValues = NULL; | 714 m_pEndValues = NULL; |
| 715 } | 715 } |
| 716 CPDF_ExpIntFunc::~CPDF_ExpIntFunc() { | 716 CPDF_ExpIntFunc::~CPDF_ExpIntFunc() { |
| 717 FX_Free(m_pBeginValues); | 717 FX_Free(m_pBeginValues); |
| 718 FX_Free(m_pEndValues); | 718 FX_Free(m_pEndValues); |
| 719 } | 719 } |
| 720 FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj) { | 720 FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj) { |
| 721 CPDF_Dictionary* pDict = pObj->GetDict(); | 721 CPDF_Dictionary* pDict = pObj->GetDict(); |
| 722 if (!pDict) { | 722 if (!pDict) { |
| 723 return FALSE; | 723 return FALSE; |
| 724 } | 724 } |
| 725 CPDF_Array* pArray0 = pDict->GetArrayBy("C0"); | 725 CPDF_Array* pArray0 = pDict->GetArrayBy("C0"); |
| 726 if (m_nOutputs == 0) { | 726 if (m_nOutputs == 0) { |
| 727 m_nOutputs = 1; | 727 m_nOutputs = 1; |
| 728 if (pArray0) { | 728 if (pArray0) { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 for (int i = 0; i < m_nOutputs; i++) { | 957 for (int i = 0; i < m_nOutputs; i++) { |
| 958 if (results[i] < m_pRanges[i * 2]) { | 958 if (results[i] < m_pRanges[i * 2]) { |
| 959 results[i] = m_pRanges[i * 2]; | 959 results[i] = m_pRanges[i * 2]; |
| 960 } else if (results[i] > m_pRanges[i * 2 + 1]) { | 960 } else if (results[i] > m_pRanges[i * 2 + 1]) { |
| 961 results[i] = m_pRanges[i * 2 + 1]; | 961 results[i] = m_pRanges[i * 2 + 1]; |
| 962 } | 962 } |
| 963 } | 963 } |
| 964 } | 964 } |
| 965 return TRUE; | 965 return TRUE; |
| 966 } | 966 } |
| OLD | NEW |