summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page/pageint.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/fpdf_page/pageint.h')
-rw-r--r--core/fpdfapi/fpdf_page/pageint.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/core/fpdfapi/fpdf_page/pageint.h b/core/fpdfapi/fpdf_page/pageint.h
index d1364d0dd1..8d507a181d 100644
--- a/core/fpdfapi/fpdf_page/pageint.h
+++ b/core/fpdfapi/fpdf_page/pageint.h
@@ -367,13 +367,16 @@ class CPDF_DocPageData {
class CPDF_Function {
public:
enum class Type {
- kType0Sampled,
- kType2ExpotentialInterpolation,
- kType3Stitching,
- kType4PostScript,
+ kTypeInvalid = -1,
+ kType0Sampled = 0,
+ kType2ExpotentialInterpolation = 2,
+ kType3Stitching = 3,
+ kType4PostScript = 4,
};
static CPDF_Function* Load(CPDF_Object* pFuncObj);
+ static Type IntegerToFunctionType(int iType);
+
virtual ~CPDF_Function();
FX_BOOL Call(FX_FLOAT* inputs,
uint32_t ninputs,
@@ -381,12 +384,10 @@ class CPDF_Function {
int& nresults) const;
uint32_t CountInputs() const { return m_nInputs; }
uint32_t CountOutputs() const { return m_nOutputs; }
- FX_FLOAT GetDomain(int i) const { return m_pDomains[i]; }
- FX_FLOAT GetRange(int i) const { return m_pRanges[i]; }
- Type GetType() const { return m_Type; }
protected:
- CPDF_Function(Type type);
+ CPDF_Function();
+
FX_BOOL Init(CPDF_Object* pObj);
virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0;
virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0;
@@ -395,7 +396,6 @@ class CPDF_Function {
uint32_t m_nOutputs;
FX_FLOAT* m_pDomains;
FX_FLOAT* m_pRanges;
- Type m_Type;
};
class CPDF_ExpIntFunc : public CPDF_Function {
@@ -433,11 +433,12 @@ class CPDF_SampledFunc : public CPDF_Function {
FX_BOOL v_Init(CPDF_Object* pObj) override;
FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
- SampleEncodeInfo* m_pEncodeInfo;
- SampleDecodeInfo* m_pDecodeInfo;
+ private:
+ std::vector<SampleEncodeInfo> m_pEncodeInfo;
+ std::vector<SampleDecodeInfo> m_pDecodeInfo;
uint32_t m_nBitsPerSample;
uint32_t m_SampleMax;
- CPDF_StreamAcc* m_pSampleStream;
+ std::unique_ptr<CPDF_StreamAcc> m_pSampleStream;
};
class CPDF_StitchFunc : public CPDF_Function {
@@ -449,7 +450,7 @@ class CPDF_StitchFunc : public CPDF_Function {
FX_BOOL v_Init(CPDF_Object* pObj) override;
FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
- std::vector<CPDF_Function*> m_pSubFunctions;
+ std::vector<std::unique_ptr<CPDF_Function>> m_pSubFunctions;
FX_FLOAT* m_pBounds;
FX_FLOAT* m_pEncode;