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" |
11 #include "core/fxcrt/include/cfx_count_ref.h" | 11 #include "core/fxcrt/include/cfx_count_ref.h" |
| 12 #include "core/fxcrt/include/fx_basic.h" |
| 13 #include "core/fxcrt/include/fx_system.h" |
| 14 |
| 15 class CPDF_Color; |
| 16 class CPDF_ColorSpace; |
| 17 class CPDF_Pattern; |
12 | 18 |
13 class CPDF_ColorState : public CFX_CountRef<CPDF_ColorStateData> { | 19 class CPDF_ColorState : public CFX_CountRef<CPDF_ColorStateData> { |
| 20 public: |
| 21 const CPDF_Color* GetFillColor() const { |
| 22 const CPDF_ColorStateData* pData = GetObject(); |
| 23 return pData ? &pData->m_FillColor : nullptr; |
| 24 } |
| 25 |
| 26 const CPDF_Color* GetStrokeColor() const { |
| 27 const CPDF_ColorStateData* pData = GetObject(); |
| 28 return pData ? &pData->m_StrokeColor : nullptr; |
| 29 } |
| 30 |
| 31 void SetFillColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, uint32_t nValues); |
| 32 void SetStrokeColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, uint32_t nValues); |
| 33 void SetFillPattern(CPDF_Pattern* pattern, |
| 34 FX_FLOAT* pValue, |
| 35 uint32_t nValues); |
| 36 void SetStrokePattern(CPDF_Pattern* pattern, |
| 37 FX_FLOAT* pValue, |
| 38 uint32_t nValues); |
| 39 |
| 40 private: |
| 41 void SetColor(CPDF_Color& color, |
| 42 uint32_t& rgb, |
| 43 CPDF_ColorSpace* pCS, |
| 44 FX_FLOAT* pValue, |
| 45 uint32_t nValues); |
14 }; | 46 }; |
15 | 47 |
16 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ | 48 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATE_H_ |
OLD | NEW |