• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef CORE_FPDFAPI_RENDER_CPDF_DIBTRANSFERFUNC_H_
8 #define CORE_FPDFAPI_RENDER_CPDF_DIBTRANSFERFUNC_H_
9 
10 #include <vector>
11 
12 #include "core/fxcrt/unowned_ptr.h"
13 #include "core/fxge/dib/cfx_filtereddib.h"
14 #include "core/fxge/fx_dib.h"
15 
16 class CPDF_TransferFunc;
17 
18 class CPDF_DIBTransferFunc : public CFX_FilteredDIB {
19  public:
20   template <typename T, typename... Args>
21   friend RetainPtr<T> pdfium::MakeRetain(Args&&... args);
22 
23   ~CPDF_DIBTransferFunc() override;
24 
25   // CFX_FilteredDIB
26   FXDIB_Format GetDestFormat() override;
27   FX_ARGB* GetDestPalette() override;
28   void TranslateScanline(const uint8_t* src_buf,
29                          std::vector<uint8_t>* dest_buf) const override;
30   void TranslateDownSamples(uint8_t* dest_buf,
31                             const uint8_t* src_buf,
32                             int pixels,
33                             int Bpp) const override;
34 
35  private:
36   explicit CPDF_DIBTransferFunc(
37       const RetainPtr<CPDF_TransferFunc>& pTransferFunc);
38 
39   RetainPtr<CPDF_TransferFunc> m_pTransferFunc;
40   const uint8_t* m_RampR;
41   const uint8_t* m_RampG;
42   const uint8_t* m_RampB;
43 };
44 
45 #endif  // CORE_FPDFAPI_RENDER_CPDF_DIBTRANSFERFUNC_H_
46