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_PAGE_PAGEINT_H_ | 7 #ifndef CORE_FPDFAPI_PAGE_PAGEINT_H_ |
8 #define CORE_FPDFAPI_PAGE_PAGEINT_H_ | 8 #define CORE_FPDFAPI_PAGE_PAGEINT_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 CPDF_Type3Char* m_pType3Char; | 300 CPDF_Type3Char* m_pType3Char; |
301 uint32_t m_nStreams; | 301 uint32_t m_nStreams; |
302 std::unique_ptr<CPDF_StreamAcc> m_pSingleStream; | 302 std::unique_ptr<CPDF_StreamAcc> m_pSingleStream; |
303 std::vector<std::unique_ptr<CPDF_StreamAcc>> m_StreamArray; | 303 std::vector<std::unique_ptr<CPDF_StreamAcc>> m_StreamArray; |
304 uint8_t* m_pData; | 304 uint8_t* m_pData; |
305 uint32_t m_Size; | 305 uint32_t m_Size; |
306 uint32_t m_CurrentOffset; | 306 uint32_t m_CurrentOffset; |
307 std::unique_ptr<CPDF_StreamContentParser> m_pParser; | 307 std::unique_ptr<CPDF_StreamContentParser> m_pParser; |
308 }; | 308 }; |
309 | 309 |
310 class CPDF_DocPageData { | |
311 public: | |
312 explicit CPDF_DocPageData(CPDF_Document* pPDFDoc); | |
313 ~CPDF_DocPageData(); | |
314 | |
315 void Clear(bool bRelease = FALSE); | |
316 CPDF_Font* GetFont(CPDF_Dictionary* pFontDict); | |
317 CPDF_Font* GetStandardFont(const CFX_ByteString& fontName, | |
318 CPDF_FontEncoding* pEncoding); | |
319 void ReleaseFont(const CPDF_Dictionary* pFontDict); | |
320 CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, | |
321 const CPDF_Dictionary* pResources); | |
322 CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj); | |
323 void ReleaseColorSpace(const CPDF_Object* pColorSpace); | |
324 CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, | |
325 bool bShading, | |
326 const CFX_Matrix& matrix); | |
327 void ReleasePattern(const CPDF_Object* pPatternObj); | |
328 CPDF_Image* GetImage(CPDF_Object* pImageStream); | |
329 void ReleaseImage(const CPDF_Object* pImageStream); | |
330 CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream); | |
331 void ReleaseIccProfile(const CPDF_IccProfile* pIccProfile); | |
332 CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream); | |
333 void ReleaseFontFileStreamAcc(const CPDF_Stream* pFontStream); | |
334 bool IsForceClear() const { return m_bForceClear; } | |
335 CPDF_CountedColorSpace* FindColorSpacePtr(CPDF_Object* pCSObj) const; | |
336 CPDF_CountedPattern* FindPatternPtr(CPDF_Object* pPatternObj) const; | |
337 | |
338 private: | |
339 using CPDF_CountedFont = CPDF_CountedObject<CPDF_Font>; | |
340 using CPDF_CountedIccProfile = CPDF_CountedObject<CPDF_IccProfile>; | |
341 using CPDF_CountedImage = CPDF_CountedObject<CPDF_Image>; | |
342 using CPDF_CountedStreamAcc = CPDF_CountedObject<CPDF_StreamAcc>; | |
343 | |
344 using CPDF_ColorSpaceMap = | |
345 std::map<const CPDF_Object*, CPDF_CountedColorSpace*>; | |
346 using CPDF_FontFileMap = std::map<const CPDF_Stream*, CPDF_CountedStreamAcc*>; | |
347 using CPDF_FontMap = std::map<const CPDF_Dictionary*, CPDF_CountedFont*>; | |
348 using CPDF_IccProfileMap = | |
349 std::map<const CPDF_Stream*, CPDF_CountedIccProfile*>; | |
350 using CPDF_ImageMap = std::map<uint32_t, CPDF_CountedImage*>; | |
351 using CPDF_PatternMap = std::map<const CPDF_Object*, CPDF_CountedPattern*>; | |
352 | |
353 CPDF_ColorSpace* GetColorSpaceImpl(CPDF_Object* pCSObj, | |
354 const CPDF_Dictionary* pResources, | |
355 std::set<CPDF_Object*>* pVisited); | |
356 | |
357 CPDF_Document* const m_pPDFDoc; | |
358 bool m_bForceClear; | |
359 std::map<CFX_ByteString, CPDF_Stream*> m_HashProfileMap; | |
360 CPDF_ColorSpaceMap m_ColorSpaceMap; | |
361 CPDF_FontFileMap m_FontFileMap; | |
362 CPDF_FontMap m_FontMap; | |
363 CPDF_IccProfileMap m_IccProfileMap; | |
364 CPDF_ImageMap m_ImageMap; | |
365 CPDF_PatternMap m_PatternMap; | |
366 }; | |
367 | |
368 class CPDF_Function { | 310 class CPDF_Function { |
369 public: | 311 public: |
370 enum class Type { | 312 enum class Type { |
371 kTypeInvalid = -1, | 313 kTypeInvalid = -1, |
372 kType0Sampled = 0, | 314 kType0Sampled = 0, |
373 kType2ExpotentialInterpolation = 2, | 315 kType2ExpotentialInterpolation = 2, |
374 kType3Stitching = 3, | 316 kType3Stitching = 3, |
375 kType4PostScript = 4, | 317 kType4PostScript = 4, |
376 }; | 318 }; |
377 | 319 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 FX_FLOAT m_Comps[MAX_PATTERN_COLORCOMPS]; | 487 FX_FLOAT m_Comps[MAX_PATTERN_COLORCOMPS]; |
546 }; | 488 }; |
547 | 489 |
548 CFX_ByteStringC PDF_FindKeyAbbreviationForTesting(const CFX_ByteStringC& abbr); | 490 CFX_ByteStringC PDF_FindKeyAbbreviationForTesting(const CFX_ByteStringC& abbr); |
549 CFX_ByteStringC PDF_FindValueAbbreviationForTesting( | 491 CFX_ByteStringC PDF_FindValueAbbreviationForTesting( |
550 const CFX_ByteStringC& abbr); | 492 const CFX_ByteStringC& abbr); |
551 | 493 |
552 void PDF_ReplaceAbbr(CPDF_Object* pObj); | 494 void PDF_ReplaceAbbr(CPDF_Object* pObj); |
553 | 495 |
554 #endif // CORE_FPDFAPI_PAGE_PAGEINT_H_ | 496 #endif // CORE_FPDFAPI_PAGE_PAGEINT_H_ |
OLD | NEW |