Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
CIccFormulaCurveSegmentXml Class Reference
+ Inheritance diagram for CIccFormulaCurveSegmentXml:
+ Collaboration diagram for CIccFormulaCurveSegmentXml:

Public Member Functions

 CIccFormulaCurveSegmentXml (icFloatNumber start, icFloatNumber end)
 
bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
bool ToXml (std::string &xml, std::string blanks)
 
- Public Member Functions inherited from CIccFormulaCurveSegment
virtual icFloatNumber Apply (icFloatNumber v) const
 Name: CIccFormulaCurveSegment::Apply.
 
virtual bool Begin (CIccCurveSegment *pPrevSeg)
 Name: CIccFormulaCurveSegment::Begin.
 
 CIccFormulaCurveSegment (const CIccFormulaCurveSegment &seg)
 Name: CIccFormulaCurveSegment::CIccFormulaCurveSegment.
 
 CIccFormulaCurveSegment (icFloatNumber start, icFloatNumber end)
 Name: CIccFormulaCurveSegment::CIccFormulaCurveSegment.
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccFormulaCurveSegment::Describe.
 
virtual const icCharGetClassName () const
 
virtual icCurveSegSignature GetType () const
 
virtual CIccCurveSegmentNewCopy () const
 
CIccFormulaCurveSegmentoperator= (const CIccFormulaCurveSegment &seg)
 Name: &CIccFormulaCurveSegment::operator=.
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccFormulaCurveSegment::Read.
 
void SetFunction (icUInt16Number functionType, icUInt8Number num_parameters, icFloatNumber *parameters)
 Name: CIccFormulaCurveSegment::SetFunction.
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 Name: CIccFormulaCurveSegment::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccFormulaCurveSegment::Write.
 
virtual ~CIccFormulaCurveSegment ()
 Name: CIccFormulaCurveSegment::~CIccFormulaCurveSegment.
 
- Public Member Functions inherited from CIccCurveSegment
icFloatNumber EndPoint ()
 
icFloatNumber StartPoint ()
 
virtual ~CIccCurveSegment ()
 

Additional Inherited Members

- Static Public Member Functions inherited from CIccCurveSegment
static CIccCurveSegmentCreate (icCurveSegSignature sig, icFloatNumber start, icFloatNumber end)
 Name: CIccCurveSegment::Create.
 
- Protected Attributes inherited from CIccFormulaCurveSegment
icUInt16Number m_nFunctionType
 
icUInt8Number m_nParameters
 
icUInt16Number m_nReserved2
 
icUInt16Number m_nShortcutType
 
icFloatNumberm_params
 
- Protected Attributes inherited from CIccCurveSegment
icFloatNumber m_endPoint
 
icUInt32Number m_nReserved
 
icFloatNumber m_startPoint
 

Detailed Description

Definition at line 127 of file IccMpeXml.cpp.

Constructor & Destructor Documentation

◆ CIccFormulaCurveSegmentXml()

CIccFormulaCurveSegmentXml::CIccFormulaCurveSegmentXml ( icFloatNumber start,
icFloatNumber end )
inline

Definition at line 130 of file IccMpeXml.cpp.

130: CIccFormulaCurveSegment(start, end) {}
CIccFormulaCurveSegment(icFloatNumber start, icFloatNumber end)
Name: CIccFormulaCurveSegment::CIccFormulaCurveSegment.

Member Function Documentation

◆ ParseXml()

bool CIccFormulaCurveSegmentXml::ParseXml ( xmlNode * pNode,
std::string & parseStr )

Definition at line 193 of file IccMpeXml.cpp.

194{
195 xmlAttr *funcType = icXmlFindAttr(pNode, "FunctionType");
196
197 if (!funcType) {
198 parseStr += "Bad FunctionType in Formula Segment\n";
199 return false;
200 }
201
202 m_nReserved2 = atoi(icXmlAttrValue(pNode, "Reserved2"));
203 m_nFunctionType = atoi(icXmlAttrValue(funcType));
204
205
206 switch(m_nFunctionType) {
207 case 0x0000:
208 m_nParameters = 4;
209 break;
210
211 case 0x0001:
212 case 0x0002:
213 case 0x0003:
214 case 0x0004:
215 m_nParameters = 5;
216 break;
217
218 case 0x0005:
219 case 0x0007:
220 m_nParameters = 6;
221 break;
222
223 case 0x0006:
224 m_nParameters = 7;
225 break;
226
227 default:
228 parseStr += "Unsupported FunctionType value in Formula Segment\n";
229 return false;
230 }
231
232 CIccFloatArray args;
233
234 if (!args.ParseArray(pNode->children))
235 return false;
236
237 if (args.GetSize()<m_nParameters)
238 return false;
239
240 if (m_params) {
241 free(m_params);
242 }
243
244 if (m_nParameters) {
246 if (!m_params)
247 return false;
248
249 memcpy(m_params, args.GetBuf(), m_nParameters * sizeof(icFloatNumber));
250 }
251 else
252 m_params = NULL;
253
254 return true;
255}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
xmlAttr * icXmlFindAttr(xmlNode *pNode, const char *szAttrName)
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault)
icUInt8Number m_nParameters
icUInt16Number m_nFunctionType
icUInt16Number m_nReserved2
icFloatNumber * m_params
static bool ParseArray(T *buf, icUInt32Number nBufSize, xmlNode *pNode)
icUInt32Number GetSize()
Definition IccUtilXml.h:166

References CIccXmlArrayType< T, Tsig >::GetBuf(), CIccXmlArrayType< T, Tsig >::GetSize(), icXmlAttrValue(), icXmlFindAttr(), and CIccXmlArrayType< T, Tsig >::ParseArray().

Referenced by CIccSegmentedCurveXml::ParseXml().

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

◆ ToXml()

bool CIccFormulaCurveSegmentXml::ToXml ( std::string & xml,
std::string blanks )

Definition at line 161 of file IccMpeXml.cpp.

162{
163 char buf[256];
164 char line[256];
165
166 sprintf(line, "<FormulaSegment Start=\"%s\"", icSegPos(buf, m_startPoint));
167 xml += blanks + line;
168
169 sprintf(line, " End=\"%s\"",icSegPos(buf, m_endPoint));
170 xml += line;
171
172 sprintf(line, " FunctionType=\"%d\"", m_nFunctionType);
173 xml += line;
174
175 if (m_nReserved) {
176 sprintf(line, " Reserved=\"%d\"", m_nReserved);
177 xml += line;
178 }
179 if (m_nReserved2) {
180 sprintf(line, " Reserved2=\"%d\"", m_nReserved2);
181 xml += line;
182 }
183 xml += ">\n";
184
186
187 xml += blanks + "</FormulaSegment>\n";
188
189 return true;
190}
static char * icSegPos(char *buf, icFloatNumber pos)
@ icConvertFloat
icFloatNumber m_startPoint
icFloatNumber m_endPoint
icUInt32Number m_nReserved
static bool DumpArray(std::string &xml, std::string blanks, T *buf, icUInt32Number nBufSize, icConvertType nType, icUInt8Number nColumns)

References CIccXmlArrayType< T, Tsig >::DumpArray(), icConvertFloat, and icSegPos().

+ Here is the call graph for this function:

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