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 "core/fxcrt/include/fx_string.h" | 10 #include "core/fxcrt/include/fx_string.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 public: | 30 public: |
31 static CPDF_ColorSpace* GetStockCS(int Family); | 31 static CPDF_ColorSpace* GetStockCS(int Family); |
32 static CPDF_ColorSpace* Load(CPDF_Document* pDoc, CPDF_Object* pCSObj); | 32 static CPDF_ColorSpace* Load(CPDF_Document* pDoc, CPDF_Object* pCSObj); |
33 static CPDF_ColorSpace* ColorspaceFromName(const CFX_ByteString& name); | 33 static CPDF_ColorSpace* ColorspaceFromName(const CFX_ByteString& name); |
34 | 34 |
35 void ReleaseCS(); | 35 void ReleaseCS(); |
36 | 36 |
37 int GetBufSize() const; | 37 int GetBufSize() const; |
38 FX_FLOAT* CreateBuf(); | 38 FX_FLOAT* CreateBuf(); |
39 void GetDefaultColor(FX_FLOAT* buf) const; | 39 void GetDefaultColor(FX_FLOAT* buf) const; |
40 FX_DWORD CountComponents() const { return m_nComponents; } | 40 uint32_t CountComponents() const { return m_nComponents; } |
41 int GetFamily() const { return m_Family; } | 41 int GetFamily() const { return m_Family; } |
42 virtual void GetDefaultValue(int iComponent, | 42 virtual void GetDefaultValue(int iComponent, |
43 FX_FLOAT& value, | 43 FX_FLOAT& value, |
44 FX_FLOAT& min, | 44 FX_FLOAT& min, |
45 FX_FLOAT& max) const { | 45 FX_FLOAT& max) const { |
46 value = 0; | 46 value = 0; |
47 min = 0; | 47 min = 0; |
48 max = 1.0f; | 48 max = 1.0f; |
49 } | 49 } |
50 | 50 |
(...skipping 29 matching lines...) Expand all Loading... |
80 | 80 |
81 CPDF_Array*& GetArray() { return m_pArray; } | 81 CPDF_Array*& GetArray() { return m_pArray; } |
82 int GetMaxIndex() const; | 82 int GetMaxIndex() const; |
83 virtual CPDF_ColorSpace* GetBaseCS() const { return NULL; } | 83 virtual CPDF_ColorSpace* GetBaseCS() const { return NULL; } |
84 | 84 |
85 virtual void EnableStdConversion(FX_BOOL bEnabled); | 85 virtual void EnableStdConversion(FX_BOOL bEnabled); |
86 | 86 |
87 CPDF_Document* const m_pDocument; | 87 CPDF_Document* const m_pDocument; |
88 | 88 |
89 protected: | 89 protected: |
90 CPDF_ColorSpace(CPDF_Document* pDoc, int family, FX_DWORD nComponents) | 90 CPDF_ColorSpace(CPDF_Document* pDoc, int family, uint32_t nComponents) |
91 : m_pDocument(pDoc), | 91 : m_pDocument(pDoc), |
92 m_Family(family), | 92 m_Family(family), |
93 m_nComponents(nComponents), | 93 m_nComponents(nComponents), |
94 m_pArray(nullptr), | 94 m_pArray(nullptr), |
95 m_dwStdConversion(0) {} | 95 m_dwStdConversion(0) {} |
96 virtual ~CPDF_ColorSpace() {} | 96 virtual ~CPDF_ColorSpace() {} |
97 | 97 |
98 virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) { | 98 virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) { |
99 return TRUE; | 99 return TRUE; |
100 } | 100 } |
101 virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, | 101 virtual FX_BOOL v_GetCMYK(FX_FLOAT* pBuf, |
102 FX_FLOAT& c, | 102 FX_FLOAT& c, |
103 FX_FLOAT& m, | 103 FX_FLOAT& m, |
104 FX_FLOAT& y, | 104 FX_FLOAT& y, |
105 FX_FLOAT& k) const { | 105 FX_FLOAT& k) const { |
106 return FALSE; | 106 return FALSE; |
107 } | 107 } |
108 virtual FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, | 108 virtual FX_BOOL v_SetCMYK(FX_FLOAT* pBuf, |
109 FX_FLOAT c, | 109 FX_FLOAT c, |
110 FX_FLOAT m, | 110 FX_FLOAT m, |
111 FX_FLOAT y, | 111 FX_FLOAT y, |
112 FX_FLOAT k) const { | 112 FX_FLOAT k) const { |
113 return FALSE; | 113 return FALSE; |
114 } | 114 } |
115 | 115 |
116 int m_Family; | 116 int m_Family; |
117 FX_DWORD m_nComponents; | 117 uint32_t m_nComponents; |
118 CPDF_Array* m_pArray; | 118 CPDF_Array* m_pArray; |
119 FX_DWORD m_dwStdConversion; | 119 uint32_t m_dwStdConversion; |
120 }; | 120 }; |
121 | 121 |
122 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_ | 122 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_ |
OLD | NEW |