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

#include <IccCmmConfig.h>

+ Collaboration diagram for CIccCfgImageApply:

Public Member Functions

 CIccCfgImageApply ()
 
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 ~CIccCfgImageApply ()
 

Public Attributes

icDstBool m_dstCompression
 
icDstBool m_dstEmbedIcc
 
icFloatColorEncoding m_dstEncoding
 
std::string m_dstImgFile
 
icDstBool m_dstPlanar
 
std::string m_srcImgFile
 

Detailed Description

Definition at line 53 of file IccCmmConfig.h.

Constructor & Destructor Documentation

◆ CIccCfgImageApply()

CIccCfgImageApply::CIccCfgImageApply ( )

Definition at line 309 of file IccCmmConfig.cpp.

310{
311 reset();
312}

References reset().

+ Here is the call graph for this function:

◆ ~CIccCfgImageApply()

virtual CIccCfgImageApply::~CIccCfgImageApply ( )
inlinevirtual

Definition at line 57 of file IccCmmConfig.h.

57{}

Member Function Documentation

◆ fromArgs()

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

Definition at line 345 of file IccCmmConfig.cpp.

346{
347 if (nArg < 6) {
348 return 0;
349 }
350
351 if (bReset)
352 reset();
353
354 m_srcImgFile = args[0];
355 m_dstImgFile = args[1];
356
357 int n = atoi(args[2]);
358 switch (n)
359 {
360 case 0:
361 m_dstEncoding = icEncodeUnknown;
362 break;
363
364 default:
365 case 1:
366 m_dstEncoding = icEncode8Bit;
367 break;
368
369 case 2:
370 m_dstEncoding = icEncode16Bit;
371 break;
372
373 case 3:
374 m_dstEncoding = icEncodeFloat;
375 break;
376 }
377
378 m_dstCompression = atoi(args[3]) != 0 ? icDstBoolTrue : icDstBoolFalse;
379 m_dstPlanar = atoi(args[4]) != 0 ? icDstBoolTrue : icDstBoolFalse;
380 m_dstEmbedIcc = atoi(args[5]) != 0 ? icDstBoolTrue : icDstBoolFalse;
381
382 return 6;
383}
@ icDstBoolTrue
@ icDstBoolFalse
icFloatColorEncoding m_dstEncoding
std::string m_dstImgFile
std::string m_srcImgFile
icDstBool m_dstCompression
icDstBool m_dstPlanar
icDstBool m_dstEmbedIcc

References icDstBoolFalse, icDstBoolTrue, m_dstCompression, m_dstEmbedIcc, m_dstEncoding, m_dstImgFile, m_dstPlanar, m_srcImgFile, and reset().

Referenced by main().

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

◆ fromJson()

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

Definition at line 395 of file IccCmmConfig.cpp.

396{
397 if (!j.is_object())
398 return false;
399
400 if (bReset)
401 reset();
402
403 jsonToValue(j["srcImageFile"], m_srcImgFile);
404 jsonToValue(j["dstImageFile"], m_dstImgFile);
405
406 std::string str;
407 if (jsonToValue(j["dstEncoding"], str))
409
410 jsonToValue(j["dstCompression"], m_dstCompression);
411 jsonToValue(j["dstPlanar"], m_dstPlanar);
412 jsonToValue(j["dstEmbedIcc"], m_dstEmbedIcc);
413
414 return true;
415}
bool jsonToValue(const json &j, icFloatColorEncoding &v)
icFloatColorEncoding icSetJsonFileEncoding(const char *szEncode)

References icSetJsonFileEncoding(), jsonToValue(), m_dstCompression, m_dstEmbedIcc, m_dstEncoding, m_dstImgFile, m_dstPlanar, m_srcImgFile, and reset().

Referenced by main().

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

◆ reset()

void CIccCfgImageApply::reset ( )

Definition at line 335 of file IccCmmConfig.cpp.

336{
337 m_srcImgFile.clear();
338 m_dstImgFile.clear();
339 m_dstEncoding = icEncode8Bit;
343}

References icDstBoolFalse, icDstBoolTrue, m_dstCompression, m_dstEmbedIcc, m_dstEncoding, m_dstImgFile, m_dstPlanar, and m_srcImgFile.

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

+ Here is the caller graph for this function:

◆ toJson()

void CIccCfgImageApply::toJson ( json & obj) const

Definition at line 417 of file IccCmmConfig.cpp.

418{
419 if (m_srcImgFile.size())
420 j["srcImgFile"] = m_srcImgFile;
421 if (m_dstImgFile.size())
422 j["dstImgFile"] = m_dstImgFile;
423
424 if (m_dstEncoding != icEncode8Bit)
425 j["dstEncoding"] = icGetJsonFileEncoding(m_dstEncoding);
426
427 setDstBool(j, "dstCompression", m_dstCompression);
428 setDstBool(j, "dstPlanar", m_dstPlanar);
429 setDstBool(j, "dstEmbedIcc", m_dstEmbedIcc);
430}
const char * icGetJsonFileEncoding(icFloatColorEncoding v)
static void setDstBool(json &j, const char *szName, icDstBool v)

References icGetJsonFileEncoding(), m_dstCompression, m_dstEmbedIcc, m_dstEncoding, m_dstImgFile, m_dstPlanar, m_srcImgFile, and setDstBool().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_dstCompression

icDstBool CIccCfgImageApply::m_dstCompression

Definition at line 67 of file IccCmmConfig.h.

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

◆ m_dstEmbedIcc

icDstBool CIccCfgImageApply::m_dstEmbedIcc

Definition at line 69 of file IccCmmConfig.h.

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

◆ m_dstEncoding

icFloatColorEncoding CIccCfgImageApply::m_dstEncoding

Definition at line 66 of file IccCmmConfig.h.

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

◆ m_dstImgFile

std::string CIccCfgImageApply::m_dstImgFile

Definition at line 65 of file IccCmmConfig.h.

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

◆ m_dstPlanar

icDstBool CIccCfgImageApply::m_dstPlanar

Definition at line 68 of file IccCmmConfig.h.

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

◆ m_srcImgFile

std::string CIccCfgImageApply::m_srcImgFile

Definition at line 64 of file IccCmmConfig.h.

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


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