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" | 10 #include "core/fpdfapi/fpdf_page/include/cpdf_generalstatedata.h" |
11 #include "core/include/fxcrt/fx_basic.h" | 11 #include "core/fxcrt/include/fx_basic.h" |
12 | 12 |
13 class CPDF_GeneralState : public CFX_CountRef<CPDF_GeneralStateData> { | 13 class CPDF_GeneralState : public CFX_CountRef<CPDF_GeneralStateData> { |
14 public: | 14 public: |
15 void SetRenderIntent(const CFX_ByteString& ri); | 15 void SetRenderIntent(const CFX_ByteString& ri); |
16 | 16 |
17 int GetBlendType() const { | 17 int GetBlendType() const { |
18 return m_pObject ? m_pObject->m_BlendType : FXDIB_BLEND_NORMAL; | 18 return m_pObject ? m_pObject->m_BlendType : FXDIB_BLEND_NORMAL; |
19 } | 19 } |
20 | 20 |
21 int GetAlpha(FX_BOOL bStroke) const { | 21 int GetAlpha(FX_BOOL bStroke) const { |
22 if (!m_pObject) | 22 if (!m_pObject) |
23 return 255; | 23 return 255; |
24 return FXSYS_round( | 24 return FXSYS_round( |
25 (bStroke ? m_pObject->m_StrokeAlpha : m_pObject->m_FillAlpha) * 255); | 25 (bStroke ? m_pObject->m_StrokeAlpha : m_pObject->m_FillAlpha) * 255); |
26 } | 26 } |
27 }; | 27 }; |
28 | 28 |
29 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ | 29 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ |
OLD | NEW |