summaryrefslogtreecommitdiff
path: root/src/cmsio1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmsio1.c')
-rw-r--r--src/cmsio1.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/cmsio1.c b/src/cmsio1.c
index b235333..f746d81 100644
--- a/src/cmsio1.c
+++ b/src/cmsio1.c
@@ -246,6 +246,25 @@ cmsPipeline* _cmsReadInputLUT(cmsHPROFILE hProfile, int Intent)
cmsTagSignature tagFloat = Device2PCSFloat[Intent];
cmsContext ContextID = cmsGetProfileContextID(hProfile);
+ // On named color, take the appropiate tag
+ if (cmsGetDeviceClass(hProfile) == cmsSigNamedColorClass) {
+
+ cmsPipeline* Lut;
+ cmsNAMEDCOLORLIST* nc = (cmsNAMEDCOLORLIST*) cmsReadTag(hProfile, cmsSigNamedColor2Tag);
+
+ if (nc == NULL) return NULL;
+
+ Lut = cmsPipelineAlloc(ContextID, 0, 0);
+ if (Lut == NULL) {
+ cmsFreeNamedColorList(nc);
+ return NULL;
+ }
+
+ cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageAllocNamedColor(nc, TRUE));
+ cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageAllocLabV2ToV4(ContextID));
+ return Lut;
+ }
+
if (cmsIsTag(hProfile, tagFloat)) { // Float tag takes precedence
// Floating point LUT are always V4, so no adjustment is required
@@ -490,6 +509,27 @@ cmsPipeline* _cmsReadDevicelinkLUT(cmsHPROFILE hProfile, int Intent)
cmsTagSignature tagFloat = Device2PCSFloat[Intent];
cmsContext ContextID = cmsGetProfileContextID(hProfile);
+
+ // On named color, take the appropiate tag
+ if (cmsGetDeviceClass(hProfile) == cmsSigNamedColorClass) {
+
+ cmsPipeline* Lut;
+ cmsNAMEDCOLORLIST* nc = (cmsNAMEDCOLORLIST*) cmsReadTag(hProfile, cmsSigNamedColor2Tag);
+
+ if (nc == NULL) return NULL;
+
+ Lut = cmsPipelineAlloc(ContextID, 0, 0);
+ if (Lut == NULL) {
+ cmsFreeNamedColorList(nc);
+ return NULL;
+ }
+
+ cmsPipelineInsertStage(Lut, cmsAT_BEGIN, _cmsStageAllocNamedColor(nc, FALSE));
+ if (cmsGetColorSpace(hProfile) == cmsSigLabData)
+ cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageAllocLabV2ToV4(ContextID));
+ return Lut;
+ }
+
if (cmsIsTag(hProfile, tagFloat)) { // Float tag takes precedence
// Floating point LUT are always V4, no adjustment is required