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_CPDF_COLORSTATE_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ |
8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ | 8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ |
9 | 9 |
10 #include "core/fpdfapi/fpdf_page/cpdf_colorstatedata.h" | 10 #include "core/fpdfapi/fpdf_page/cpdf_colorstatedata.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void SetFillPattern(CPDF_Pattern* pattern, | 44 void SetFillPattern(CPDF_Pattern* pattern, |
45 FX_FLOAT* pValue, | 45 FX_FLOAT* pValue, |
46 uint32_t nValues); | 46 uint32_t nValues); |
47 void SetStrokePattern(CPDF_Pattern* pattern, | 47 void SetStrokePattern(CPDF_Pattern* pattern, |
48 FX_FLOAT* pValue, | 48 FX_FLOAT* pValue, |
49 uint32_t nValues); | 49 uint32_t nValues); |
50 | 50 |
51 // TODO(tsepez): Stop leaking ColorStateData outside this class. | 51 // TODO(tsepez): Stop leaking ColorStateData outside this class. |
52 const CPDF_ColorStateData* GetObject() const { return m_Ref.GetObject(); } | 52 const CPDF_ColorStateData* GetObject() const { return m_Ref.GetObject(); } |
53 | 53 |
54 operator bool() const { return !!m_Ref; } | 54 explicit operator bool() const { return !!m_Ref; } |
55 | 55 |
56 private: | 56 private: |
57 void SetColor(CPDF_Color& color, | 57 void SetColor(CPDF_Color& color, |
58 uint32_t& rgb, | 58 uint32_t& rgb, |
59 CPDF_ColorSpace* pCS, | 59 CPDF_ColorSpace* pCS, |
60 FX_FLOAT* pValue, | 60 FX_FLOAT* pValue, |
61 uint32_t nValues); | 61 uint32_t nValues); |
62 | 62 |
63 CFX_CountRef<CPDF_ColorStateData> m_Ref; | 63 CFX_CountRef<CPDF_ColorStateData> m_Ref; |
64 }; | 64 }; |
65 | 65 |
66 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ | 66 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ |
OLD | NEW |