1 // Copyright 2017 The PDFium Authors 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_PAGE_CPDF_PATTERNCS_H_ 8 #define CORE_FPDFAPI_PAGE_CPDF_PATTERNCS_H_ 9 10 #include <set> 11 12 #include "core/fpdfapi/page/cpdf_basedcs.h" 13 #include "core/fxcrt/retain_ptr.h" 14 15 class CPDF_Document; 16 17 class CPDF_PatternCS final : public CPDF_BasedCS { 18 public: 19 CONSTRUCT_VIA_MAKE_RETAIN; 20 ~CPDF_PatternCS() override; 21 22 // Called for the stock pattern, since it is not initialized via 23 // CPDF_ColorSpace::Load(). 24 void InitializeStockPattern(); 25 26 // CPDF_ColorSpace: 27 bool GetRGB(pdfium::span<const float> pBuf, 28 float* R, 29 float* G, 30 float* B) const override; 31 const CPDF_PatternCS* AsPatternCS() const override; 32 uint32_t v_Load(CPDF_Document* pDoc, 33 const CPDF_Array* pArray, 34 std::set<const CPDF_Object*>* pVisited) override; 35 36 bool GetPatternRGB(const PatternValue& value, 37 float* R, 38 float* G, 39 float* B) const; 40 41 private: 42 CPDF_PatternCS(); 43 }; 44 45 #endif // CORE_FPDFAPI_PAGE_CPDF_PATTERNCS_H_ 46