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

#include <IccCmmConfig.h>

+ Collaboration diagram for CIccCfgProfileSequence:

Public Member Functions

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

Public Attributes

CIccCfgProfileArray m_profiles
 

Detailed Description

Definition at line 127 of file IccCmmConfig.h.

Constructor & Destructor Documentation

◆ CIccCfgProfileSequence()

CIccCfgProfileSequence::CIccCfgProfileSequence ( )

Definition at line 704 of file IccCmmConfig.cpp.

705{
706}

◆ ~CIccCfgProfileSequence()

virtual CIccCfgProfileSequence::~CIccCfgProfileSequence ( )
inlinevirtual

Definition at line 131 of file IccCmmConfig.h.

131{}

Member Function Documentation

◆ fromArgs()

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

Definition at line 713 of file IccCmmConfig.cpp.

714{
715 int nUsed = 0;
716 if (bReset)
717 reset();
718
719 icXformInterp interpolation = icInterpTetrahedral;
720
721 if (nArg > 1) {
722 interpolation = (icXformInterp)atoi(args[0]);
723 args++;
724 nArg--;
725 nUsed++;
726 }
727
728 bool bFirst = true;
729 while (nArg >= 2) {
731
732 while (nArg >= 2 && !strnicmp(args[0], "-ENV:", 5)) { //check for -ENV: to allow for Cmm Environment variables to be defined for next transform
733 icSignature sig = icGetSigVal(args[0] + 5);
734 icFloatNumber val = (icFloatNumber)atof(args[1]);
735 args += 2;
736 nArg -= 2;
737 nUsed += 2;
738
739 pProf->m_iccEnvVars[sig] = val;
740 }
741
742 if (nArg >= 2) {
743
744 pProf->m_iccFile = args[0];
745 if (bFirst) {
746 if (!stricmp(args[0], "-embedded")) {
747 pProf->m_iccFile.clear();
748 }
749 bFirst = false;
750 }
751 int nType;
752 int nIntent = atoi(args[1]);
753
754 pProf->m_useD2BxB2Dx = true;
755 pProf->m_useHToS = (nIntent / 100000) != 0;
756 pProf->m_useV5SubProfile = (nIntent / 10000) != 0;
757 nIntent = nIntent % 10000;
758 pProf->m_adjustPcsLuminance = nIntent / 1000 != 0;
759 nIntent = nIntent % 1000;
760 nType = abs(nIntent) / 10;
761 nIntent = nIntent % 10;
762
763 if (nType == 1) {
764 pProf->m_useD2BxB2Dx = false;
765 nType = icXformLutColor;
766 }
767 else if (nType == 4) {
768 pProf->m_useBPC = true;
769 nType = icXformLutColor;
770 }
771
772 pProf->m_intent = (icRenderingIntent)nIntent;
773 pProf->m_transform = (icXformLutType)nType;
774 pProf->m_interpolation = interpolation;
775
776 args += 2;
777 nArg -= 2;
778 nUsed += 2;
779 }
780
781 if (nArg >= 2 && !stricmp(args[0], "-PCC")) {
782 pProf->m_pccFile = args[1];
783 args += 2;
784 nArg -= 2;
785 nUsed += 2;
786 }
787 m_profiles.push_back(pProf);
788 }
789
790 return m_profiles.size()>0 ? nUsed : 0;
791}
icArraySignature sig
icXformLutType
CMM Xform LUT types.
Definition IccCmm.h:125
@ icXformLutColor
Definition IccCmm.h:126
icXformInterp
CMM Interpolation types.
Definition IccCmm.h:113
@ icInterpTetrahedral
Definition IccCmm.h:115
std::shared_ptr< CIccCfgProfile > CIccCfgProfilePtr
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
#define strnicmp
#define stricmp
icUInt32Number icGetSigVal(const icChar *pBuf)
Definition IccUtil.cpp:1258
CIccCfgProfileArray m_profiles
icUInt32Number icSignature
icRenderingIntent
Rendering Intents, used in the profile header.

References icGetSigVal(), icInterpTetrahedral, icXformLutColor, m_profiles, reset(), sig, stricmp, and strnicmp.

Referenced by main(), and main().

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

◆ fromJson()

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

Definition at line 793 of file IccCmmConfig.cpp.

794{
795 if (!j.is_array())
796 return false;
797
798 if (bReset)
799 reset();
800
801 for (auto p = j.begin(); p != j.end(); p++) {
802 if (p->is_object()) {
804 if (pProf->fromJson(*p)) {
805 m_profiles.push_back(pProf);
806 }
807 else {
808 pProf.reset();
809 }
810 }
811 }
812
813 return true;
814}

References m_profiles, and reset().

Referenced by main(), and main().

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

◆ reset()

void CIccCfgProfileSequence::reset ( )

Definition at line 708 of file IccCmmConfig.cpp.

709{
710 m_profiles.clear();
711}

References m_profiles.

Referenced by fromArgs(), and fromJson().

+ Here is the caller graph for this function:

◆ toJson()

void CIccCfgProfileSequence::toJson ( json & obj) const

Definition at line 816 of file IccCmmConfig.cpp.

817{
818 for (auto p = m_profiles.begin(); p != m_profiles.end(); p++) {
819 CIccCfgProfile* pProf = p->get();
820 if (!pProf)
821 continue;
822 json prof;
823 pProf->toJson(prof);
824 obj.push_back(prof);
825 }
826}
void toJson(json &obj) const

References m_profiles, and CIccCfgProfile::toJson().

Referenced by main().

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

Member Data Documentation

◆ m_profiles

CIccCfgProfileArray CIccCfgProfileSequence::m_profiles

Definition at line 138 of file IccCmmConfig.h.

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


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