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_GENERALSTATE_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ |
8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ | 8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ |
9 | 9 |
10 #include "core/fpdfapi/fpdf_page/include/cpdf_generalstatedata.h" | |
11 #include "core/fxcrt/include/fx_basic.h" | 10 #include "core/fxcrt/include/fx_basic.h" |
| 11 #include "core/fxcrt/include/fx_coordinates.h" |
| 12 #include "core/fxge/include/fx_dib.h" |
| 13 |
| 14 class CPDF_Object; |
| 15 class CPDF_TransferFunc; |
12 | 16 |
13 class CPDF_GeneralState { | 17 class CPDF_GeneralState { |
14 public: | 18 public: |
15 CPDF_GeneralState(); | 19 CPDF_GeneralState(); |
16 CPDF_GeneralState(const CPDF_GeneralState& that); | 20 CPDF_GeneralState(const CPDF_GeneralState& that); |
17 ~CPDF_GeneralState(); | 21 ~CPDF_GeneralState(); |
18 | 22 |
19 void Emplace() { m_Ref.Emplace(); } | 23 void Emplace() { m_Ref.Emplace(); } |
20 operator bool() const { return !!m_Ref; } | 24 operator bool() const { return !!m_Ref; } |
21 | 25 |
(...skipping 10 matching lines...) Expand all Loading... |
32 | 36 |
33 CPDF_Object* GetSoftMask() const; | 37 CPDF_Object* GetSoftMask() const; |
34 void SetSoftMask(CPDF_Object* pObject); | 38 void SetSoftMask(CPDF_Object* pObject); |
35 | 39 |
36 CPDF_Object* GetTR() const; | 40 CPDF_Object* GetTR() const; |
37 void SetTR(CPDF_Object* pObject); | 41 void SetTR(CPDF_Object* pObject); |
38 | 42 |
39 CPDF_TransferFunc* GetTransferFunc() const; | 43 CPDF_TransferFunc* GetTransferFunc() const; |
40 void SetTransferFunc(CPDF_TransferFunc* pFunc); | 44 void SetTransferFunc(CPDF_TransferFunc* pFunc); |
41 | 45 |
42 void SetBlendMode(const CFX_ByteStringC& mode); | 46 void SetBlendMode(const CFX_ByteString& mode); |
43 | 47 |
44 const FX_FLOAT* GetSMaskMatrix() const; | 48 const CFX_Matrix* GetSMaskMatrix() const; |
45 FX_FLOAT* GetMutableSMaskMatrix(); | 49 void SetSMaskMatrix(const CFX_Matrix& matrix); |
46 | 50 |
47 bool GetFillOP() const; | 51 bool GetFillOP() const; |
48 void SetFillOP(bool op); | 52 void SetFillOP(bool op); |
49 | 53 |
50 bool GetStrokeOP() const; | 54 bool GetStrokeOP() const; |
51 void SetStrokeOP(bool op); | 55 void SetStrokeOP(bool op); |
52 | 56 |
53 int GetOPMode() const; | 57 int GetOPMode() const; |
54 void SetOPMode(int mode); | 58 void SetOPMode(int mode); |
55 | 59 |
56 void SetBG(CPDF_Object* pObject); | 60 void SetBG(CPDF_Object* pObject); |
57 void SetUCR(CPDF_Object* pObject); | 61 void SetUCR(CPDF_Object* pObject); |
58 void SetHT(CPDF_Object* pObject); | 62 void SetHT(CPDF_Object* pObject); |
59 | 63 |
60 void SetFlatness(FX_FLOAT flatness); | 64 void SetFlatness(FX_FLOAT flatness); |
61 void SetSmoothness(FX_FLOAT smoothness); | 65 void SetSmoothness(FX_FLOAT smoothness); |
62 | 66 |
63 bool GetStrokeAdjust() const; | 67 bool GetStrokeAdjust() const; |
64 void SetStrokeAdjust(bool adjust); | 68 void SetStrokeAdjust(bool adjust); |
65 | 69 |
66 void SetAlphaSource(bool source); | 70 void SetAlphaSource(bool source); |
67 void SetTextKnockout(bool knockout); | 71 void SetTextKnockout(bool knockout); |
68 | 72 |
69 void SetMatrix(const CFX_Matrix& matrix); | 73 void SetMatrix(const CFX_Matrix& matrix); |
70 CFX_Matrix* GetMutableMatrix(); | 74 CFX_Matrix* GetMutableMatrix(); |
71 | 75 |
72 private: | 76 private: |
73 CFX_CountRef<CPDF_GeneralStateData> m_Ref; | 77 class StateData { |
| 78 public: |
| 79 StateData(); |
| 80 StateData(const StateData& that); |
| 81 ~StateData(); |
| 82 |
| 83 CFX_ByteString m_BlendMode; |
| 84 int m_BlendType; |
| 85 CPDF_Object* m_pSoftMask; |
| 86 CFX_Matrix m_SMaskMatrix; |
| 87 FX_FLOAT m_StrokeAlpha; |
| 88 FX_FLOAT m_FillAlpha; |
| 89 CPDF_Object* m_pTR; |
| 90 CPDF_TransferFunc* m_pTransferFunc; |
| 91 CFX_Matrix m_Matrix; |
| 92 int m_RenderIntent; |
| 93 bool m_StrokeAdjust; |
| 94 bool m_AlphaSource; |
| 95 bool m_TextKnockout; |
| 96 bool m_StrokeOP; |
| 97 bool m_FillOP; |
| 98 int m_OPMode; |
| 99 CPDF_Object* m_pBG; |
| 100 CPDF_Object* m_pUCR; |
| 101 CPDF_Object* m_pHT; |
| 102 FX_FLOAT m_Flatness; |
| 103 FX_FLOAT m_Smoothness; |
| 104 }; |
| 105 |
| 106 CFX_CountRef<StateData> m_Ref; |
74 }; | 107 }; |
75 | 108 |
76 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ | 109 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ |
OLD | NEW |