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/fpdfapi/page/pageint.h" | 7 #include "core/fpdfapi/page/pageint.h" |
8 | 8 |
9 #include <limits.h> | 9 #include <limits.h> |
10 | 10 |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 if (type == Type::kType0Sampled) | 744 if (type == Type::kType0Sampled) |
745 pFunc.reset(new CPDF_SampledFunc()); | 745 pFunc.reset(new CPDF_SampledFunc()); |
746 else if (type == Type::kType2ExpotentialInterpolation) | 746 else if (type == Type::kType2ExpotentialInterpolation) |
747 pFunc.reset(new CPDF_ExpIntFunc()); | 747 pFunc.reset(new CPDF_ExpIntFunc()); |
748 else if (type == Type::kType3Stitching) | 748 else if (type == Type::kType3Stitching) |
749 pFunc.reset(new CPDF_StitchFunc()); | 749 pFunc.reset(new CPDF_StitchFunc()); |
750 else if (type == Type::kType4PostScript) | 750 else if (type == Type::kType4PostScript) |
751 pFunc.reset(new CPDF_PSFunc()); | 751 pFunc.reset(new CPDF_PSFunc()); |
752 | 752 |
753 if (!pFunc || !pFunc->Init(pFuncObj)) | 753 if (!pFunc || !pFunc->Init(pFuncObj)) |
754 return std::unique_ptr<CPDF_Function>(); | 754 return nullptr; |
| 755 |
755 return pFunc; | 756 return pFunc; |
756 } | 757 } |
757 | 758 |
758 // static | 759 // static |
759 CPDF_Function::Type CPDF_Function::IntegerToFunctionType(int iType) { | 760 CPDF_Function::Type CPDF_Function::IntegerToFunctionType(int iType) { |
760 switch (iType) { | 761 switch (iType) { |
761 case 0: | 762 case 0: |
762 case 2: | 763 case 2: |
763 case 3: | 764 case 3: |
764 case 4: | 765 case 4: |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 return m_Type == Type::kType2ExpotentialInterpolation | 850 return m_Type == Type::kType2ExpotentialInterpolation |
850 ? static_cast<const CPDF_ExpIntFunc*>(this) | 851 ? static_cast<const CPDF_ExpIntFunc*>(this) |
851 : nullptr; | 852 : nullptr; |
852 } | 853 } |
853 | 854 |
854 const CPDF_StitchFunc* CPDF_Function::ToStitchFunc() const { | 855 const CPDF_StitchFunc* CPDF_Function::ToStitchFunc() const { |
855 return m_Type == Type::kType3Stitching | 856 return m_Type == Type::kType3Stitching |
856 ? static_cast<const CPDF_StitchFunc*>(this) | 857 ? static_cast<const CPDF_StitchFunc*>(this) |
857 : nullptr; | 858 : nullptr; |
858 } | 859 } |
OLD | NEW |