4930{
4931
4932 xmlNode *childNode, *subNode;
4933
4935 if (!childNode) {
4936 parseStr += "Cannot find Vertices\n";
4937 return false;
4938 }
4939
4941
4942 if (subNode) {
4944
4946 parseStr += "Bad PCSValues channels\n";
4947 return false;
4948 }
4949
4952 parseStr += "Unable to parse GamutBoundaryDesc PCSValues\n";
4953 return false;
4954 }
4955
4957
4959 parseStr += "Must have at least 4 PCSValues vertices\n";
4960 return false;
4961 }
4962
4964
4966 return false;
4967
4969 }
4970 else {
4971 parseStr += "Cannot find PCSValues\n";
4972 return false;
4973 }
4974
4975 subNode =
icXmlFindNode(childNode->children,
"DeviceValues");
4976
4977 if (subNode) {
4979
4981 parseStr += "Bad DeviceValues channels\n";
4982 return false;
4983 }
4984
4987 parseStr += "Unable to parse GamutBoundaryDesc DeviceValues\n";
4988 return false;
4989 }
4990
4992
4994 parseStr += "Number of Device vertices doesn't match PCS verticies\n";
4995 return false;
4996 }
4997
4999
5001 return false;
5002
5004 }
5007
5009 if (!childNode) {
5010 parseStr += "Cannot find Triangles\n";
5011 return false;
5012 }
5013
5014 int nMaxIndex = 0, n=0;
5015 for (subNode = childNode->children; subNode; subNode = subNode->next) {
5016 if (subNode->type == XML_ELEMENT_NODE && !strcmp((
icChar*)subNode->name,
"T")) {
5017 nMaxIndex++;
5018 }
5019 }
5022
5023 n=0;
5024 for (subNode = childNode->children; subNode && n<nMaxIndex; subNode = subNode->next) {
5025 if (subNode->type == XML_ELEMENT_NODE && !strcmp((
icChar*)subNode->name,
"T")) {
5027
5029 parseStr += "Invalid Triangle entry\n";
5030 return false;
5031 }
5033
5037
5038 n++;
5039 }
5040 }
5041
5042 return true;
5043}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
xmlNode * icXmlFindNode(xmlNode *pNode, const char *szNodeName)
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault)
unsigned int icUInt32Number
icGamutBoundaryTriangle * m_Triangles
icInt32Number m_NumberOfTriangles
icInt16Number m_nPCSChannels
icFloatNumber * m_DeviceValues
icFloatNumber * m_PCSValues
icInt16Number m_nDeviceChannels
icInt32Number m_NumberOfVertices
static bool ParseArray(T *buf, icUInt32Number nBufSize, xmlNode *pNode)
icUInt32Number m_VertexNumbers[3]