summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Knechtges <philipp-dev@knechtges.com>2020-05-16 14:06:56 +0200
committerAlbert Astals Cid <tsdgeos@yahoo.es>2020-05-21 09:00:29 +0000
commitd5efac76267c7adf7636514280614efcc1ac3392 (patch)
treec16a312e5a70f3fd648303657262a21efcf39a85
parent846437d9a9e4dcca2d4e8dad6d395b47477c1707 (diff)
Revert "GfxICCBasedColorSpace: Remove unused member variable"
-rw-r--r--poppler/GfxState.cc8
-rw-r--r--poppler/GfxState.h6
2 files changed, 9 insertions, 5 deletions
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 47ae1e5c..7141c9f8 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -1724,9 +1724,11 @@ void GfxLabColorSpace::getDefaultRanges(double *decodeLow, double *decodeRange,
// GfxICCBasedColorSpace
//------------------------------------------------------------------------
-GfxICCBasedColorSpace::GfxICCBasedColorSpace(int nCompsA, GfxColorSpace *altA) {
+GfxICCBasedColorSpace::GfxICCBasedColorSpace(int nCompsA, GfxColorSpace *altA,
+ const Ref *iccProfileStreamA) {
nComps = nCompsA;
alt = altA;
+ iccProfileStream = *iccProfileStreamA;
rangeMin[0] = rangeMin[1] = rangeMin[2] = rangeMin[3] = 0;
rangeMax[0] = rangeMax[1] = rangeMax[2] = rangeMax[3] = 1;
#ifdef USE_CMS
@@ -1751,7 +1753,7 @@ GfxColorSpace *GfxICCBasedColorSpace::copy() const {
GfxICCBasedColorSpace *cs;
int i;
- cs = new GfxICCBasedColorSpace(nComps, alt->copy());
+ cs = new GfxICCBasedColorSpace(nComps, alt->copy(), &iccProfileStream);
for (i = 0; i < 4; ++i) {
cs->rangeMin[i] = rangeMin[i];
cs->rangeMax[i] = rangeMax[i];
@@ -1846,7 +1848,7 @@ GfxColorSpace *GfxICCBasedColorSpace::parse(Array *arr, OutputDev *out, GfxState
delete altA;
return nullptr;
}
- cs = new GfxICCBasedColorSpace(nCompsA, altA);
+ cs = new GfxICCBasedColorSpace(nCompsA, altA, &iccProfileStreamA);
obj2 = dict->lookup("Range");
if (obj2.isArray() && obj2.arrayGetLength() == 2 * nCompsA) {
for (i = 0; i < nCompsA; ++i) {
diff --git a/poppler/GfxState.h b/poppler/GfxState.h
index 15c4c70f..6d445ecf 100644
--- a/poppler/GfxState.h
+++ b/poppler/GfxState.h
@@ -538,8 +538,9 @@ private:
class GfxICCBasedColorSpace: public GfxColorSpace {
public:
- GfxICCBasedColorSpace(int nCompsA, GfxColorSpace *altA);
- ~GfxICCBasedColorSpace() override;
+ GfxICCBasedColorSpace(int nCompsA, GfxColorSpace *altA,
+ const Ref *iccProfileStreamA);
+ ~GfxICCBasedColorSpace();
GfxColorSpace *copy() const override;
GfxColorSpaceMode getMode() const override { return csICCBased; }
@@ -575,6 +576,7 @@ private:
GfxColorSpace *alt; // alternate color space
double rangeMin[4]; // min values for each component
double rangeMax[4]; // max values for each component
+ Ref iccProfileStream; // the ICC profile
#ifdef USE_CMS
int getIntent() { return (transform != nullptr) ? transform->getIntent() : 0; }
GfxColorTransform *transform;