summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_colorspace.cpp110
-rw-r--r--core/fpdfapi/page/cpdf_colorspace.h12
-rw-r--r--core/fpdfapi/page/cpdf_devicecs.cpp59
-rw-r--r--core/fpdfapi/page/cpdf_devicecs.h11
-rw-r--r--core/fpdfapi/page/cpdf_patterncs.cpp4
-rw-r--r--core/fpdfapi/page/cpdf_patterncs.h1
6 files changed, 0 insertions, 197 deletions
diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp
index 520f9f4ded..eef6b40a44 100644
--- a/core/fpdfapi/page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/page/cpdf_colorspace.cpp
@@ -76,7 +76,6 @@ class CPDF_CalGray : public CPDF_ColorSpace {
// CPDF_ColorSpace:
bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
bool GetRGB(float* pBuf, float* R, float* G, float* B) const override;
- bool SetRGB(float* pBuf, float R, float G, float B) const override;
void TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
int pixels,
@@ -98,7 +97,6 @@ class CPDF_CalRGB : public CPDF_ColorSpace {
bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
bool GetRGB(float* pBuf, float* R, float* G, float* B) const override;
- bool SetRGB(float* pBuf, float R, float G, float B) const override;
void TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
@@ -148,11 +146,6 @@ class CPDF_ICCBasedCS : public CPDF_ColorSpace {
// CPDF_ColorSpace:
bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
bool GetRGB(float* pBuf, float* R, float* G, float* B) const override;
- bool v_GetCMYK(float* pBuf,
- float* c,
- float* m,
- float* y,
- float* k) const override;
void EnableStdConversion(bool bEnabled) override;
void TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
@@ -185,7 +178,6 @@ class CPDF_IndexedCS : public CPDF_ColorSpace {
bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
bool GetRGB(float* pBuf, float* R, float* G, float* B) const override;
- CPDF_ColorSpace* GetBaseCS() const override;
void EnableStdConversion(bool bEnabled) override;
@@ -469,54 +461,6 @@ float* CPDF_ColorSpace::CreateBuf() {
return (float*)pBuf;
}
-bool CPDF_ColorSpace::sRGB() const {
- if (m_Family == PDFCS_DEVICERGB)
- return true;
-
- if (m_Family != PDFCS_ICCBASED)
- return false;
-
- const CPDF_ICCBasedCS* pCS = static_cast<const CPDF_ICCBasedCS*>(this);
- return pCS->IsSRGB();
-}
-
-bool CPDF_ColorSpace::SetRGB(float* pBuf, float R, float G, float B) const {
- return false;
-}
-
-bool CPDF_ColorSpace::GetCMYK(float* pBuf,
- float* c,
- float* m,
- float* y,
- float* k) const {
- if (v_GetCMYK(pBuf, c, m, y, k))
- return true;
-
- float R;
- float G;
- float B;
- if (!GetRGB(pBuf, &R, &G, &B))
- return false;
-
- sRGB_to_AdobeCMYK(R, G, B, *c, *m, *y, *k);
- return true;
-}
-
-bool CPDF_ColorSpace::SetCMYK(float* pBuf,
- float c,
- float m,
- float y,
- float k) const {
- if (v_SetCMYK(pBuf, c, m, y, k))
- return true;
-
- float R;
- float G;
- float B;
- std::tie(R, G, B) = AdobeCMYK_to_sRGB(c, m, y, k);
- return SetRGB(pBuf, R, G, B);
-}
-
void CPDF_ColorSpace::GetDefaultColor(float* buf) const {
if (!buf || m_Family == PDFCS_PATTERN)
return;
@@ -562,10 +506,6 @@ void CPDF_ColorSpace::TranslateImageLine(uint8_t* dest_buf,
}
}
-CPDF_ColorSpace* CPDF_ColorSpace::GetBaseCS() const {
- return nullptr;
-}
-
void CPDF_ColorSpace::EnableStdConversion(bool bEnabled) {
if (bEnabled)
m_dwStdConversion++;
@@ -588,22 +528,6 @@ bool CPDF_ColorSpace::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
return true;
}
-bool CPDF_ColorSpace::v_GetCMYK(float* pBuf,
- float* c,
- float* m,
- float* y,
- float* k) const {
- return false;
-}
-
-bool CPDF_ColorSpace::v_SetCMYK(float* pBuf,
- float c,
- float m,
- float y,
- float k) const {
- return false;
-}
-
CPDF_CalGray::CPDF_CalGray(CPDF_Document* pDoc)
: CPDF_ColorSpace(pDoc, PDFCS_CALGRAY, 1) {}
@@ -634,14 +558,6 @@ bool CPDF_CalGray::GetRGB(float* pBuf, float* R, float* G, float* B) const {
return true;
}
-bool CPDF_CalGray::SetRGB(float* pBuf, float R, float G, float B) const {
- if (R == G && R == B) {
- *pBuf = R;
- return true;
- }
- return false;
-}
-
void CPDF_CalGray::TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
int pixels,
@@ -719,13 +635,6 @@ bool CPDF_CalRGB::GetRGB(float* pBuf, float* R, float* G, float* B) const {
return true;
}
-bool CPDF_CalRGB::SetRGB(float* pBuf, float R, float G, float B) const {
- pBuf[0] = R;
- pBuf[1] = G;
- pBuf[2] = B;
- return true;
-}
-
void CPDF_CalRGB::TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
int pixels,
@@ -930,21 +839,6 @@ bool CPDF_ICCBasedCS::GetRGB(float* pBuf, float* R, float* G, float* B) const {
return true;
}
-bool CPDF_ICCBasedCS::v_GetCMYK(float* pBuf,
- float* c,
- float* m,
- float* y,
- float* k) const {
- if (m_nComponents != 4)
- return false;
-
- *c = pBuf[0];
- *m = pBuf[1];
- *y = pBuf[2];
- *k = pBuf[3];
- return true;
-}
-
void CPDF_ICCBasedCS::EnableStdConversion(bool bEnabled) {
CPDF_ColorSpace::EnableStdConversion(bEnabled);
if (m_pAlterCS)
@@ -1124,10 +1018,6 @@ bool CPDF_IndexedCS::GetRGB(float* pBuf, float* R, float* G, float* B) const {
return m_pBaseCS->GetRGB(comps, R, G, B);
}
-CPDF_ColorSpace* CPDF_IndexedCS::GetBaseCS() const {
- return m_pBaseCS;
-}
-
void CPDF_IndexedCS::EnableStdConversion(bool bEnabled) {
CPDF_ColorSpace::EnableStdConversion(bEnabled);
if (m_pBaseCS)
diff --git a/core/fpdfapi/page/cpdf_colorspace.h b/core/fpdfapi/page/cpdf_colorspace.h
index c8c2abf0da..a518689ded 100644
--- a/core/fpdfapi/page/cpdf_colorspace.h
+++ b/core/fpdfapi/page/cpdf_colorspace.h
@@ -57,12 +57,7 @@ class CPDF_ColorSpace {
float* min,
float* max) const;
- bool sRGB() const;
virtual bool GetRGB(float* pBuf, float* R, float* G, float* B) const = 0;
- virtual bool SetRGB(float* pBuf, float R, float G, float B) const;
-
- bool GetCMYK(float* pBuf, float* c, float* m, float* y, float* k) const;
- bool SetCMYK(float* pBuf, float c, float m, float y, float k) const;
virtual void TranslateImageLine(uint8_t* dest_buf,
const uint8_t* src_buf,
@@ -70,7 +65,6 @@ class CPDF_ColorSpace {
int image_width,
int image_height,
bool bTransMask) const;
- virtual CPDF_ColorSpace* GetBaseCS() const;
virtual void EnableStdConversion(bool bEnabled);
CPDF_Array* GetArray() const { return m_pArray.Get(); }
@@ -81,12 +75,6 @@ class CPDF_ColorSpace {
virtual ~CPDF_ColorSpace();
virtual bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray);
- virtual bool v_GetCMYK(float* pBuf,
- float* c,
- float* m,
- float* y,
- float* k) const;
- virtual bool v_SetCMYK(float* pBuf, float c, float m, float y, float k) const;
CFX_UnownedPtr<CPDF_Document> const m_pDocument;
int m_Family;
diff --git a/core/fpdfapi/page/cpdf_devicecs.cpp b/core/fpdfapi/page/cpdf_devicecs.cpp
index 91dffb129c..b07e620604 100644
--- a/core/fpdfapi/page/cpdf_devicecs.cpp
+++ b/core/fpdfapi/page/cpdf_devicecs.cpp
@@ -106,65 +106,6 @@ bool CPDF_DeviceCS::GetRGB(float* pBuf, float* R, float* G, float* B) const {
}
}
-bool CPDF_DeviceCS::v_GetCMYK(float* pBuf,
- float* c,
- float* m,
- float* y,
- float* k) const {
- if (m_Family != PDFCS_DEVICECMYK)
- return false;
-
- *c = pBuf[0];
- *m = pBuf[1];
- *y = pBuf[2];
- *k = pBuf[3];
- return true;
-}
-
-bool CPDF_DeviceCS::SetRGB(float* pBuf, float R, float G, float B) const {
- switch (m_Family) {
- case PDFCS_DEVICEGRAY:
- if (R != G || R != B)
- return false;
- *pBuf = R;
- return true;
- case PDFCS_DEVICERGB:
- pBuf[0] = R;
- pBuf[1] = G;
- pBuf[2] = B;
- return true;
- case PDFCS_DEVICECMYK:
- sRGB_to_AdobeCMYK(R, G, B, pBuf[0], pBuf[1], pBuf[2], pBuf[3]);
- return true;
- default:
- NOTREACHED();
- return false;
- }
-}
-
-bool CPDF_DeviceCS::v_SetCMYK(float* pBuf,
- float c,
- float m,
- float y,
- float k) const {
- switch (m_Family) {
- case PDFCS_DEVICEGRAY:
- return false;
- case PDFCS_DEVICERGB:
- std::tie(pBuf[0], pBuf[1], pBuf[2]) = AdobeCMYK_to_sRGB(c, m, y, k);
- return true;
- case PDFCS_DEVICECMYK:
- pBuf[0] = c;
- pBuf[1] = m;
- pBuf[2] = y;
- pBuf[3] = k;
- return true;
- default:
- NOTREACHED();
- return false;
- }
-}
-
void CPDF_DeviceCS::TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
int pixels,
diff --git a/core/fpdfapi/page/cpdf_devicecs.h b/core/fpdfapi/page/cpdf_devicecs.h
index 177f240fbc..d472476b8b 100644
--- a/core/fpdfapi/page/cpdf_devicecs.h
+++ b/core/fpdfapi/page/cpdf_devicecs.h
@@ -16,17 +16,6 @@ class CPDF_DeviceCS : public CPDF_ColorSpace {
// CPDF_ColorSpace:
bool GetRGB(float* pBuf, float* R, float* G, float* B) const override;
- bool SetRGB(float* pBuf, float R, float G, float B) const override;
- bool v_GetCMYK(float* pBuf,
- float* c,
- float* m,
- float* y,
- float* k) const override;
- bool v_SetCMYK(float* pBuf,
- float c,
- float m,
- float y,
- float k) const override;
void TranslateImageLine(uint8_t* pDestBuf,
const uint8_t* pSrcBuf,
int pixels,
diff --git a/core/fpdfapi/page/cpdf_patterncs.cpp b/core/fpdfapi/page/cpdf_patterncs.cpp
index 4951f61d54..46b975ab67 100644
--- a/core/fpdfapi/page/cpdf_patterncs.cpp
+++ b/core/fpdfapi/page/cpdf_patterncs.cpp
@@ -56,7 +56,3 @@ bool CPDF_PatternCS::GetRGB(float* pBuf, float* R, float* G, float* B) const {
*B = 0.75f;
return false;
}
-
-CPDF_ColorSpace* CPDF_PatternCS::GetBaseCS() const {
- return m_pBaseCS;
-}
diff --git a/core/fpdfapi/page/cpdf_patterncs.h b/core/fpdfapi/page/cpdf_patterncs.h
index d28fff19c9..ff5ad827cc 100644
--- a/core/fpdfapi/page/cpdf_patterncs.h
+++ b/core/fpdfapi/page/cpdf_patterncs.h
@@ -19,7 +19,6 @@ class CPDF_PatternCS : public CPDF_ColorSpace {
// CPDF_ColorSpace:
bool v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) override;
bool GetRGB(float* pBuf, float* R, float* G, float* B) const override;
- CPDF_ColorSpace* GetBaseCS() const override;
private:
CPDF_ColorSpace* m_pBaseCS;