| 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 CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |
| 8 #define CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 8 #define CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <unordered_map> | 12 #include <unordered_map> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "core/fpdfapi/fpdf_page/cpdf_contentmark.h" | 15 #include "core/fpdfapi/fpdf_page/cpdf_contentmark.h" |
| 16 #include "core/fpdfapi/fpdf_page/cpdf_countedobject.h" |
| 16 #include "core/fpdfapi/fpdf_page/cpdf_parseoptions.h" | 17 #include "core/fpdfapi/fpdf_page/cpdf_parseoptions.h" |
| 17 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" | 18 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" |
| 18 #include "core/include/fpdfapi/fpdf_resource.h" | |
| 19 #include "core/include/fxge/fx_ge.h" | 19 #include "core/include/fxge/fx_ge.h" |
| 20 | 20 |
| 21 class CPDF_AllStates; | 21 class CPDF_AllStates; |
| 22 class CPDF_ColorSpace; | 22 class CPDF_ColorSpace; |
| 23 class CPDF_Font; | 23 class CPDF_Font; |
| 24 class CPDF_FontEncoding; | 24 class CPDF_FontEncoding; |
| 25 class CPDF_Form; | 25 class CPDF_Form; |
| 26 class CPDF_IccProfile; | 26 class CPDF_IccProfile; |
| 27 class CPDF_Image; | 27 class CPDF_Image; |
| 28 class CPDF_ImageObject; | 28 class CPDF_ImageObject; |
| 29 class CPDF_Page; |
| 29 class CPDF_ParseOptions; | 30 class CPDF_ParseOptions; |
| 30 class CPDF_Pattern; | 31 class CPDF_Pattern; |
| 31 class CPDF_StreamAcc; | 32 class CPDF_StreamAcc; |
| 32 class CPDF_TextObject; | 33 class CPDF_TextObject; |
| 33 class CPDF_Type3Char; | 34 class CPDF_Type3Char; |
| 34 | 35 |
| 35 #define PARSE_STEP_LIMIT 100 | 36 #define PARSE_STEP_LIMIT 100 |
| 36 | 37 |
| 37 class CPDF_StreamParser { | 38 class CPDF_StreamParser { |
| 38 public: | 39 public: |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 void TranslateImageLine(uint8_t* pDestBuf, | 432 void TranslateImageLine(uint8_t* pDestBuf, |
| 432 const uint8_t* pSrcBuf, | 433 const uint8_t* pSrcBuf, |
| 433 int pixels, | 434 int pixels, |
| 434 int image_width, | 435 int image_width, |
| 435 int image_height, | 436 int image_height, |
| 436 FX_BOOL bTransMask = FALSE) const override; | 437 FX_BOOL bTransMask = FALSE) const override; |
| 437 }; | 438 }; |
| 438 | 439 |
| 439 class CPDF_PatternCS : public CPDF_ColorSpace { | 440 class CPDF_PatternCS : public CPDF_ColorSpace { |
| 440 public: | 441 public: |
| 441 explicit CPDF_PatternCS(CPDF_Document* pDoc) | 442 explicit CPDF_PatternCS(CPDF_Document* pDoc); |
| 442 : CPDF_ColorSpace(pDoc, PDFCS_PATTERN, 1), | |
| 443 m_pBaseCS(nullptr), | |
| 444 m_pCountedBaseCS(nullptr) {} | |
| 445 ~CPDF_PatternCS() override; | 443 ~CPDF_PatternCS() override; |
| 446 FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override; | 444 FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override; |
| 447 FX_BOOL GetRGB(FX_FLOAT* pBuf, | 445 FX_BOOL GetRGB(FX_FLOAT* pBuf, |
| 448 FX_FLOAT& R, | 446 FX_FLOAT& R, |
| 449 FX_FLOAT& G, | 447 FX_FLOAT& G, |
| 450 FX_FLOAT& B) const override; | 448 FX_FLOAT& B) const override; |
| 451 CPDF_ColorSpace* GetBaseCS() const override; | 449 CPDF_ColorSpace* GetBaseCS() const override; |
| 452 | 450 |
| 453 private: | 451 private: |
| 454 CPDF_ColorSpace* m_pBaseCS; | 452 CPDF_ColorSpace* m_pBaseCS; |
| 455 CPDF_CountedColorSpace* m_pCountedBaseCS; | 453 CPDF_CountedColorSpace* m_pCountedBaseCS; |
| 456 }; | 454 }; |
| 457 | 455 |
| 456 #define MAX_PATTERN_COLORCOMPS 16 |
| 457 struct PatternValue { |
| 458 CPDF_Pattern* m_pPattern; |
| 459 CPDF_CountedPattern* m_pCountedPattern; |
| 460 int m_nComps; |
| 461 FX_FLOAT m_Comps[MAX_PATTERN_COLORCOMPS]; |
| 462 }; |
| 463 |
| 458 void PDF_ReplaceAbbr(CPDF_Object* pObj); | 464 void PDF_ReplaceAbbr(CPDF_Object* pObj); |
| 459 bool IsPathOperator(const uint8_t* buf, size_t len); | 465 bool IsPathOperator(const uint8_t* buf, size_t len); |
| 460 | 466 |
| 461 #endif // CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ | 467 #endif // CORE_FPDFAPI_FPDF_PAGE_PAGEINT_H_ |
| OLD | NEW |