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 #include "core/fpdfapi/page/cpdf_pagemodule.h" 8 CPDF_PageModule()9CPDF_PageModule::CPDF_PageModule() 10 : m_StockGrayCS(PDFCS_DEVICEGRAY), 11 m_StockRGBCS(PDFCS_DEVICERGB), 12 m_StockCMYKCS(PDFCS_DEVICECMYK), 13 m_StockPatternCS(nullptr) { 14 m_StockPatternCS.InitializeStockPattern(); 15 } 16 ~CPDF_PageModule()17CPDF_PageModule::~CPDF_PageModule() {} 18 GetFontGlobals()19CPDF_FontGlobals* CPDF_PageModule::GetFontGlobals() { 20 return &m_FontGlobals; 21 } 22 GetStockCS(int family)23CPDF_ColorSpace* CPDF_PageModule::GetStockCS(int family) { 24 if (family == PDFCS_DEVICEGRAY) 25 return &m_StockGrayCS; 26 if (family == PDFCS_DEVICERGB) 27 return &m_StockRGBCS; 28 if (family == PDFCS_DEVICECMYK) 29 return &m_StockCMYKCS; 30 if (family == PDFCS_PATTERN) 31 return &m_StockPatternCS; 32 return nullptr; 33 } 34 ClearStockFont(CPDF_Document * pDoc)35void CPDF_PageModule::ClearStockFont(CPDF_Document* pDoc) { 36 m_FontGlobals.Clear(pDoc); 37 } 38