OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_ |
8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_ | 8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "core/fxcrt/include/cfx_weak_ptr.h" | |
13 #include "core/fxcrt/include/fx_string.h" | 12 #include "core/fxcrt/include/fx_string.h" |
14 #include "core/fxcrt/include/fx_system.h" | 13 #include "core/fxcrt/include/fx_system.h" |
15 | 14 |
16 #define PDFCS_DEVICEGRAY 1 | 15 #define PDFCS_DEVICEGRAY 1 |
17 #define PDFCS_DEVICERGB 2 | 16 #define PDFCS_DEVICERGB 2 |
18 #define PDFCS_DEVICECMYK 3 | 17 #define PDFCS_DEVICECMYK 3 |
19 #define PDFCS_CALGRAY 4 | 18 #define PDFCS_CALGRAY 4 |
20 #define PDFCS_CALRGB 5 | 19 #define PDFCS_CALRGB 5 |
21 #define PDFCS_LAB 6 | 20 #define PDFCS_LAB 6 |
22 #define PDFCS_ICCBASED 7 | 21 #define PDFCS_ICCBASED 7 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 FX_FLOAT m, | 97 FX_FLOAT m, |
99 FX_FLOAT y, | 98 FX_FLOAT y, |
100 FX_FLOAT k) const; | 99 FX_FLOAT k) const; |
101 | 100 |
102 int m_Family; | 101 int m_Family; |
103 uint32_t m_nComponents; | 102 uint32_t m_nComponents; |
104 CPDF_Array* m_pArray; | 103 CPDF_Array* m_pArray; |
105 uint32_t m_dwStdConversion; | 104 uint32_t m_dwStdConversion; |
106 }; | 105 }; |
107 | 106 |
108 using CPDF_CountedColorSpace = CFX_WeakPtr<CPDF_ColorSpace>::Handle; | |
109 | |
110 namespace std { | 107 namespace std { |
111 | 108 |
112 // Make std::unique_ptr<CPDF_ColorSpace> call Release() rather than | 109 // Make std::unique_ptr<CPDF_ColorSpace> call Release() rather than |
113 // simply deleting the object. | 110 // simply deleting the object. |
114 template <> | 111 template <> |
115 struct default_delete<CPDF_ColorSpace> { | 112 struct default_delete<CPDF_ColorSpace> { |
116 void operator()(CPDF_ColorSpace* pColorSpace) const { | 113 void operator()(CPDF_ColorSpace* pColorSpace) const { |
117 if (pColorSpace) | 114 if (pColorSpace) |
118 pColorSpace->Release(); | 115 pColorSpace->Release(); |
119 } | 116 } |
120 }; | 117 }; |
121 | 118 |
122 } // namespace std | 119 } // namespace std |
123 | 120 |
124 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_ | 121 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_ |
OLD | NEW |