Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
CIccCfgDataApply Class Reference

#include <IccCmmConfig.h>

+ Collaboration diagram for CIccCfgDataApply:

Public Member Functions

 CIccCfgDataApply ()
 
int fromArgs (const char **args, int nArg, bool bReset=false)
 
bool fromJson (json obj, bool bReset=false)
 
void reset ()
 
void toJson (json &obj) const
 
virtual ~CIccCfgDataApply ()
 

Public Attributes

bool m_debugCalc
 
icUInt8Number m_dstDigits
 
icFloatColorEncoding m_dstEncoding
 
std::string m_dstFile
 
icUInt8Number m_dstPrecision
 
icCfgDataType m_dstType
 
std::string m_srcFile
 
icColorSpaceSignature m_srcSpace
 
icCfgDataType m_srcType
 

Detailed Description

Definition at line 14 of file IccCmmConfig.h.

Constructor & Destructor Documentation

◆ CIccCfgDataApply()

CIccCfgDataApply::CIccCfgDataApply ( )

Definition at line 175 of file IccCmmConfig.cpp.

176{
177 reset();
178}

References reset().

+ Here is the call graph for this function:

◆ ~CIccCfgDataApply()

virtual CIccCfgDataApply::~CIccCfgDataApply ( )
inlinevirtual

Definition at line 18 of file IccCmmConfig.h.

18{}

Member Function Documentation

◆ fromArgs()

int CIccCfgDataApply::fromArgs ( const char ** args,
int nArg,
bool bReset = false )

Definition at line 224 of file IccCmmConfig.cpp.

225{
226 if (nArg < 2) {
227 return 0;
228 }
229
230 if (bReset)
231 reset();
232
234 m_srcFile = args[0];
235
237 m_dstFile.clear();
238
239 //Setup destination encoding
240 m_dstEncoding = (icFloatColorEncoding)atoi(args[1]);
241
242 const char *colon = strchr(args[1], ':');
243 if (colon) {
244 colon++;
245 m_dstPrecision = (icUInt8Number)atoi(colon);
247 colon = strchr(colon, ':');
248 if (colon) {
249 m_dstDigits = atoi(colon);
250 }
251 }
252
253 return 2;
254}
@ icCfgLegacy
icCfgDataType m_srcType
icUInt8Number m_dstPrecision
icCfgDataType m_dstType
icUInt8Number m_dstDigits
std::string m_dstFile
icFloatColorEncoding m_dstEncoding
std::string m_srcFile
unsigned char icUInt8Number
Number definitions.

References icCfgLegacy, m_dstDigits, m_dstEncoding, m_dstFile, m_dstPrecision, m_dstType, m_srcFile, m_srcType, and reset().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJson()

bool CIccCfgDataApply::fromJson ( json obj,
bool bReset = false )

Definition at line 256 of file IccCmmConfig.cpp.

257{
258 if (!j.is_object())
259 return false;
260
261 if (bReset)
262 reset();
263
264 jsonToValue(j["debugCalc"], m_debugCalc);
265
266 jsonToValue(j["srcType"], m_srcType);
267 if (j.find("srcSpace")!=j.end())
268 jsonToColorSpace(j["srcSpace"], m_srcSpace);
269 jsonToValue(j["srcFile"], m_srcFile);
270
271 jsonToValue(j["dstType"], m_dstType);
272 jsonToValue(j["dstFile"], m_dstFile);
273 jsonToValue(j["dstEncoding"], m_dstEncoding);
274
275 jsonToValue(j["dstDigits"], m_dstDigits);
276 jsonToValue(j["dstPrecision"], m_dstPrecision);
277
278 return true;
279}
bool jsonToValue(const json &j, icFloatColorEncoding &v)
bool jsonToColorSpace(const json &j, icColorSpaceSignature &sig)
icColorSpaceSignature m_srcSpace

References jsonToColorSpace(), jsonToValue(), m_debugCalc, m_dstDigits, m_dstEncoding, m_dstFile, m_dstPrecision, m_dstType, m_srcFile, m_srcSpace, m_srcType, and reset().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset()

void CIccCfgDataApply::reset ( )

Definition at line 180 of file IccCmmConfig.cpp.

181{
182 m_debugCalc = false;
185 m_srcFile.clear();
187 m_dstFile.clear();
188 m_dstEncoding = icEncodeValue;
189 m_dstDigits = 9;
190 m_dstPrecision = 4;
191}
@ icCfgColorData
Definition IccCmmConfig.h:9
#define icSigUnknownData

References icCfgColorData, icSigUnknownData, m_debugCalc, m_dstDigits, m_dstEncoding, m_dstFile, m_dstPrecision, m_dstType, m_srcFile, m_srcSpace, and m_srcType.

Referenced by CIccCfgDataApply(), fromArgs(), and fromJson().

+ Here is the caller graph for this function:

◆ toJson()

void CIccCfgDataApply::toJson ( json & obj) const

Definition at line 281 of file IccCmmConfig.cpp.

282{
283 char buf[30];
284
285 if (m_debugCalc)
286 j["debugCalc"] = m_debugCalc;
287
288 jsonSetValue(j, "srcType", m_srcType);
290 j["srcSpace"] = icGetColorSigStr(buf, m_srcSpace);
291
292 if (m_srcFile.size())
293 j["srcFile"] = m_srcFile;
294
295 jsonSetValue(j, "dstType", m_dstType);
296 if (m_dstFile.size())
297 j["dstFile"] = m_dstFile;
298
299 if (m_dstEncoding != icEncodeValue)
300 j["dstEncoding"] = icGetJsonColorEncoding(m_dstEncoding);
301
302 if (m_dstDigits != 9)
303 j["dstDigits]"] = m_dstDigits;
304
305 if (m_dstPrecision != 4)
306 j["dstPrecision"] = m_dstPrecision;
307}
void jsonSetValue(json &j, const char *szName, icCfgDataType v)
const char * icGetJsonColorEncoding(icFloatColorEncoding v)
const icChar * icGetColorSigStr(icChar *pBuf, icUInt32Number nSig)
Definition IccUtil.cpp:1139

References icGetColorSigStr(), icGetJsonColorEncoding(), icSigUnknownData, jsonSetValue(), m_debugCalc, m_dstDigits, m_dstEncoding, m_dstFile, m_dstPrecision, m_dstType, m_srcFile, m_srcSpace, and m_srcType.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_debugCalc

bool CIccCfgDataApply::m_debugCalc

Definition at line 25 of file IccCmmConfig.h.

Referenced by fromJson(), main(), reset(), and toJson().

◆ m_dstDigits

icUInt8Number CIccCfgDataApply::m_dstDigits

Definition at line 36 of file IccCmmConfig.h.

Referenced by fromArgs(), fromJson(), main(), reset(), and toJson().

◆ m_dstEncoding

icFloatColorEncoding CIccCfgDataApply::m_dstEncoding

Definition at line 35 of file IccCmmConfig.h.

Referenced by fromArgs(), fromJson(), main(), reset(), and toJson().

◆ m_dstFile

std::string CIccCfgDataApply::m_dstFile

Definition at line 33 of file IccCmmConfig.h.

Referenced by fromArgs(), fromJson(), main(), reset(), and toJson().

◆ m_dstPrecision

icUInt8Number CIccCfgDataApply::m_dstPrecision

Definition at line 37 of file IccCmmConfig.h.

Referenced by fromArgs(), fromJson(), main(), reset(), and toJson().

◆ m_dstType

icCfgDataType CIccCfgDataApply::m_dstType

Definition at line 31 of file IccCmmConfig.h.

Referenced by fromArgs(), fromJson(), main(), reset(), and toJson().

◆ m_srcFile

std::string CIccCfgDataApply::m_srcFile

Definition at line 29 of file IccCmmConfig.h.

Referenced by fromArgs(), fromJson(), main(), reset(), and toJson().

◆ m_srcSpace

icColorSpaceSignature CIccCfgDataApply::m_srcSpace

Definition at line 27 of file IccCmmConfig.h.

Referenced by fromJson(), reset(), and toJson().

◆ m_srcType

icCfgDataType CIccCfgDataApply::m_srcType

Definition at line 26 of file IccCmmConfig.h.

Referenced by fromArgs(), fromJson(), main(), reset(), and toJson().


The documentation for this class was generated from the following files: