Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_transferfunc.h
Go to the documentation of this file.
1// Copyright 2016 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// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FPDFAPI_PAGE_CPDF_TRANSFERFUNC_H_
8#define CORE_FPDFAPI_PAGE_CPDF_TRANSFERFUNC_H_
9
10#include <stdint.h>
11
12#include "core/fxcrt/fixed_size_data_vector.h"
13#include "core/fxcrt/observed_ptr.h"
14#include "core/fxcrt/retain_ptr.h"
15#include "core/fxge/dib/fx_dib.h"
16#include "third_party/base/containers/span.h"
17
18class CFX_DIBBase;
19
20class CPDF_TransferFunc final : public Retainable, public Observable {
21 public:
23
24 static constexpr size_t kChannelSampleSize = 256;
25
26 FX_COLORREF TranslateColor(FX_COLORREF colorref) const;
28
29 // Spans are |kChannelSampleSize| in size.
30 pdfium::span<const uint8_t> GetSamplesR() const;
31 pdfium::span<const uint8_t> GetSamplesG() const;
32 pdfium::span<const uint8_t> GetSamplesB() const;
33
34 bool GetIdentity() const { return m_bIdentity; }
35
36 private:
37 CPDF_TransferFunc(bool bIdentify,
38 FixedSizeDataVector<uint8_t> samples_r,
39 FixedSizeDataVector<uint8_t> samples_g,
40 FixedSizeDataVector<uint8_t> samples_b);
41 ~CPDF_TransferFunc() override;
42
43 const bool m_bIdentity;
44 const FixedSizeDataVector<uint8_t> m_SamplesR;
45 const FixedSizeDataVector<uint8_t> m_SamplesG;
46 const FixedSizeDataVector<uint8_t> m_SamplesB;
47};
48
49#endif // CORE_FPDFAPI_PAGE_CPDF_TRANSFERFUNC_H_
CFX_Matrix(const CFX_Matrix &other)=default
void AppendGraphicsResourceName(ByteString name)
void SetRenderIntent(const ByteString &ri)
void SetHT(RetainPtr< const CPDF_Object > pObject)
void SetBlendType(BlendMode type)
void SetUCR(RetainPtr< const CPDF_Object > pObject)
float GetStrokeAlpha() const
CPDF_GeneralState(const CPDF_GeneralState &that)
void SetTransferFunc(RetainPtr< CPDF_TransferFunc > pFunc)
RetainPtr< CPDF_TransferFunc > GetTransferFunc() const
void SetFillAlpha(float alpha)
void SetStrokeAlpha(float alpha)
void SetSmoothness(float smoothness)
void SetTR(RetainPtr< const CPDF_Object > pObject)
BlendMode GetBlendType() const
void SetStrokeAdjust(bool adjust)
RetainPtr< const CPDF_Object > GetTR() const
void SetBlendMode(const ByteString &mode)
pdfium::span< const ByteString > GetGraphicsResourceNames() const
void SetSMaskMatrix(const CFX_Matrix &matrix)
void SetGraphicsResourceNames(std::vector< ByteString > names)
const CFX_Matrix * GetSMaskMatrix() const
void SetSoftMask(RetainPtr< CPDF_Dictionary > pDict)
void SetBG(RetainPtr< const CPDF_Object > pObject)
ByteString GetBlendMode() const
CFX_Matrix * GetMutableMatrix()
void SetAlphaSource(bool source)
void SetTextKnockout(bool knockout)
RetainPtr< CPDF_Dictionary > GetMutableSoftMask()
RetainPtr< const CPDF_Dictionary > GetSoftMask() const
void SetFlatness(float flatness)
void SetMatrix(const CFX_Matrix &matrix)
~CPDF_TransferFunc() override
pdfium::span< const uint8_t > GetSamplesR() const
static constexpr size_t kChannelSampleSize
bool GetIdentity() 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
uint32_t GetID() const
Definition bytestring.h:213
ByteString(const char *ptr)
BlendMode
Definition fx_dib.h:49
constexpr uint32_t FXBSTR_ID(uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4)
Definition fx_string.h:19
const char kColorDodge[]
const char kHardLight[]
const char kDifference[]
const char kExclusion[]
const char kSaturation[]
const char kLuminosity[]
const char kSoftLight[]
const char kColorBurn[]
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition retain_ptr.h:224