| 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_COLORSTATEDATA_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATEDATA_H_ |
| 8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATEDATA_H_ | 8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATEDATA_H_ |
| 9 | 9 |
| 10 #include "core/fpdfapi/fpdf_page/include/cpdf_color.h" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_color.h" |
| 11 #include "core/fxcrt/include/fx_system.h" | 11 #include "core/fxcrt/include/fx_system.h" |
| 12 | 12 |
| 13 class CPDF_Color; | |
| 14 class CPDF_ColorSpace; | |
| 15 class CPDF_Pattern; | |
| 16 | |
| 17 class CPDF_ColorStateData { | 13 class CPDF_ColorStateData { |
| 18 public: | 14 public: |
| 19 CPDF_ColorStateData() : m_FillRGB(0), m_StrokeRGB(0) {} | 15 CPDF_ColorStateData() : m_FillRGB(0), m_StrokeRGB(0) {} |
| 20 CPDF_ColorStateData(const CPDF_ColorStateData& src); | 16 CPDF_ColorStateData(const CPDF_ColorStateData& src); |
| 21 | 17 |
| 22 void SetDefault(); | 18 void Default(); |
| 23 | 19 |
| 24 uint32_t GetFillRGB() const { return m_FillRGB; } | 20 CPDF_Color m_FillColor; |
| 25 void SetFillRGB(uint32_t rgb) { m_FillRGB = rgb; } | |
| 26 | |
| 27 uint32_t GetStrokeRGB() const { return m_StrokeRGB; } | |
| 28 void SetStrokeRGB(uint32_t rgb) { m_StrokeRGB = rgb; } | |
| 29 | |
| 30 CPDF_Color* GetFillColor() { return &m_FillColor; } | |
| 31 const CPDF_Color* GetFillColor() const { return &m_FillColor; } | |
| 32 void SetFillColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, uint32_t nValues); | |
| 33 | |
| 34 CPDF_Color* GetStrokeColor() { return &m_StrokeColor; } | |
| 35 const CPDF_Color* GetStrokeColor() const { return &m_StrokeColor; } | |
| 36 void SetStrokeColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, uint32_t nValues); | |
| 37 | |
| 38 void SetFillPattern(CPDF_Pattern* pattern, | |
| 39 FX_FLOAT* pValue, | |
| 40 uint32_t nValues); | |
| 41 void SetStrokePattern(CPDF_Pattern* pattern, | |
| 42 FX_FLOAT* pValue, | |
| 43 uint32_t nValues); | |
| 44 | |
| 45 private: | |
| 46 void SetColor(CPDF_Color& color, | |
| 47 uint32_t& rgb, | |
| 48 CPDF_ColorSpace* pCS, | |
| 49 FX_FLOAT* pValue, | |
| 50 uint32_t nValues); | |
| 51 | |
| 52 uint32_t m_FillRGB; | 21 uint32_t m_FillRGB; |
| 22 CPDF_Color m_StrokeColor; |
| 53 uint32_t m_StrokeRGB; | 23 uint32_t m_StrokeRGB; |
| 54 CPDF_Color m_FillColor; | |
| 55 CPDF_Color m_StrokeColor; | |
| 56 }; | 24 }; |
| 57 | 25 |
| 58 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATEDATA_H_ | 26 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATEDATA_H_ |
| OLD | NEW |