< prev index next >

src/java.desktop/share/native/liblcms/cmsio1.c

Print this page

 590 
 591     // the output can be Lab or XYZ, in which case normalisation is needed on the end of the pipeline
 592     if ( dataSpace == cmsSigLabData)
 593     {
 594         if (!cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromLabFloat(ContextID)))
 595             goto Error;
 596     }
 597     else if (dataSpace == cmsSigXYZData)
 598     {
 599         if (!cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromXyzFloat(ContextID)))
 600             goto Error;
 601     }
 602 
 603     return Lut;
 604 
 605 Error:
 606     cmsPipelineFree(Lut);
 607     return NULL;
 608 }
 609 
 610 // Create an output MPE LUT from agiven profile. Version mismatches are handled here
 611 cmsPipeline* CMSEXPORT _cmsReadOutputLUT(cmsHPROFILE hProfile, cmsUInt32Number Intent)
 612 {
 613     cmsTagTypeSignature OriginalType;
 614     cmsTagSignature tag16;
 615     cmsTagSignature tagFloat;
 616     cmsContext ContextID  = cmsGetProfileContextID(hProfile);
 617 
 618 
 619     if (Intent <= INTENT_ABSOLUTE_COLORIMETRIC) {
 620 
 621         tag16 = PCS2Device16[Intent];
 622         tagFloat = PCS2DeviceFloat[Intent];
 623 
 624         if (cmsIsTag(hProfile, tagFloat)) {  // Float tag takes precedence
 625 
 626             // Floating point LUT are always V4
 627             return _cmsReadFloatOutputTag(hProfile, tagFloat);
 628         }
 629 
 630         // Revert to perceptual if no tag is found

1039 cmsUInt32Number CMSEXPORT cmsGetProfileInfo(cmsHPROFILE hProfile, cmsInfoType Info,
1040                                             const char LanguageCode[3], const char CountryCode[3],
1041                                             wchar_t* Buffer, cmsUInt32Number BufferSize)
1042 {
1043     const cmsMLU* mlu = GetInfo(hProfile, Info);
1044     if (mlu == NULL) return 0;
1045 
1046     return cmsMLUgetWide(mlu, LanguageCode, CountryCode, Buffer, BufferSize);
1047 }
1048 
1049 
1050 cmsUInt32Number  CMSEXPORT cmsGetProfileInfoASCII(cmsHPROFILE hProfile, cmsInfoType Info,
1051                                                           const char LanguageCode[3], const char CountryCode[3],
1052                                                           char* Buffer, cmsUInt32Number BufferSize)
1053 {
1054     const cmsMLU* mlu = GetInfo(hProfile, Info);
1055     if (mlu == NULL) return 0;
1056 
1057     return cmsMLUgetASCII(mlu, LanguageCode, CountryCode, Buffer, BufferSize);
1058 }











 590 
 591     // the output can be Lab or XYZ, in which case normalisation is needed on the end of the pipeline
 592     if ( dataSpace == cmsSigLabData)
 593     {
 594         if (!cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromLabFloat(ContextID)))
 595             goto Error;
 596     }
 597     else if (dataSpace == cmsSigXYZData)
 598     {
 599         if (!cmsPipelineInsertStage(Lut, cmsAT_END, _cmsStageNormalizeFromXyzFloat(ContextID)))
 600             goto Error;
 601     }
 602 
 603     return Lut;
 604 
 605 Error:
 606     cmsPipelineFree(Lut);
 607     return NULL;
 608 }
 609 
 610 // Create an output MPE LUT from a given profile. Version mismatches are handled here
 611 cmsPipeline* CMSEXPORT _cmsReadOutputLUT(cmsHPROFILE hProfile, cmsUInt32Number Intent)
 612 {
 613     cmsTagTypeSignature OriginalType;
 614     cmsTagSignature tag16;
 615     cmsTagSignature tagFloat;
 616     cmsContext ContextID  = cmsGetProfileContextID(hProfile);
 617 
 618 
 619     if (Intent <= INTENT_ABSOLUTE_COLORIMETRIC) {
 620 
 621         tag16 = PCS2Device16[Intent];
 622         tagFloat = PCS2DeviceFloat[Intent];
 623 
 624         if (cmsIsTag(hProfile, tagFloat)) {  // Float tag takes precedence
 625 
 626             // Floating point LUT are always V4
 627             return _cmsReadFloatOutputTag(hProfile, tagFloat);
 628         }
 629 
 630         // Revert to perceptual if no tag is found

1039 cmsUInt32Number CMSEXPORT cmsGetProfileInfo(cmsHPROFILE hProfile, cmsInfoType Info,
1040                                             const char LanguageCode[3], const char CountryCode[3],
1041                                             wchar_t* Buffer, cmsUInt32Number BufferSize)
1042 {
1043     const cmsMLU* mlu = GetInfo(hProfile, Info);
1044     if (mlu == NULL) return 0;
1045 
1046     return cmsMLUgetWide(mlu, LanguageCode, CountryCode, Buffer, BufferSize);
1047 }
1048 
1049 
1050 cmsUInt32Number  CMSEXPORT cmsGetProfileInfoASCII(cmsHPROFILE hProfile, cmsInfoType Info,
1051                                                           const char LanguageCode[3], const char CountryCode[3],
1052                                                           char* Buffer, cmsUInt32Number BufferSize)
1053 {
1054     const cmsMLU* mlu = GetInfo(hProfile, Info);
1055     if (mlu == NULL) return 0;
1056 
1057     return cmsMLUgetASCII(mlu, LanguageCode, CountryCode, Buffer, BufferSize);
1058 }
1059 
1060 cmsUInt32Number  CMSEXPORT cmsGetProfileInfoUTF8(cmsHPROFILE hProfile, cmsInfoType Info,
1061                                                           const char LanguageCode[3], const char CountryCode[3],
1062                                                           char* Buffer, cmsUInt32Number BufferSize)
1063 {
1064     const cmsMLU* mlu = GetInfo(hProfile, Info);
1065     if (mlu == NULL) return 0;
1066 
1067     return cmsMLUgetUTF8(mlu, LanguageCode, CountryCode, Buffer, BufferSize);
1068 }
< prev index next >