blob: 40f83ea9a9fa2dad2c763a2cfce8e82ed3c9d54b [file] [log] [blame]
npmca5300a2016-11-21 07:28:42 -08001// 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_TRANSFERFUNC_H_
8#define CORE_FPDFAPI_RENDER_CPDF_TRANSFERFUNC_H_
9
Dan Sinclair0b950422017-09-21 15:49:49 -040010#include "core/fxcrt/retain_ptr.h"
Dan Sinclairaee0db02017-09-21 16:53:58 -040011#include "core/fxcrt/unowned_ptr.h"
npmca5300a2016-11-21 07:28:42 -080012#include "core/fxge/fx_dib.h"
13
14class CPDF_Document;
Nicolas Pena37cc5fb2017-04-04 12:12:49 -040015class CFX_DIBSource;
npmca5300a2016-11-21 07:28:42 -080016
Dan Sinclair0b950422017-09-21 15:49:49 -040017class CPDF_TransferFunc : public Retainable {
npmca5300a2016-11-21 07:28:42 -080018 public:
Tom Sepez3a1d9b42017-04-03 14:05:17 -070019 template <typename T, typename... Args>
Dan Sinclair0b950422017-09-21 15:49:49 -040020 friend RetainPtr<T> pdfium::MakeRetain(Args&&... args);
npmca5300a2016-11-21 07:28:42 -080021
22 FX_COLORREF TranslateColor(FX_COLORREF src) const;
Dan Sinclair0b950422017-09-21 15:49:49 -040023 RetainPtr<CFX_DIBSource> TranslateImage(const RetainPtr<CFX_DIBSource>& pSrc);
npmca5300a2016-11-21 07:28:42 -080024
Dan Sinclairaee0db02017-09-21 16:53:58 -040025 UnownedPtr<CPDF_Document> const m_pPDFDoc;
npmca5300a2016-11-21 07:28:42 -080026 bool m_bIdentity;
27 uint8_t m_Samples[256 * 3];
Tom Sepez3a1d9b42017-04-03 14:05:17 -070028
29 private:
30 explicit CPDF_TransferFunc(CPDF_Document* pDoc);
31 ~CPDF_TransferFunc() override;
npmca5300a2016-11-21 07:28:42 -080032};
33
34#endif // CORE_FPDFAPI_RENDER_CPDF_TRANSFERFUNC_H_