OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ |
| 8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ |
| 9 |
| 10 #include "core/fpdfapi/fpdf_page/include/cpdf_generalstatedata.h" |
| 11 #include "core/include/fxcrt/fx_basic.h" |
| 12 |
| 13 class CPDF_GeneralState : public CFX_CountRef<CPDF_GeneralStateData> { |
| 14 public: |
| 15 void SetRenderIntent(const CFX_ByteString& ri); |
| 16 |
| 17 int GetBlendType() const { |
| 18 return m_pObject ? m_pObject->m_BlendType : FXDIB_BLEND_NORMAL; |
| 19 } |
| 20 |
| 21 int GetAlpha(FX_BOOL bStroke) const { |
| 22 if (!m_pObject) |
| 23 return 255; |
| 24 return FXSYS_round( |
| 25 (bStroke ? m_pObject->m_StrokeAlpha : m_pObject->m_FillAlpha) * 255); |
| 26 } |
| 27 }; |
| 28 |
| 29 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_GENERALSTATE_H_ |
OLD | NEW |