OLD | NEW |
---|---|
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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 _FPDF_RESOURCE_ | 7 #ifndef _FPDF_RESOURCE_ |
8 #define _FPDF_RESOURCE_ | 8 #define _FPDF_RESOURCE_ |
9 #ifndef _FPDF_PARSER_ | 9 #ifndef _FPDF_PARSER_ |
10 #include "fpdf_parser.h" | 10 #include "fpdf_parser.h" |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
675 CPDF_Array* m_pArray; | 675 CPDF_Array* m_pArray; |
676 | 676 |
677 FX_DWORD m_dwStdConversion; | 677 FX_DWORD m_dwStdConversion; |
678 }; | 678 }; |
679 class CPDF_Color : public CFX_Object | 679 class CPDF_Color : public CFX_Object |
680 { | 680 { |
681 public: | 681 public: |
682 | 682 |
683 CPDF_Color() | 683 CPDF_Color() |
684 { | 684 { |
685 m_pBuffer = NULL; | 685 m_pBuffer = NULL; |
Tom Sepez
2014/09/02 17:15:49
Nit: can we clear these in the same order as which
Bo Xu
2014/09/02 19:05:34
Done.
| |
686 m_pCS = NULL; | 686 m_pCS = NULL; |
687 m_pDocument = NULL; | |
687 } | 688 } |
688 | 689 |
689 CPDF_Color(int family); | 690 CPDF_Color(int family); |
690 | 691 |
691 ~CPDF_Color(); | 692 ~CPDF_Color(); |
692 | 693 |
693 FX_BOOL IsNull() const | 694 FX_BOOL IsNull() const |
694 { | 695 { |
695 return m_pBuffer == NULL; | 696 return m_pBuffer == NULL; |
696 } | 697 } |
(...skipping 17 matching lines...) Expand all Loading... | |
714 | 715 |
715 CPDF_Pattern* GetPattern() const; | 716 CPDF_Pattern* GetPattern() const; |
716 | 717 |
717 CPDF_ColorSpace* GetPatternCS() const; | 718 CPDF_ColorSpace* GetPatternCS() const; |
718 | 719 |
719 FX_FLOAT* GetPatternColor() const; | 720 FX_FLOAT* GetPatternColor() const; |
720 | 721 |
721 CPDF_ColorSpace* m_pCS; | 722 CPDF_ColorSpace* m_pCS; |
722 | 723 |
723 FX_FLOAT* m_pBuffer; | 724 FX_FLOAT* m_pBuffer; |
725 | |
Tom Sepez
2014/09/02 17:15:49
nit: can this be protected/private?
Bo Xu
2014/09/02 19:05:34
Done.
| |
726 CPDF_Document* m_pDocument; | |
Tom Sepez
2014/09/02 17:15:49
Are we sure that the document will still be valid
Tom Sepez
2014/09/02 17:17:12
In other words,
Are we sure that the document will
Bo Xu
2014/09/02 19:05:34
Yes, the destrutor of color is in the destructor o
| |
727 | |
724 protected: | 728 protected: |
725 void ReleaseBuffer(); | 729 void ReleaseBuffer(); |
726 void ReleaseColorSpace(); | 730 void ReleaseColorSpace(); |
727 }; | 731 }; |
728 #define PATTERN_TILING 1 | 732 #define PATTERN_TILING 1 |
729 #define PATTERN_SHADING 2 | 733 #define PATTERN_SHADING 2 |
730 class CPDF_Pattern : public CFX_Object | 734 class CPDF_Pattern : public CFX_Object |
731 { | 735 { |
732 public: | 736 public: |
733 | 737 |
734 virtual ~CPDF_Pattern(); | 738 virtual ~CPDF_Pattern(); |
735 void SaveColor(CPDF_Color* pColor) {m_pColor = pColor;} | |
736 | 739 |
737 CPDF_Object* m_pPatternObj; | 740 CPDF_Object* m_pPatternObj; |
738 | 741 |
739 int m_PatternType; | 742 int m_PatternType; |
740 | 743 |
741 CFX_AffineMatrix m_Pattern2Form; | 744 CFX_AffineMatrix m_Pattern2Form; |
742 CFX_AffineMatrix m_ParentMatrix; | 745 CFX_AffineMatrix m_ParentMatrix; |
743 | 746 |
744 CPDF_Document* m_pDocument; | 747 CPDF_Document* m_pDocument; |
745 CPDF_Color* m_pColor; | |
746 | 748 |
747 protected: | 749 protected: |
748 | 750 |
749 CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix); | 751 CPDF_Pattern(const CFX_AffineMatrix* pParentMatrix); |
750 }; | 752 }; |
751 | 753 |
752 class CPDF_TilingPattern : public CPDF_Pattern | 754 class CPDF_TilingPattern : public CPDF_Pattern |
753 { | 755 { |
754 public: | 756 public: |
755 | 757 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
949 FX_BOOL m_bIsMask; | 951 FX_BOOL m_bIsMask; |
950 | 952 |
951 FX_BOOL m_bInterpolate; | 953 FX_BOOL m_bInterpolate; |
952 | 954 |
953 CPDF_Document* m_pDocument; | 955 CPDF_Document* m_pDocument; |
954 | 956 |
955 CPDF_Dictionary* m_pOC; | 957 CPDF_Dictionary* m_pOC; |
956 CPDF_Dictionary* InitJPEG(FX_LPBYTE pData, FX_DWORD size); | 958 CPDF_Dictionary* InitJPEG(FX_LPBYTE pData, FX_DWORD size); |
957 }; | 959 }; |
958 #endif | 960 #endif |
OLD | NEW |