1 // Copyright 2022 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 #ifndef CORE_FPDFAPI_PAGE_CPDF_INDEXEDCS_H_ 6 #define CORE_FPDFAPI_PAGE_CPDF_INDEXEDCS_H_ 7 8 #include <set> 9 10 #include "core/fpdfapi/page/cpdf_basedcs.h" 11 #include "core/fxcrt/bytestring.h" 12 #include "core/fxcrt/data_vector.h" 13 #include "core/fxcrt/retain_ptr.h" 14 15 class CPDF_Document; 16 17 class CPDF_IndexedCS final : public CPDF_BasedCS { 18 public: 19 CONSTRUCT_VIA_MAKE_RETAIN; 20 ~CPDF_IndexedCS() override; 21 22 // CPDF_ColorSpace: 23 bool GetRGB(pdfium::span<const float> pBuf, 24 float* R, 25 float* G, 26 float* B) const override; 27 const CPDF_IndexedCS* AsIndexedCS() const override; 28 uint32_t v_Load(CPDF_Document* pDoc, 29 const CPDF_Array* pArray, 30 std::set<const CPDF_Object*>* pVisited) override; 31 GetMaxIndex()32 int GetMaxIndex() const { return m_MaxIndex; } 33 34 private: 35 CPDF_IndexedCS(); 36 37 uint32_t m_nBaseComponents = 0; 38 int m_MaxIndex = 0; 39 ByteString m_Table; 40 DataVector<float> m_pCompMinMax; 41 }; 42 43 #endif // CORE_FPDFAPI_PAGE_CPDF_INDEXEDCS_H_ 44