From 7dc4f0b56057aa4facc7ba559998d6dac5042792 Mon Sep 17 00:00:00 2001 From: Philipp Knechtges Date: Fri, 22 May 2020 11:47:54 +0200 Subject: 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. --- poppler/GfxState.cc | 19 +++++++++---------- poppler/GfxState.h | 4 +--- 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(displayProfile, transform, INTENT_RELATIVE_COLORIMETRIC, PT_XYZ, displayPixelType); + XYZ2DisplayTransform = std::make_shared(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(XYZProfile, transform, INTENT_RELATIVE_COLORIMETRIC, PT_XYZ, displayPixelType); + XYZ2DisplayTransform = std::make_shared(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(hp, transform, cmsIntent, cst, dcst); + cs->transform = std::make_shared(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(hp, transform, cmsIntent, cst, dcst); + cs->lineTransform = std::make_shared(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(XYZProfile, transform, INTENT_RELATIVE_COLORIMETRIC, PT_XYZ, localDisplayPixelType); + XYZ2DisplayTransformRelCol = std::make_shared(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(XYZProfile, transform, INTENT_ABSOLUTE_COLORIMETRIC, PT_XYZ, localDisplayPixelType); + XYZ2DisplayTransformAbsCol = std::make_shared(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(XYZProfile, transform, INTENT_SATURATION, PT_XYZ, localDisplayPixelType); + XYZ2DisplayTransformSat = std::make_shared(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(XYZProfile, transform, INTENT_PERCEPTUAL, PT_XYZ, localDisplayPixelType); + XYZ2DisplayTransformPerc = std::make_shared(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; -- cgit v1.2.3