summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Knechtges <philipp-dev@knechtges.com>2020-05-22 11:47:54 +0200
committerAlbert Astals Cid <aacid@kde.org>2020-06-02 20:03:29 +0000
commit7dc4f0b56057aa4facc7ba559998d6dac5042792 (patch)
tree4b03ce3d434c6da65d5f8f02884366acce5b7256
parent344f3e655cb0018421350c1a9916381d686025b6 (diff)
remove sourceProfile variable from GfxColorTransform
The sourceProfile variable was initially introduced in commit 1f698b44564b0313c019557616866eae11bf2cc9 for the Postscript CSA generation code. With the last commit this code has been moved to GfxICCBasedColorSpace anyway, so there is no use anymore for storing the profile in GfxColorTransform.
-rw-r--r--poppler/GfxState.cc19
-rw-r--r--poppler/GfxState.h4
2 files changed, 10 insertions, 13 deletions
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 2fb78c1c..51922565 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -210,8 +210,7 @@ void GfxColorTransform::doTransform(void *in, void *out, unsigned int size) {
}
// transformA should be a cmsHTRANSFORM
-GfxColorTransform::GfxColorTransform(const GfxLCMSProfilePtr& sourceProfileA, void *transformA, int cmsIntentA, unsigned int inputPixelTypeA, unsigned int transformPixelTypeA) {
- sourceProfile = sourceProfileA;
+GfxColorTransform::GfxColorTransform(void *transformA, int cmsIntentA, unsigned int inputPixelTypeA, unsigned int transformPixelTypeA) {
transform = transformA;
cmsIntent = cmsIntentA;
inputPixelType = inputPixelTypeA;
@@ -254,7 +253,7 @@ void GfxColorSpace::setDisplayProfile(const GfxLCMSProfilePtr& displayProfileA)
INTENT_RELATIVE_COLORIMETRIC,LCMS_FLAGS)) == nullptr) {
error(errSyntaxWarning, -1, "Can't create Lab transform");
} else {
- XYZ2DisplayTransform = std::make_shared<GfxColorTransform>(displayProfile, transform, INTENT_RELATIVE_COLORIMETRIC, PT_XYZ, displayPixelType);
+ XYZ2DisplayTransform = std::make_shared<GfxColorTransform>(transform, INTENT_RELATIVE_COLORIMETRIC, PT_XYZ, displayPixelType);
}
}
}
@@ -531,7 +530,7 @@ int GfxColorSpace::setupColorProfiles()
INTENT_RELATIVE_COLORIMETRIC,LCMS_FLAGS)) == nullptr) {
error(errSyntaxWarning, -1, "Can't create Lab transform");
} else {
- XYZ2DisplayTransform = std::make_shared<GfxColorTransform>(XYZProfile, transform, INTENT_RELATIVE_COLORIMETRIC, PT_XYZ, displayPixelType);
+ XYZ2DisplayTransform = std::make_shared<GfxColorTransform>(transform, INTENT_RELATIVE_COLORIMETRIC, PT_XYZ, displayPixelType);
}
}
return 0;
@@ -1864,7 +1863,7 @@ GfxColorSpace *GfxICCBasedColorSpace::parse(Array *arr, OutputDev *out, GfxState
error(errSyntaxWarning, -1, "Can't create transform");
cs->transform = nullptr;
} else {
- cs->transform = std::make_shared<GfxColorTransform>(hp, transform, cmsIntent, cst, dcst);
+ cs->transform = std::make_shared<GfxColorTransform>(transform, cmsIntent, cst, dcst);
}
if (dcst == PT_RGB || dcst == PT_CMYK) {
// create line transform only when the display is RGB type color space
@@ -1874,7 +1873,7 @@ GfxColorSpace *GfxICCBasedColorSpace::parse(Array *arr, OutputDev *out, GfxState
error(errSyntaxWarning, -1, "Can't create transform");
cs->lineTransform = nullptr;
} else {
- cs->lineTransform = std::make_shared<GfxColorTransform>(hp, transform, cmsIntent, cst, dcst);
+ cs->lineTransform = std::make_shared<GfxColorTransform>(transform, cmsIntent, cst, dcst);
}
}
}
@@ -6619,7 +6618,7 @@ void GfxState::setDisplayProfile(const GfxLCMSProfilePtr& localDisplayProfileA)
INTENT_RELATIVE_COLORIMETRIC,LCMS_FLAGS)) == nullptr) {
error(errSyntaxWarning, -1, "Can't create Lab transform");
} else {
- XYZ2DisplayTransformRelCol = std::make_shared<GfxColorTransform>(XYZProfile, transform, INTENT_RELATIVE_COLORIMETRIC, PT_XYZ, localDisplayPixelType);
+ XYZ2DisplayTransformRelCol = std::make_shared<GfxColorTransform>(transform, INTENT_RELATIVE_COLORIMETRIC, PT_XYZ, localDisplayPixelType);
}
if ((transform = cmsCreateTransform(XYZProfile.get(), TYPE_XYZ_DBL,
@@ -6629,7 +6628,7 @@ void GfxState::setDisplayProfile(const GfxLCMSProfilePtr& localDisplayProfileA)
INTENT_ABSOLUTE_COLORIMETRIC,LCMS_FLAGS)) == nullptr) {
error(errSyntaxWarning, -1, "Can't create Lab transform");
} else {
- XYZ2DisplayTransformAbsCol = std::make_shared<GfxColorTransform>(XYZProfile, transform, INTENT_ABSOLUTE_COLORIMETRIC, PT_XYZ, localDisplayPixelType);
+ XYZ2DisplayTransformAbsCol = std::make_shared<GfxColorTransform>(transform, INTENT_ABSOLUTE_COLORIMETRIC, PT_XYZ, localDisplayPixelType);
}
if ((transform = cmsCreateTransform(XYZProfile.get(), TYPE_XYZ_DBL,
@@ -6639,7 +6638,7 @@ void GfxState::setDisplayProfile(const GfxLCMSProfilePtr& localDisplayProfileA)
INTENT_SATURATION,LCMS_FLAGS)) == nullptr) {
error(errSyntaxWarning, -1, "Can't create Lab transform");
} else {
- XYZ2DisplayTransformSat = std::make_shared<GfxColorTransform>(XYZProfile, transform, INTENT_SATURATION, PT_XYZ, localDisplayPixelType);
+ XYZ2DisplayTransformSat = std::make_shared<GfxColorTransform>(transform, INTENT_SATURATION, PT_XYZ, localDisplayPixelType);
}
if ((transform = cmsCreateTransform(XYZProfile.get(), TYPE_XYZ_DBL,
@@ -6649,7 +6648,7 @@ void GfxState::setDisplayProfile(const GfxLCMSProfilePtr& localDisplayProfileA)
INTENT_PERCEPTUAL,LCMS_FLAGS)) == nullptr) {
error(errSyntaxWarning, -1, "Can't create Lab transform");
} else {
- XYZ2DisplayTransformPerc = std::make_shared<GfxColorTransform>(XYZProfile, transform, INTENT_PERCEPTUAL, PT_XYZ, localDisplayPixelType);
+ XYZ2DisplayTransformPerc = std::make_shared<GfxColorTransform>(transform, INTENT_PERCEPTUAL, PT_XYZ, localDisplayPixelType);
}
}
}
diff --git a/poppler/GfxState.h b/poppler/GfxState.h
index f79c6bc7..be5bb7df 100644
--- a/poppler/GfxState.h
+++ b/poppler/GfxState.h
@@ -204,7 +204,7 @@ class GfxColorTransform {
public:
void doTransform(void *in, void *out, unsigned int size);
// transformA should be a cmsHTRANSFORM
- GfxColorTransform(const GfxLCMSProfilePtr& sourceProfileA, void *transformA, int cmsIntent,
+ GfxColorTransform(void *transformA, int cmsIntent,
unsigned int inputPixelType, unsigned int transformPixelType);
~GfxColorTransform();
GfxColorTransform(const GfxColorTransform &) = delete;
@@ -212,10 +212,8 @@ public:
int getIntent() const { return cmsIntent; }
int getInputPixelType() const { return inputPixelType; }
int getTransformPixelType() const { return transformPixelType; }
- GfxLCMSProfilePtr getSourceProfile() { return sourceProfile; }
private:
GfxColorTransform() {}
- GfxLCMSProfilePtr sourceProfile;
void *transform;
int cmsIntent;
unsigned int inputPixelType;