Hello, I just want to let you know that I have fixed my problem, and thanks to Marti the solution was in one of his src code files. Anyway the following code will read the contents of the input or output table and extract the data to text file:
static void EvaluateCurves(const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage *mpe) { _cmsStageToneCurvesData* Data = (_cmsStageToneCurvesData*) mpe ->Data; cmsUInt32Number i; if (Data ->TheCurves == NULL) return; for (i=0; i < Data ->nCurves; i++) { Out[i] = cmsEvalToneCurveFloat(Data ->TheCurves[i], In[i]); } } //------------------------------------------------------------------- int main (void) { char out_f[]="C:\\TXTfile.txt"; FILE *fileout; cmsFloat32Number In[4], Out[4]; fileout = fopen(out_f, "w+"); cmsHPROFILE hProfile = cmsOpenProfileFromFile("C:\\ICCPofile.icc", "r"); cmsPipeline* A2B0 = (cmsPipeline*)cmsReadTag(hProfile, cmsSigAToB0Tag); cmsPipeline* prelin = cmsPipelineDup(A2B0); cmsPipelineUnlinkStage(prelin, cmsAT_END, NULL); // remove postlin cmsPipelineUnlinkStage(prelin, cmsAT_END, NULL); // remove lut cmsStage* prelinStage = cmsPipelineGetPtrToFirstStage(prelin); for (int i=0; i < 256; i++) { In[0] = In[1] = In[2] =In [3]= i/255.0; EvaluateCurves(In,Out,postlinStage); fprintf(fileout,"%f %f %f %f\n", Out[0], Out[1], Out[2], Out[3]); } cmsCloseProfile(hProfile); fclose(fileout); return 0; } -----Original Message----- From: Reem EL asaleh Sent: Sunday, October 31, 2010 10:42 PM To: lcms-user@lists.sourceforge.net Subject: [Lcms-user] reading and writing AToBx tags Hello there, Based on my reading on the Pipeline structure, I understand that you can check the number of stages by using cmsPipelineStageCount, and thus you can have an idea of what combinations are stored in A2B tag. And by using cmsStageType you can know what are the stages types (i.e Matrix, curve or CLUT). I want to focuse on the simple A2B combination that contains only a matrix, clut and 1D curve. And thus, I want to dump the contents of each in a txt file. I tried to use the cmsPipelineCheckAndRetreiveStages (A2B0,1, cmsSigCurveSetElemType, &cv ) but I retrieve a null pointer. Its really important to me to do this stage and I want to use lcms2 because I found a lot of other functions that are very useful to me. I would really appreciate it if someone could help me with this Reem ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user