7#include "core/fpdfapi/page/cpdf_transferfunc.h"
13#include "core/fpdfapi/page/cpdf_transferfuncdib.h"
14#include "core/fpdfapi/parser/cpdf_document.h"
15#include "core/fxcrt/fixed_size_data_vector.h"
16#include "core/fxge/dib/cfx_dibbase.h"
17#include "third_party/base/check_op.h"
19CPDF_TransferFunc::CPDF_TransferFunc(
bool bIdentify,
23 : m_bIdentity(bIdentify),
24 m_SamplesR(std::move(samples_r)),
25 m_SamplesG(std::move(samples_g)),
26 m_SamplesB(std::move(samples_b)) {
27 DCHECK_EQ(m_SamplesR.size(), kChannelSampleSize);
28 DCHECK_EQ(m_SamplesG.size(), kChannelSampleSize);
29 DCHECK_EQ(m_SamplesB.size(), kChannelSampleSize);
35 return FXSYS_BGR(m_SamplesB.span()[FXSYS_GetBValue(colorref)],
36 m_SamplesG.span()[FXSYS_GetGValue(colorref)],
37 m_SamplesR.span()[FXSYS_GetRValue(colorref)]);
42 return pdfium::MakeRetain<CPDF_TransferFuncDIB>(
std::move(pSrc),
43 pdfium::WrapRetain(
this));
46pdfium::span<
const uint8_t> CPDF_TransferFunc::
GetSamplesR()
const {
50pdfium::span<
const uint8_t> CPDF_TransferFunc::
GetSamplesG()
const {
54pdfium::span<
const uint8_t> CPDF_TransferFunc::
GetSamplesB()
const {
~CPDF_TransferFunc() override
pdfium::span< const uint8_t > GetSamplesR() const
RetainPtr< CFX_DIBBase > TranslateImage(RetainPtr< CFX_DIBBase > pSrc)
pdfium::span< const uint8_t > GetSamplesB() const
FX_COLORREF TranslateColor(FX_COLORREF colorref) const
pdfium::span< const uint8_t > GetSamplesG() const