Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
iccRoundTrip.cpp File Reference
#include <stdio.h>
#include <math.h>
#include "IccUtil.h"
#include "IccEval.h"
#include "IccPrmg.h"
#include "IccProfLibVer.h"
+ Include dependency graph for iccRoundTrip.cpp:

Go to the source code of this file.

Classes

class  CIccMinMaxEval
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 149 of file iccRoundTrip.cpp.

150{
151 if (argc<=1) {
152 printf("Usage: iccRoundTrip profile {rendering_intent=1 {use_mpe=0}}\n");
153 printf("Built with IccProfLib version " ICCPROFLIBVER "\n");
154 printf(" where rendering_intent is (0=perceptual, 1=relative, 2=saturation, 3=absolute)\n");
155 return -1;
156 }
157
159 int nUseMPE = 0;
160
161 if (argc>2) {
162 nIntent = (icRenderingIntent)atoi(argv[2]);
163 if (argc>3) {
164 nUseMPE = atoi(argv[3]);
165 }
166 }
167
168 CIccMinMaxEval eval;
169
170 icStatusCMM stat = eval.EvaluateProfile(argv[1], 0, nIntent, icInterpLinear, (nUseMPE!=0));
171
172 if (stat!=icCmmStatOk) {
173 printf("Unable to perform round trip on '%s'\n", argv[1]);
174 return -1;
175 }
176
177 CIccPRMG prmg;
178
179 stat = prmg.EvaluateProfile(argv[1], nIntent, icInterpLinear, (nUseMPE!=0));
180
181 if (stat!=icCmmStatOk) {
182 printf("Unable to perform PRMG analysis on '%s'\n", argv[1]);
183 return -1;
184 }
185
186 CIccInfo info;
187
188 printf("Profile: '%s'\n", argv[1]);
189 printf("Rendering Intent: %s\n", info.GetRenderingIntentName(nIntent));
190 printf("Specified Gamut: %s\n", prmg.m_bPrmgImplied ? "Perceptual Reference Medium Gamut" : "Not Specified");
191
192 printf("\nRound Trip 1\n");
193 printf( "------------\n");
194 printf("Min DeltaE: %8.2" ICFLOATSFX "\n", eval.minDE1);
195 printf("Mean DeltaE: %8.2" ICFLOATSFX "\n", eval.GetMean1());
196 printf("Max DeltaE: %8.2" ICFLOATSFX "\n\n", eval.maxDE1);
197
198 printf("Max L, a, b: " ICFLOATFMT ", " ICFLOATFMT ", " ICFLOATFMT "\n", eval.maxLab1[0], eval.maxLab1[1], eval.maxLab1[2]);
199
200 printf("\nRound Trip 2\n");
201 printf( "------------\n");
202 printf("Min DeltaE: %8.2" ICFLOATSFX "\n", eval.minDE2);
203 printf("Mean DeltaE: %8.2" ICFLOATSFX "\n", eval.GetMean2());
204 printf("Max DeltaE: %8.2" ICFLOATSFX "\n\n", eval.maxDE2);
205
206 printf("Max L, a, b: " ICFLOATFMT ", " ICFLOATFMT ", " ICFLOATFMT "\n", eval.maxLab2[0], eval.maxLab2[1], eval.maxLab2[2]);
207
208 if (prmg.m_nTotal) {
209 printf("\nPRMG Interoperability - Round Trip Results\n");
210 printf( "------------------------------------------------------\n");
211
212 printf("DE <= 1.0 (%8u): %5.1f%%\n", prmg.m_nDE1, (float)prmg.m_nDE1/(float)prmg.m_nTotal*100.0);
213 printf("DE <= 2.0 (%8u): %5.1f%%\n", prmg.m_nDE2, (float)prmg.m_nDE2/(float)prmg.m_nTotal*100.0);
214 printf("DE <= 3.0 (%8u): %5.1f%%\n", prmg.m_nDE3, (float)prmg.m_nDE3/(float)prmg.m_nTotal*100.0);
215 printf("DE <= 5.0 (%8u): %5.1f%%\n", prmg.m_nDE5, (float)prmg.m_nDE5/(float)prmg.m_nTotal*100.0);
216 printf("DE <=10.0 (%8u): %5.1f%%\n", prmg.m_nDE10, (float)prmg.m_nDE10/(float)prmg.m_nTotal*100.0);
217 printf("Total (%8u)\n", prmg.m_nTotal);
218 }
219 return 0;
220}
@ icInterpLinear
Definition IccCmm.h:114
icStatusCMM
CMM return status values.
Definition IccCmm.h:90
@ icCmmStatOk
Definition IccCmm.h:92
#define ICFLOATFMT
Definition IccDefs.h:106
#define ICFLOATSFX
String formating macros need to match precision of icFloatNumber If precision is double change the "f...
Definition IccDefs.h:105
#define ICCPROFLIBVER
icStatusCMM EvaluateProfile(CIccProfile *pProfile, icUInt8Number nGran=0, icRenderingIntent nIntent=((icRenderingIntent) 0x3f3f3f3f), icXformInterp nInterp=icInterpLinear, bool buseMpeTags=true)
Definition IccEval.cpp:82
Type: Class.
Definition IccUtil.h:303
const icChar * GetRenderingIntentName(icRenderingIntent val, bool bIsV5=false)
Definition IccUtil.cpp:2091
icFloatNumber maxLab2[3]
icFloatNumber minDE2
icFloatNumber maxLab1[3]
icFloatNumber minDE1
icFloatNumber maxDE2
icFloatNumber GetMean1()
icFloatNumber GetMean2()
icFloatNumber maxDE1
icUInt32Number m_nTotal
Definition IccPrmg.h:96
icUInt32Number m_nDE2
Definition IccPrmg.h:96
icUInt32Number m_nDE1
Definition IccPrmg.h:96
icUInt32Number m_nDE3
Definition IccPrmg.h:96
icUInt32Number m_nDE5
Definition IccPrmg.h:96
bool m_bPrmgImplied
Definition IccPrmg.h:98
icUInt32Number m_nDE10
Definition IccPrmg.h:96
icStatusCMM EvaluateProfile(CIccProfile *pProfile, icRenderingIntent nIntent=((icRenderingIntent) 0x3f3f3f3f), icXformInterp nInterp=icInterpLinear, bool buseMpeTags=true)
Definition IccPrmg.cpp:203
icRenderingIntent
Rendering Intents, used in the profile header.
@ icRelativeColorimetric

References CIccEvalCompare::EvaluateProfile(), CIccPRMG::EvaluateProfile(), CIccMinMaxEval::GetMean1(), CIccMinMaxEval::GetMean2(), CIccInfo::GetRenderingIntentName(), icCmmStatOk, ICCPROFLIBVER, ICFLOATFMT, ICFLOATSFX, icInterpLinear, icRelativeColorimetric, CIccPRMG::m_bPrmgImplied, CIccPRMG::m_nDE1, CIccPRMG::m_nDE10, CIccPRMG::m_nDE2, CIccPRMG::m_nDE3, CIccPRMG::m_nDE5, CIccPRMG::m_nTotal, CIccMinMaxEval::maxDE1, CIccMinMaxEval::maxDE2, CIccMinMaxEval::maxLab1, CIccMinMaxEval::maxLab2, CIccMinMaxEval::minDE1, and CIccMinMaxEval::minDE2.

+ Here is the call graph for this function: