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_CPDF_SHADINGPATTERN_H_ |
| 8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_SHADINGPATTERN_H_ |
| 9 |
| 10 #include "core/fpdfapi/fpdf_page/cpdf_countedobject.h" |
| 11 #include "core/fpdfapi/fpdf_page/cpdf_pattern.h" |
| 12 #include "core/fpdfapi/fpdf_page/pageint.h" |
| 13 #include "core/fxcrt/include/fx_system.h" |
| 14 |
| 15 typedef enum { |
| 16 kInvalidShading = 0, |
| 17 kFunctionBasedShading = 1, |
| 18 kAxialShading = 2, |
| 19 kRadialShading = 3, |
| 20 kFreeFormGouraudTriangleMeshShading = 4, |
| 21 kLatticeFormGouraudTriangleMeshShading = 5, |
| 22 kCoonsPatchMeshShading = 6, |
| 23 kTensorProductPatchMeshShading = 7, |
| 24 kMaxShading = 8 |
| 25 } ShadingType; |
| 26 |
| 27 class CFX_Matrix; |
| 28 class CPDF_ColorSpace; |
| 29 class CPDF_Document; |
| 30 class CPDF_Object; |
| 31 |
| 32 class CPDF_ShadingPattern : public CPDF_Pattern { |
| 33 public: |
| 34 CPDF_ShadingPattern(CPDF_Document* pDoc, |
| 35 CPDF_Object* pPatternObj, |
| 36 FX_BOOL bShading, |
| 37 const CFX_Matrix* parentMatrix); |
| 38 |
| 39 ~CPDF_ShadingPattern() override; |
| 40 |
| 41 bool IsMeshShading() const { |
| 42 return m_ShadingType == kFreeFormGouraudTriangleMeshShading || |
| 43 m_ShadingType == kLatticeFormGouraudTriangleMeshShading || |
| 44 m_ShadingType == kCoonsPatchMeshShading || |
| 45 m_ShadingType == kTensorProductPatchMeshShading; |
| 46 } |
| 47 FX_BOOL Load(); |
| 48 |
| 49 ShadingType m_ShadingType; |
| 50 FX_BOOL m_bShadingObj; |
| 51 CPDF_Object* m_pShadingObj; |
| 52 |
| 53 // Still keep |m_pCS| as some CPDF_ColorSpace (name object) are not managed |
| 54 // as counted objects. Refer to CPDF_DocPageData::GetColorSpace. |
| 55 CPDF_ColorSpace* m_pCS; |
| 56 |
| 57 CPDF_CountedColorSpace* m_pCountedCS; |
| 58 CPDF_Function* m_pFunctions[4]; |
| 59 int m_nFuncs; |
| 60 }; |
| 61 |
| 62 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_SHADINGPATTERN_H_ |
OLD | NEW |