1 // Copyright 2017 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 #ifndef CORE_FPDFAPI_PAGE_CPDF_DEVICECS_H_
8 #define CORE_FPDFAPI_PAGE_CPDF_DEVICECS_H_
9 
10 #include <set>
11 
12 #include "core/fpdfapi/page/cpdf_colorspace.h"
13 #include "core/fxcrt/retain_ptr.h"
14 
15 class CPDF_DeviceCS final : public CPDF_ColorSpace {
16  public:
17   template <typename T, typename... Args>
18   friend RetainPtr<T> pdfium::MakeRetain(Args&&... args);
19 
20   ~CPDF_DeviceCS() override;
21 
22   // CPDF_ColorSpace:
23   bool GetRGB(const float* pBuf, float* R, float* G, float* B) const override;
24   void TranslateImageLine(uint8_t* pDestBuf,
25                           const uint8_t* pSrcBuf,
26                           int pixels,
27                           int image_width,
28                           int image_height,
29                           bool bTransMask) const override;
30   uint32_t v_Load(CPDF_Document* pDoc,
31                   const CPDF_Array* pArray,
32                   std::set<const CPDF_Object*>* pVisited) override;
33 
34  private:
35   explicit CPDF_DeviceCS(int family);
36 };
37 
38 #endif  // CORE_FPDFAPI_PAGE_CPDF_DEVICECS_H_
39