IccMAX 2.1.27
Color Profile Tools
Loading...
Searching...
No Matches
IccUtilXml.cpp File Reference
#include <time.h>
#include "IccUtilXml.h"
#include "IccConvertUTF.h"
#include "IccTagFactory.h"
#include <cstring>
#include <math.h>
+ Include dependency graph for IccUtilXml.cpp:

Go to the source code of this file.

Data Structures

class  CIccDumpXmlCLUT
 

Functions

static int hexValue (char c)
 
const char * icAnsiToUtf8 (std::string &buf, const char *szSrc)
 
bool icCLUTDataToXml (std::string &xml, CIccCLUT *pCLUT, icConvertType nType, std::string blanks, bool bSaveGridPoints)
 
bool icCLUTToXml (std::string &xml, CIccCLUT *pCLUT, icConvertType nType, std::string blanks, bool bSaveGridPoints, const char *szExtraAttrs, const char *szName)
 
const char * icFixXml (char *szDest, const char *szStr)
 
const char * icFixXml (std::string &buf, const char *szStr)
 
icMeasurementGeometry icGeNamedtMeasurementGeometryValue (const icChar *str)
 
icColorantEncoding icGetColorantValue (const icChar *str)
 
icDateTimeNumber icGetDateTimeValue (const icChar *str)
 
const std::string icGetDeviceAttrName (icUInt64Number devAttr)
 
icUInt64Number icGetDeviceAttrValue (xmlNode *pNode)
 
const std::string icGetHeaderFlagsName (icUInt32Number flags, bool bUsesMCS)
 
icIlluminant icGetIlluminantValue (const icChar *str)
 
icMeasurementUnitSig icGetMeasurementValue (const icChar *str)
 
icMeasurementFlare icGetNamedMeasurementFlareValue (const icChar *str)
 
icStandardObserver icGetNamedStandardObserverValue (const icChar *str)
 
const std::string icGetPadSpace (double value)
 
icRenderingIntent icGetRenderingIntentValue (const icChar *szRenderingIntent)
 
const icCharicGetStandardObserverName (icStandardObserver str)
 
icTagSignature icGetTagNameSig (const icChar *szName)
 
const icCharicGetTagSigName (icTagSignature tagTypeSig)
 
const icCharicGetTagSigTypeName (icTagTypeSignature tagTypeSig)
 
icTagTypeSignature icGetTypeNameTagSig (const icChar *szTagType)
 
static bool icIsNumChar (char c)
 
const char * icUtf16ToUtf8 (std::string &buf, const icUInt16Number *szSrc, int sizeSrc)
 
const char * icUtf8ToAnsi (std::string &buf, const char *szSrc)
 
const unsigned short * icUtf8ToUtf16 (CIccUTF16String &buf, const char *szSrc, int sizeSrc)
 
const char * icXmlAttrValue (xmlAttr *attr, const char *szDefault)
 
const char * icXmlAttrValue (xmlNode *pNode, const char *szName, const char *szDefault)
 
icUInt32Number icXmlDumpHexData (std::string &xml, std::string blanks, void *pBuf, icUInt32Number nBufSize)
 
xmlAttr * icXmlFindAttr (xmlNode *pNode, const char *szAttrName)
 
xmlNode * icXmlFindNode (xmlNode *pNode, const char *szNodeName)
 
icUInt32Number icXmlGetChildSigVal (xmlNode *pNode)
 
icUInt32Number icXmlGetHexData (void *pBuf, const char *szText, icUInt32Number nBufSize)
 
icUInt32Number icXmlGetHexDataSize (const char *szText)
 
icUInt32Number icXmlNodeCount (xmlNode *pNode, const char *szNodeName)
 
icUInt32Number icXmlNodeCount2 (xmlNode *pNode, const char *szNodeName1, const char *szNodeName2)
 
icUInt32Number icXmlNodeCount3 (xmlNode *pNode, const char *szNodeName1, const char *szNodeName2, const char *szNodeName3)
 
icFloatNumber icXmlStrToFloat (const xmlChar *szStr)
 
icSignature icXmlStrToSig (const char *szStr)
 

Detailed Description

File: IccUtilXml.cpp

Contains: Implementation of XML conversion utilities

Version: V1

Copyright: (c) see ICC Software License

Definition in file IccUtilXml.cpp.

Function Documentation

◆ hexValue()

static int hexValue ( char  c)
static
598{
599 if (c>='0' && c<='9')
600 return c-'0';
601 if (c>='A' && c<='F')
602 return c-'A'+10;
603 if (c>='a' && c<='f')
604 return c-'a'+10;
605 return -1;
606}

Referenced by icXmlGetHexData(), and icXmlGetHexDataSize().

+ Here is the caller graph for this function:

◆ icAnsiToUtf8()

const char * icAnsiToUtf8 ( std::string &  buf,
const char *  szSrc 
)
373{
374#ifdef WIN32
375 size_t len = strlen(szSrc)+1;
376 wchar_t *szUnicodeBuf = (wchar_t*)malloc(len*sizeof(icUInt16Number)*2);
377 char *szBuf = (char*)malloc(len*2);
378
379 size_t n;
380
381 n=MultiByteToWideChar(CP_ACP, 0, szSrc, (int)len-1, szUnicodeBuf, (int)len*2);
382 szUnicodeBuf[n] = '\0';
383
384 n = WideCharToMultiByte(CP_UTF8, 0, (const wchar_t*)szUnicodeBuf, (int)n, szBuf, (int)len*2, 0, NULL);
385 szBuf[n] = '\0';
386
387 buf = szBuf;
388
389 free(szBuf);
390 free(szUnicodeBuf);
391#else
392 buf = szSrc;
393#endif
394 return buf.c_str();
395}
unsigned short icUInt16Number
Definition icProfileHeader.h:256

Referenced by icXmlDumpTextData(), CIccTagXmlNamedColor2::ToXml(), and CIccTagXmlColorantTable::ToXml().

+ Here is the caller graph for this function:

◆ icCLUTDataToXml()

bool icCLUTDataToXml ( std::string &  xml,
CIccCLUT pCLUT,
icConvertType  nType,
std::string  blanks,
bool  bSaveGridPoints 
)
487{
488 char buf[128];
489 int nStartType = nType;
490 if (nType == icConvertVariable) {
491 nType = pCLUT->GetPrecision()==1 ? icConvert8Bit : icConvert16Bit;
492 }
493
494 if (bSaveGridPoints) {
495 xml += blanks + " <GridPoints>";
496 int i;
497
498 for (i=0; i<pCLUT->GetInputDim(); i++) {
499 if (i)
500 sprintf(buf, " %d", pCLUT->GridPoint(i));
501 else
502 sprintf(buf, "%d", pCLUT->GridPoint(i));
503 xml += buf;
504 }
505 xml += "</GridPoints>\n";
506 }
507
508 int nPixelsPerRow = pCLUT->GridPoint(0);
509
510 // if the CLUT has no GridPoints, profile is invalid
511 if (nPixelsPerRow == 0) {
512 printf("\nError! - CLUT Table not found.\n");
513 return false;
514 }
515
516 CIccDumpXmlCLUT dumper(&xml, nType, blanks + " ", pCLUT->GetOutputChannels(), nPixelsPerRow);
517
518 xml += blanks + " <TableData";
519
520 if (nStartType == icConvertVariable && nType == icConvert8Bit) {
521 sprintf(buf, " Precision=\"1\"");
522 xml += buf;
523 }
524
525 xml += ">\n";
526
527 pCLUT->Iterate(&dumper);
528
529 dumper.Finish();
530
531 xml += blanks + " </TableData>\n";
532
533 return true;
534
535}
@ icConvert8Bit
Definition IccXmlConfig.h:68
@ icConvert16Bit
Definition IccXmlConfig.h:69
@ icConvertVariable
Definition IccXmlConfig.h:71
icUInt8Number GetInputDim() const
Definition IccTagLut.h:356
icUInt16Number GetOutputChannels() const
Definition IccTagLut.h:357
void Iterate(IIccCLUTExec *pExec)
Definition IccTagLut.cpp:2069
icUInt8Number GridPoint(int index) const
Definition IccTagLut.h:350
icUInt8Number GetPrecision()
Definition IccTagLut.h:381
Definition IccUtilXml.cpp:423

References CIccDumpXmlCLUT::CIccDumpXmlCLUT(), CIccDumpXmlCLUT::Finish(), CIccCLUT::GetInputDim(), CIccCLUT::GetOutputChannels(), CIccCLUT::GetPrecision(), CIccCLUT::GridPoint(), icConvert16Bit, icConvert8Bit, icConvertVariable, and CIccCLUT::Iterate().

Referenced by icCLUTToXml(), CIccMpeXmlEmissionCLUT::ToXml(), and CIccMpeXmlReflectanceCLUT::ToXml().

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

◆ icCLUTToXml()

bool icCLUTToXml ( std::string &  xml,
CIccCLUT pCLUT,
icConvertType  nType,
std::string  blanks,
bool  bSaveGridPoints,
const char *  szExtraAttrs,
const char *  szName 
)
539{
540 char buf[128];
541 xml += blanks + "<" + szName;
542
543 if (!bSaveGridPoints) {
544 sprintf(buf, " GridGranularity=\"%d\"", pCLUT->GridPoint(0));
545 xml += buf;
546 }
547
548 if (szExtraAttrs && *szExtraAttrs) {
549 xml += szExtraAttrs;
550 }
551 xml += ">\n";
552
553 icCLUTDataToXml(xml, pCLUT, nType, blanks, bSaveGridPoints);
554
555 xml += blanks + "</" + szName + ">\n";
556 return true;
557}
bool icCLUTDataToXml(std::string &xml, CIccCLUT *pCLUT, icConvertType nType, std::string blanks, bool bSaveGridPoints)
Definition IccUtilXml.cpp:485

References CIccCLUT::GridPoint(), and icCLUTDataToXml().

Referenced by icMBBToXml(), CIccMpeXmlCLUT::ToXml(), and CIccMpeXmlExtCLUT::ToXml().

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

◆ icFixXml() [1/2]

const char * icFixXml ( char *  szDest,
const char *  szStr 
)
306{
307 char *m_ptr = szDest;
308
309 while (*szStr) {
310 switch (*szStr) {
311 case '\'':
312 strcpy(m_ptr, "&apos;");
313 m_ptr += 6;
314 break;
315 case '&':
316 strcpy(m_ptr, "&amp;");
317 m_ptr += 5;
318 break;
319 case '\"':
320 strcpy(m_ptr, "&quot;");
321 m_ptr += 6;
322 break;
323 case '<':
324 strcpy(m_ptr, "&lt;");
325 m_ptr += 4;
326 break;
327 case '>':
328 strcpy(m_ptr, "&gt;");
329 m_ptr += 4;
330 break;
331 default:
332 *m_ptr++ = *szStr;
333 }
334 szStr++;
335 }
336 *m_ptr = '\0';
337
338 return szDest;
339}

Referenced by icProfDescToXml(), CIccMpeXmlUnknown::ToXml(), CIccMpeXmlBAcs::ToXml(), CIccMpeXmlEAcs::ToXml(), CIccTagXmlSignature::ToXml(), CIccTagXmlNamedColor2::ToXml(), CIccTagXmlColorantTable::ToXml(), CIccTagXmlSpectralDataInfo::ToXml(), CIccTagXmlProfileSequenceId::ToXml(), CIccTagXmlDict::ToXml(), CIccTagXmlStruct::ToXml(), CIccTagXmlArray::ToXml(), and CIccProfileXml::ToXmlWithBlanks().

+ Here is the caller graph for this function:

◆ icFixXml() [2/2]

const char * icFixXml ( std::string &  buf,
const char *  szStr 
)
277{
278 buf = "";
279 while (*szStr) {
280 switch (*szStr) {
281 case '\'':
282 buf += "&apos;";
283 break;
284 case '&':
285 buf += "&amp;";
286 break;
287 case '\"':
288 buf += "&quot;";
289 break;
290 case '<':
291 buf += "&lt;";
292 break;
293 case '>':
294 buf += "&gt;";
295 break;
296 default:
297 buf += *szStr;
298 }
299 szStr++;
300 }
301
302 return buf.c_str();
303}

Referenced by CIccTagXmlTextDescription::ToXml(), and CIccTagXmlMultiLocalizedUnicode::ToXml().

+ Here is the caller graph for this function:

◆ icGeNamedtMeasurementGeometryValue()

icMeasurementGeometry icGeNamedtMeasurementGeometryValue ( const icChar str)
1191{
1192 if (!strcmp(str, "Geometry Unknown"))
1193 return icGeometryUnknown;
1194
1195 if (!strcmp(str, "Geometry 0-45 or 45-0"))
1196 return icGeometry045or450;
1197
1198 if (!strcmp(str, "Geometry 0-d or d-0"))
1199 return icGeometry0dord0;
1200
1201 if (!strcmp(str, "Max Geometry"))
1202 return icMaxEnumGeometry;
1203
1204 return icGeometryUnknown;
1205}
@ icGeometry045or450
Definition icProfileHeader.h:1131
@ icGeometry0dord0
Definition icProfileHeader.h:1132
@ icGeometryUnknown
Definition icProfileHeader.h:1130
#define icMaxEnumGeometry
Definition icProfileHeader.h:1136

References icGeometry045or450, icGeometry0dord0, and icGeometryUnknown.

Referenced by CIccTagXmlMeasurement::ParseXml().

+ Here is the caller graph for this function:

◆ icGetColorantValue()

icColorantEncoding icGetColorantValue ( const icChar str)
1378{
1379 if (!strcmp(str, "ITU-R BT.709"))
1380 return icColorantITU;
1381
1382 if (!strcmp(str, "SMPTE RP145-1994"))
1383 return icColorantSMPTE;
1384
1385 if (!strcmp(str, "EBU Tech.3213-E"))
1386 return icColorantEBU;
1387
1388 if (!strcmp(str, "P22"))
1389 return icColorantP22;
1390
1391 return icColorantUnknown;
1392}
@ icColorantEBU
Definition icProfileHeader.h:1299
@ icColorantUnknown
Definition icProfileHeader.h:1296
@ icColorantITU
Definition icProfileHeader.h:1297
@ icColorantSMPTE
Definition icProfileHeader.h:1298
@ icColorantP22
Definition icProfileHeader.h:1300

References icColorantEBU, icColorantITU, icColorantP22, icColorantSMPTE, and icColorantUnknown.

Referenced by CIccTagXmlChromaticity::ParseXml().

+ Here is the caller graph for this function:

◆ icGetDateTimeValue()

icDateTimeNumber icGetDateTimeValue ( const icChar str)
1313{
1314 unsigned int day=0, month=0, year=0, hours=0, minutes=0, seconds=0;
1315 icDateTimeNumber dateTime = {};
1316
1317 if (!stricmp(str, "now")) {
1318 time_t rawtime;
1319 struct tm * timeinfo;
1320
1321 time ( &rawtime );
1322 timeinfo = localtime ( &rawtime );
1323 year = timeinfo->tm_year+1900;
1324 month = timeinfo->tm_mon+1;
1325 day = timeinfo->tm_mday;
1326 hours = timeinfo->tm_hour;
1327 minutes = timeinfo->tm_min;
1328 seconds = timeinfo->tm_sec;
1329 }
1330 else {
1331 sscanf(str, "%d-%02d-%02dT%02d:%02d:%02d", &year, &month, &day, &hours, &minutes, &seconds);
1332 }
1333
1334 dateTime.year = year;
1335 dateTime.month = month;
1336 dateTime.day = day;
1337 dateTime.hours = hours;
1338 dateTime.minutes = minutes;
1339 dateTime.seconds = seconds;
1340
1341 return dateTime;
1342}
icUInt16Number year
Definition icProfileHeader.h:1419
icUInt16Number month
Definition icProfileHeader.h:1420
icUInt16Number minutes
Definition icProfileHeader.h:1423
icUInt16Number seconds
Definition icProfileHeader.h:1424
icUInt16Number hours
Definition icProfileHeader.h:1422
icUInt16Number day
Definition icProfileHeader.h:1421
Definition icProfileHeader.h:1418
#define stricmp
Definition IccProfLibConf.h:149

References icDateTimeNumber::day, icDateTimeNumber::hours, icDateTimeNumber::minutes, icDateTimeNumber::month, icDateTimeNumber::seconds, and icDateTimeNumber::year.

Referenced by CIccProfileXml::ParseBasic(), and CIccTagXmlDateTime::ParseXml().

+ Here is the caller graph for this function:

◆ icGetDeviceAttrName()

const std::string icGetDeviceAttrName ( icUInt64Number  devAttr)
1427{
1428 char line[256];
1429 std::string xml;
1430
1431 if (devAttr & icTransparency)
1432 sprintf(line, "<DeviceAttributes ReflectiveOrTransparency=\"transparency\"");
1433 else
1434 sprintf(line, "<DeviceAttributes ReflectiveOrTransparency=\"reflective\"");
1435 xml += line;
1436
1437
1438 if (devAttr & icMatte)
1439 sprintf(line, " GlossyOrMatte=\"matte\"");
1440 else
1441 sprintf(line, " GlossyOrMatte=\"glossy\"");
1442 xml += line;
1443
1444
1445 if (devAttr & icMediaNegative)
1446 sprintf(line, " MediaPolarity=\"negative\"");
1447 else
1448 sprintf(line, " MediaPolarity=\"positive\"");
1449 xml += line;
1450
1451 if (devAttr & icMediaBlackAndWhite)
1452 sprintf(line, " MediaColour=\"blackAndwhite\"");
1453 else
1454 sprintf(line, " MediaColour=\"colour\"");
1455 xml += line;
1456
1458
1459 if (devAttr & otherAttr) {
1460 sprintf(line, " VendorSpecific=\"%016llx\"", devAttr & otherAttr);
1461 xml += line;
1462 }
1463
1464 xml += "/>\n";
1465
1466 return xml;
1467}
#define icMediaBlackAndWhite
Definition icProfileHeader.h:214
#define icTransparency
Definition icProfileHeader.h:208
#define icMatte
Definition icProfileHeader.h:210
#define icMediaNegative
Definition icProfileHeader.h:212
icUInt32Number icUInt64Number[2]
Definition icProfileHeader.h:268

Referenced by icProfDescToXml(), and CIccProfileXml::ToXmlWithBlanks().

+ Here is the caller graph for this function:

◆ icGetDeviceAttrValue()

icUInt64Number icGetDeviceAttrValue ( xmlNode *  pNode)
1345{
1346 icUInt64Number devAttr = 0;
1347 xmlAttr *attr = icXmlFindAttr(pNode, "ReflectiveOrTransparency");
1348 if (attr && !strcmp(icXmlAttrValue(attr), "transparency")) {
1349 devAttr |= icTransparency;
1350 }
1351
1352 attr = icXmlFindAttr(pNode, "GlossyOrMatte");
1353 if (attr && !strcmp(icXmlAttrValue(attr), "matte")) {
1354 devAttr |= icMatte;
1355 }
1356
1357 attr = icXmlFindAttr(pNode, "MediaPolarity");
1358 if (attr && !strcmp(icXmlAttrValue(attr), "negative")) {
1359 devAttr |= icMediaNegative;
1360 }
1361
1362 attr = icXmlFindAttr(pNode, "MediaColour");
1363 if (attr && !strcmp(icXmlAttrValue(attr), "blackAndWhite")) {
1364 devAttr |= icMediaBlackAndWhite;
1365 }
1366
1367 attr = icXmlFindAttr(pNode, "VendorSpecific");
1368 if (attr) {
1369 icUInt64Number vendor;
1370 sscanf(icXmlAttrValue(attr), "%llx", &vendor);
1371 devAttr |= vendor;
1372 }
1373
1374 return devAttr;
1375}
xmlAttr * icXmlFindAttr(xmlNode *pNode, const char *szAttrName)
Definition IccUtilXml.cpp:669
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault)
Definition IccUtilXml.cpp:572

References icXmlAttrValue(), and icXmlFindAttr().

Referenced by icXmlParseProfDesc(), and CIccProfileXml::ParseBasic().

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

◆ icGetHeaderFlagsName()

const std::string icGetHeaderFlagsName ( icUInt32Number  flags,
bool  bUsesMCS 
)
1470{
1471 char line[256];
1472 std::string xml;
1473
1474 if (flags & icEmbeddedProfileTrue)
1475 sprintf(line, "<ProfileFlags EmbeddedInFile=\"true\"");
1476 else
1477 sprintf(line, "<ProfileFlags EmbeddedInFile=\"false\"");
1478 xml += line;
1479
1480 if (flags & icUseWithEmbeddedDataOnly)
1481 sprintf(line, " UseWithEmbeddedDataOnly=\"true\"");
1482 else
1483 sprintf(line, " UseWithEmbeddedDataOnly=\"false\"");
1484 xml += line;
1485
1486 if (flags & icExtendedRangePCS) {
1487 sprintf(line, " ExtendedRangePCS=\"true\"");
1488 xml += line;
1489 }
1490
1492
1493 if (bUsesMCS) {
1494 if (flags & icMCSNeedsSubsetTrue)
1495 sprintf(line, " MCSNeedsSubset=\"true\"");
1496 else
1497 sprintf(line, " MCSNeedsSubset=\"false\"");
1498 xml += line;
1499
1500 otherFlags &= ~icMCSNeedsSubsetTrue;
1501 }
1502
1503 if (flags & otherFlags) {
1504 sprintf(line, " VendorFlags=\"%08x\"", flags & otherFlags);
1505 xml += line;
1506 }
1507
1508 xml += "/>\n";
1509
1510 return xml;
1511}
unsigned long icUInt32Number
Definition icProfileHeader.h:262
#define icEmbeddedProfileTrue
Definition icProfileHeader.h:221
#define icUseWithEmbeddedDataOnly
Definition icProfileHeader.h:223
#define icExtendedRangePCS
Definition icProfileHeader.h:227
#define icMCSNeedsSubsetTrue
Definition icProfileHeader.h:225

Referenced by CIccProfileXml::ToXmlWithBlanks().

+ Here is the caller graph for this function:

◆ icGetIlluminantValue()

icIlluminant icGetIlluminantValue ( const icChar str)
1222{
1223 if (!strcmp(str, "Illuminant Unknown"))
1224 return icIlluminantUnknown;
1225
1226 if (!strcmp(str, "Illuminant D50") || !strcmp(str, "D50"))
1227 return icIlluminantD50;
1228
1229 if (!strcmp(str, "Illuminant D65") || !strcmp(str, "D65"))
1230 return icIlluminantD65;
1231
1232 if (!strcmp(str, "Illuminant D93") || !strcmp(str, "D93"))
1233 return icIlluminantD93;
1234
1235 if (!strcmp(str, "Illuminant F2") || !strcmp(str, "F2"))
1236 return icIlluminantF2;
1237
1238 if (!strcmp(str, "Illuminant D55") || !strcmp(str, "D55"))
1239 return icIlluminantD55;
1240
1241 if (!strcmp(str, "Illuminant A") || !strcmp(str, "A"))
1242 return icIlluminantA;
1243
1244 if (!strcmp(str, "Illuminant EquiPowerE") || !strcmp(str, "Illuminant E") || !strcmp(str, "E"))
1246
1247 if (!strcmp(str, "Illuminant F8") || !strcmp(str, "F8"))
1248 return icIlluminantF8;
1249
1250 if (!strcmp(str, "Illuminant Black Body") || !strcmp(str, "Black Body"))
1251 return icIlluminantBlackBody;
1252
1253 if (!strcmp(str, "Illuminant Daylight") || !strcmp(str, "Daylight"))
1254 return icIlluminantDaylight;
1255
1256 if (!strcmp(str, "Illuminant B") || !strcmp(str, "B"))
1257 return icIlluminantB;
1258
1259 if (!strcmp(str, "Illuminant C") || !strcmp(str, "C"))
1260 return icIlluminantC;
1261
1262 if (!strcmp(str, "Illuminant F1") || !strcmp(str, "F1"))
1263 return icIlluminantF1;
1264
1265 if (!strcmp(str, "Illuminant F3") || !strcmp(str, "F3"))
1266 return icIlluminantF3;
1267
1268 if (!strcmp(str, "Illuminant F4") || !strcmp(str, "F4"))
1269 return icIlluminantF4;
1270
1271 if (!strcmp(str, "Illuminant F5") || !strcmp(str, "F5"))
1272 return icIlluminantF5;
1273
1274 if (!strcmp(str, "Illuminant F6") || !strcmp(str, "F6"))
1275 return icIlluminantF6;
1276
1277 if (!strcmp(str, "Illuminant F7") || !strcmp(str, "F7"))
1278 return icIlluminantF7;
1279
1280 if (!strcmp(str, "Illuminant F9") || !strcmp(str, "F9"))
1281 return icIlluminantF9;
1282
1283 if (!strcmp(str, "Illuminant F10") || !strcmp(str, "F10"))
1284 return icIlluminantF10;
1285
1286 if (!strcmp(str, "Illuminant F11") || !strcmp(str, "F11"))
1287 return icIlluminantF11;
1288
1289 if (!strcmp(str, "Illuminant F12") || !strcmp(str, "F12"))
1290 return icIlluminantF12;
1291
1292 return icIlluminantCustom;
1293}
@ icIlluminantF6
Definition icProfileHeader.h:1210
@ icIlluminantF8
Definition icProfileHeader.h:1199
@ icIlluminantF1
Definition icProfileHeader.h:1206
@ icIlluminantEquiPowerE
Definition icProfileHeader.h:1198
@ icIlluminantF11
Definition icProfileHeader.h:1214
@ icIlluminantF7
Definition icProfileHeader.h:1211
@ icIlluminantF2
Definition icProfileHeader.h:1195
@ icIlluminantF4
Definition icProfileHeader.h:1208
@ icIlluminantF3
Definition icProfileHeader.h:1207
@ icIlluminantD55
Definition icProfileHeader.h:1196
@ icIlluminantDaylight
Definition icProfileHeader.h:1203
@ icIlluminantB
Definition icProfileHeader.h:1204
@ icIlluminantA
Definition icProfileHeader.h:1197
@ icIlluminantF9
Definition icProfileHeader.h:1212
@ icIlluminantBlackBody
Definition icProfileHeader.h:1202
@ icIlluminantUnknown
Definition icProfileHeader.h:1191
@ icIlluminantD65
Definition icProfileHeader.h:1193
@ icIlluminantF10
Definition icProfileHeader.h:1213
@ icIlluminantD93
Definition icProfileHeader.h:1194
@ icIlluminantD50
Definition icProfileHeader.h:1192
@ icIlluminantC
Definition icProfileHeader.h:1205
@ icIlluminantF5
Definition icProfileHeader.h:1209
@ icIlluminantF12
Definition icProfileHeader.h:1215
#define icIlluminantCustom
Definition icProfileHeader.h:1218

References icIlluminantA, icIlluminantB, icIlluminantBlackBody, icIlluminantC, icIlluminantD50, icIlluminantD55, icIlluminantD65, icIlluminantD93, icIlluminantDaylight, icIlluminantEquiPowerE, icIlluminantF1, icIlluminantF10, icIlluminantF11, icIlluminantF12, icIlluminantF2, icIlluminantF3, icIlluminantF4, icIlluminantF5, icIlluminantF6, icIlluminantF7, icIlluminantF8, icIlluminantF9, and icIlluminantUnknown.

Referenced by CIccTagXmlMeasurement::ParseXml(), CIccTagXmlViewingConditions::ParseXml(), and CIccTagXmlSpectralViewingConditions::ParseXml().

+ Here is the caller graph for this function:

◆ icGetMeasurementValue()

icMeasurementUnitSig icGetMeasurementValue ( const icChar str)
1395{
1396 if (!strcmp(str, "Status A"))
1397 return icSigStatusA;
1398
1399 if (!strcmp(str, "Status E"))
1400 return icSigStatusE;
1401
1402 if (!strcmp(str, "Status I"))
1403 return icSigStatusI;
1404
1405 if (!strcmp(str, "Status T"))
1406 return icSigStatusT;
1407
1408 if (!strcmp(str, "Status M"))
1409 return icSigStatusM;
1410
1411 if (!strcmp(str, "DIN with no polarizing filter"))
1412 return icSigDN;
1413
1414 if (!strcmp(str, "DIN with polarizing filter"))
1415 return icSigDNP;
1416
1417 if (!strcmp(str, "Narrow band DIN with no polarizing filter"))
1418 return icSigDNN;
1419
1420 if (!strcmp(str, "Narrow band DIN with polarizing filter"))
1421 return icSigDNNP;
1422
1423 return icSigStatusA;
1424}
@ icSigStatusI
Definition icProfileHeader.h:1280
@ icSigStatusE
Definition icProfileHeader.h:1279
@ icSigDNNP
Definition icProfileHeader.h:1286
@ icSigStatusA
Definition icProfileHeader.h:1278
@ icSigDN
Definition icProfileHeader.h:1283
@ icSigStatusT
Definition icProfileHeader.h:1281
@ icSigDNP
Definition icProfileHeader.h:1284
@ icSigDNN
Definition icProfileHeader.h:1285
@ icSigStatusM
Definition icProfileHeader.h:1282

References icSigDN, icSigDNN, icSigDNNP, icSigDNP, icSigStatusA, icSigStatusE, icSigStatusI, icSigStatusM, and icSigStatusT.

Referenced by CIccTagXmlResponseCurveSet16::ParseXml().

+ Here is the caller graph for this function:

◆ icGetNamedMeasurementFlareValue()

icMeasurementFlare icGetNamedMeasurementFlareValue ( const icChar str)
1208{
1209 if (!strcmp(str, "Flare 0"))
1210 return icFlare0;
1211
1212 if (!strcmp(str, "Flare 100"))
1213 return icFlare100;
1214
1215 if (!strcmp(str, "Max Flare"))
1216 return icMaxEnumFlare;
1217
1218 return icFlare0;
1219}
@ icFlare100
Definition icProfileHeader.h:1119
@ icFlare0
Definition icProfileHeader.h:1118
#define icMaxEnumFlare
Definition icProfileHeader.h:1123

References icFlare0, and icFlare100.

Referenced by CIccTagXmlMeasurement::ParseXml().

+ Here is the caller graph for this function:

◆ icGetNamedStandardObserverValue()

icStandardObserver icGetNamedStandardObserverValue ( const icChar str)
1176{
1177 if (!strcmp(str, "Unknown observer"))
1178 return icStdObsUnknown;
1179
1180 if (!strcmp(str, "CIE 1931 (two degree) standard observer"))
1182
1183 if (!strcmp(str, "CIE 1964 (ten degree) standard observer"))
1184 return icStdObs1964TenDegrees;
1185
1186 return icStdObsCustom;
1187}
#define icStdObsCustom
Definition icProfileHeader.h:1181
@ icStdObsUnknown
Definition icProfileHeader.h:1176
@ icStdObs1964TenDegrees
Definition icProfileHeader.h:1178
@ icStdObs1931TwoDegrees
Definition icProfileHeader.h:1177

References icStdObs1931TwoDegrees, icStdObs1964TenDegrees, and icStdObsUnknown.

Referenced by CIccTagXmlMeasurement::ParseXml(), and CIccTagXmlSpectralViewingConditions::ParseXml().

+ Here is the caller graph for this function:

◆ icGetPadSpace()

const std::string icGetPadSpace ( double  value)
1514{
1515 std::string space = "";
1516 if ( value >=0 && value < 10)
1517 space = " ";
1518 if ( value >=10 && value < 100)
1519 space = " ";
1520 if ( value >=100 && value < 1000 )
1521 space = " ";
1522
1523 return space;
1524}

◆ icGetRenderingIntentValue()

icRenderingIntent icGetRenderingIntentValue ( const icChar szRenderingIntent)
1128{
1129 if (!strcmp(szRenderingIntent, "Perceptual"))
1130 return icPerceptual;
1131 else if (!strcmp(szRenderingIntent, "Media-relative colorimetric"))
1133 else if (!strcmp(szRenderingIntent, "Saturation"))
1134 return icSaturation;
1135 else if (!strcmp(szRenderingIntent, "ICC-absolute colorimetric"))
1137
1138 return icPerceptual;
1139}
@ icPerceptual
Definition icProfileHeader.h:1143
@ icRelativeColorimetric
Definition icProfileHeader.h:1144
@ icAbsoluteColorimetric
Definition icProfileHeader.h:1147
@ icSaturation
Definition icProfileHeader.h:1146

References icAbsoluteColorimetric, icPerceptual, icRelativeColorimetric, and icSaturation.

◆ icGetStandardObserverName()

const icChar * icGetStandardObserverName ( icStandardObserver  str)
1296{
1297 switch (str) {
1298 case icStdObsUnknown:
1299 return "Unknown Observer";
1300
1302 return "CIE 1931 standard colorimetric observer";
1303
1305 return "CIE 1964 standard colorimetric observer";
1306
1307 default:
1308 return "Unknown Observer";
1309 }
1310}

References icStdObs1931TwoDegrees, icStdObs1964TenDegrees, and icStdObsUnknown.

Referenced by CIccTagXmlMeasurement::ToXml().

+ Here is the caller graph for this function:

◆ icGetTagNameSig()

icTagSignature icGetTagNameSig ( const icChar szName)
1170{
1171 return CIccTagCreator::GetTagNameSig(szName);
1172}
static icTagSignature GetTagNameSig(const icChar *szName)
Definition IccTagFactory.h:306

References CIccTagCreator::GetTagNameSig().

Referenced by CIccProfileXml::ParseTag(), and CIccTagXmlStruct::ParseTag().

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

◆ icGetTagSigName()

const icChar * icGetTagSigName ( icTagSignature  tagTypeSig)
1159{
1160 const icChar *rv = CIccTagCreator::GetTagSigName(tagTypeSig);
1161
1162 // if the tag signature is not found, it is a custom type.
1163 if (!rv)
1164 return "PrivateTag";
1165
1166 return rv;
1167}
char icChar
Definition IccDefs.h:110
static const icChar * GetTagSigName(icTagSignature tagTypeSig)
Definition IccTagFactory.h:292

References CIccTagCreator::GetTagSigName().

+ Here is the call graph for this function:

◆ icGetTagSigTypeName()

const icChar * icGetTagSigTypeName ( icTagTypeSignature  tagTypeSig)
1142{
1143 const icChar *rv = CIccTagCreator::GetTagTypeSigName(tagTypeSig);
1144
1145 // if the tag signature is not found, it is a custom type.
1146 if (!rv)
1147 return "PrivateType";
1148
1149 return rv;
1150}
static const icChar * GetTagTypeSigName(icTagTypeSignature tagTypeSig)
Definition IccTagFactory.h:322

References CIccTagCreator::GetTagTypeSigName().

Referenced by icProfDescToXml(), CIccMpeXmlTintArray::ToXml(), CIccTagXmlStruct::ToXml(), CIccTagXmlArray::ToXml(), and CIccProfileXml::ToXmlWithBlanks().

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

◆ icGetTypeNameTagSig()

icTagTypeSignature icGetTypeNameTagSig ( const icChar szTagType)
1153{
1154 return CIccTagCreator::GetTagTypeNameSig(szTagType);
1155
1156}
static icTagTypeSignature GetTagTypeNameSig(const icChar *szName)
Definition IccTagFactory.h:335

References CIccTagCreator::GetTagTypeNameSig().

Referenced by icXmlParseProfDesc(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), and CIccTagXmlArray::ParseXml().

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

◆ icIsNumChar()

static bool icIsNumChar ( char  c)
inlinestatic
913{
914 if ((c>='0' && c<='9') || c=='.' || c=='+' || c=='-' || c=='e' || c == 'n' || c == 'a')
915 return true;
916 return false;
917}

Referenced by CIccXmlArrayType< T, Tsig >::ParseText(), CIccXmlArrayType< T, Tsig >::ParseTextCount(), and CIccXmlArrayType< T, Tsig >::ParseTextCountNum().

+ Here is the caller graph for this function:

◆ icUtf16ToUtf8()

const char * icUtf16ToUtf8 ( std::string &  buf,
const icUInt16Number szSrc,
int  sizeSrc 
)
342{
343 if (!sizeSrc) {
344 sizeSrc = (int)CIccUTF16String::WStrlen(szSrc);
345 }
346
347 int n = sizeSrc*4;
348
349 if (n) {
350 char *szBuf = (char *)malloc(n+1);
351 char *szDest = szBuf;
352 icConvertUTF16toUTF8(&szSrc, &szSrc[sizeSrc], (UTF8**)&szDest, (UTF8*)&szDest[n+1], lenientConversion);
353 *szDest= '\0';
354
355 buf = szBuf;
356 free(szBuf);
357 }
358 else {
359 buf.clear();
360 }
361
362 return buf.c_str();
363}
unsigned char UTF8
Definition IccConvertUTF.h:108
@ lenientConversion
Definition IccConvertUTF.h:127
icUtfConversionResult icConvertUTF16toUTF8(const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, icUtfConversionFlags flags)
Definition IccConvertUTF.cpp:299
static size_t WStrlen(const icUInt16Number *uzStr)
Definition IccUtilXml.cpp:162

References icConvertUTF16toUTF8(), lenientConversion, and CIccUTF16String::WStrlen().

Referenced by CIccUTF16String::ToUtf8(), CIccTagXmlTextDescription::ToXml(), CIccTagXmlMultiLocalizedUnicode::ToXml(), CIccTagXmlProfileSequenceId::ToXml(), and CIccTagXmlDict::ToXml().

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

◆ icUtf8ToAnsi()

const char * icUtf8ToAnsi ( std::string &  buf,
const char *  szSrc 
)
398{
399#ifdef WIN32
400 size_t len = strlen(szSrc)+1;
401 wchar_t *szUnicodeBuf = (wchar_t*)malloc(len*sizeof(icUInt16Number)*2);
402 char *szBuf = (char*)malloc(len*2);
403
404 size_t n;
405
406 n=MultiByteToWideChar(CP_UTF8, 0, szSrc, (int)len, szUnicodeBuf, (int)len*2);
407 szUnicodeBuf[n] = '\0';
408
409 n = WideCharToMultiByte(CP_ACP, 0, (const wchar_t*)szUnicodeBuf, (int)n, szBuf, (int)len*2, "?", NULL);
410 szBuf[n] = '\0';
411
412 buf = szBuf;
413
414 free(szBuf);
415 free(szUnicodeBuf);
416#else
417 buf = szSrc;
418#endif
419 return buf.c_str();
420}

Referenced by icXmlParseTextString(), CIccTagXmlTextDescription::ParseXml(), CIccTagXmlNamedColor2::ParseXml(), and CIccTagXmlColorantTable::ParseXml().

+ Here is the caller graph for this function:

◆ icUtf8ToUtf16()

const unsigned short * icUtf8ToUtf16 ( CIccUTF16String buf,
const char *  szSrc,
int  sizeSrc 
)
366{
367 buf.FromUtf8(szSrc, sizeSrc);
368
369 return buf.c_str();
370}
bool FromUtf8(const char *szStr, size_t sizeSrc=0)
Definition IccUtilXml.cpp:223
const icUInt16Number * c_str()
Definition IccUtilXml.h:93

References CIccUTF16String::c_str(), and CIccUTF16String::FromUtf8().

+ Here is the call graph for this function:

◆ icXmlAttrValue() [1/2]

const char * icXmlAttrValue ( xmlAttr *  attr,
const char *  szDefault 
)

◆ icXmlAttrValue() [2/2]

const char * icXmlAttrValue ( xmlNode *  pNode,
const char *  szName,
const char *  szDefault 
)
581{
582 xmlAttr *attr = icXmlFindAttr(pNode, szName);
583 if (attr) {
584 return icXmlAttrValue(attr, szDefault);
585 }
586 return szDefault;
587}

References icXmlAttrValue(), and icXmlFindAttr().

Referenced by icCLutFromXml(), icXmlParseTextString(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccTagXmlCurve::ParseXml(), CIccFormulaCurveSegmentXml::ParseXml(), CIccSampledCurveSegmentXml::ParseXml(), CIccSinglSampledeCurveXml::ParseXml(), CIccMpeXmlUnknown::ParseXml(), CIccSegmentedCurveXml::ParseXml(), CIccMpeXmlCurveSet::ParseXml(), CIccMpeXmlTintArray::ParseXml(), CIccXmlToneMapFunc::ParseXml(), CIccMpeXmlToneMap::ParseXml(), CIccMpeXmlMatrix::ParseXml(), CIccMpeXmlCLUT::ParseXml(), CIccMpeXmlExtCLUT::ParseXml(), CIccMpeXmlBAcs::ParseXml(), CIccMpeXmlEAcs::ParseXml(), CIccMpeXmlJabToXYZ::ParseXml(), CIccMpeXmlXYZToJab::ParseXml(), CIccMpeXmlCalculator::ParseXml(), CIccMpeXmlEmissionMatrix::ParseXml(), CIccMpeXmlInvEmissionMatrix::ParseXml(), CIccMpeXmlEmissionCLUT::ParseXml(), CIccMpeXmlReflectanceCLUT::ParseXml(), CIccMpeXmlEmissionObserver::ParseXml(), CIccMpeXmlReflectanceObserver::ParseXml(), CIccTagXmlUnknown::ParseXml(), CIccTagXmlTextDescription::ParseXml(), CIccTagXmlNamedColor2::ParseXml(), CIccTagXmlFloatNum< T, A, Tsig >::ParseXml(), CIccTagXmlTagData::ParseXml(), CIccTagXmlColorantTable::ParseXml(), CIccTagXmlSpectralDataInfo::ParseXml(), CIccTagXmlResponseCurveSet16::ParseXml(), CIccTagXmlParametricCurve::ParseXml(), CIccTagXmlProfileSequenceId::ParseXml(), CIccTagXmlDict::ParseXml(), CIccTagXmlGamutBoundaryDesc::ParseXml(), CIccTagXmlEmbeddedHeightImage::ParseXml(), and CIccTagXmlEmbeddedNormalImage::ParseXml().

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

◆ icXmlDumpHexData()

icUInt32Number icXmlDumpHexData ( std::string &  xml,
std::string  blanks,
void *  pBuf,
icUInt32Number  nBufSize 
)
649{
650 icUInt8Number *m_ptr = (icUInt8Number *)pBuf;
651 char buf[15];
653
654 for (i=0; i<nBufSize; i++, m_ptr++) {
655 if (!(i%32)) {
656 if (i)
657 xml += "\n";
658 xml += blanks;
659 }
660 sprintf(buf, "%02x", *m_ptr);
661 xml += buf;
662 }
663 if (i) {
664 xml += "\n";
665 }
666 return i;
667}
unsigned char icUInt8Number
Definition icProfileHeader.h:250

Referenced by icXmlDumpTextData(), CIccMpeXmlUnknown::ToXml(), CIccMpeXmlBAcs::ToXml(), CIccMpeXmlEAcs::ToXml(), CIccTagXmlUnknown::ToXml(), CIccTagXmlZipUtf8Text::ToXml(), CIccTagXmlZipXml::ToXml(), CIccTagXmlTagData::ToXml(), CIccTagXmlEmbeddedHeightImage::ToXml(), and CIccTagXmlEmbeddedNormalImage::ToXml().

+ Here is the caller graph for this function:

◆ icXmlFindAttr()

xmlAttr * icXmlFindAttr ( xmlNode *  pNode,
const char *  szAttrName 
)
670{
671 if (!pNode) return NULL;
672
673 xmlAttr *attr;
674
675 for (attr = pNode->properties; attr; attr = attr->next) {
676 if (attr->type != XML_ATTRIBUTE_NODE)
677 continue;
678
679 if (!icXmlStrCmp(attr->name, szAttrName)) {
680 return attr;
681 }
682 }
683
684 return NULL;
685}
#define icXmlStrCmp(x, y)
Definition IccUtilXml.h:134

Referenced by icCLutFromXml(), icGetDeviceAttrValue(), icMatrixFromXml(), icMBBFromXml(), icXmlAttrValue(), icXmlParseColorAppearanceParams(), CIccProfileXml::ParseBasic(), CIccTagXmlMultiProcessElement::ParseElement(), CIccMpeXmlCalculator::ParseImport(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccFormulaCurveSegmentXml::ParseXml(), CIccSampledCurveSegmentXml::ParseXml(), CIccSampledCalculatorCurveXml::ParseXml(), CIccSinglSampledeCurveXml::ParseXml(), CIccMpeXmlTintArray::ParseXml(), CIccXmlToneMapFunc::ParseXml(), CIccTagXmlNamedColor2::ParseXml(), CIccTagXmlXYZ::ParseXml(), CIccTagXmlChromaticity::ParseXml(), CIccTagXmlCicp::ParseXml(), CIccTagXmlSparseMatrixArray::ParseXml(), CIccTagXmlMeasurement::ParseXml(), CIccTagXmlMultiLocalizedUnicode::ParseXml(), CIccTagXmlColorantTable::ParseXml(), CIccTagXmlViewingConditions::ParseXml(), CIccTagXmlSpectralViewingConditions::ParseXml(), CIccTagXmlParametricCurve::ParseXml(), CIccTagXmlMultiProcessElement::ParseXml(), CIccTagXmlProfileSequenceId::ParseXml(), CIccTagXmlDict::ParseXml(), and CIccTagXmlArray::ParseXml().

+ Here is the caller graph for this function:

◆ icXmlFindNode()

xmlNode * icXmlFindNode ( xmlNode *  pNode,
const char *  szNodeName 
)
688{
689 if (!pNode) return NULL;
690
691 for (; pNode; pNode = pNode->next) {
692 if (pNode->type != XML_ELEMENT_NODE)
693 continue;
694
695 if (!icXmlStrCmp(pNode->name, szNodeName)) {
696 return pNode;
697 }
698 }
699
700 return NULL;
701}

Referenced by icCLutFromXml(), icMBBFromXml(), icXmlParseColorAppearanceParams(), icXmlParseProfDesc(), CIccProfileXml::ParseBasic(), CIccMpeXmlCalculator::ParseImport(), CIccTagXmlCurve::ParseXml(), CIccSampledCalculatorCurveXml::ParseXml(), CIccMpeXmlToneMap::ParseXml(), CIccMpeXmlMatrix::ParseXml(), CIccMpeXmlJabToXYZ::ParseXml(), CIccMpeXmlXYZToJab::ParseXml(), CIccMpeXmlCalculator::ParseXml(), CIccMpeXmlEmissionMatrix::ParseXml(), CIccMpeXmlInvEmissionMatrix::ParseXml(), CIccMpeXmlEmissionCLUT::ParseXml(), CIccMpeXmlReflectanceCLUT::ParseXml(), CIccMpeXmlEmissionObserver::ParseXml(), CIccMpeXmlReflectanceObserver::ParseXml(), CIccProfileXml::ParseXml(), CIccTagXmlUnknown::ParseXml(), CIccTagXmlTextDescription::ParseXml(), CIccTagXmlSignature::ParseXml(), CIccTagXmlNamedColor2::ParseXml(), CIccTagXmlChromaticity::ParseXml(), CIccTagXmlCicp::ParseXml(), CIccTagXmlSparseMatrixArray::ParseXml(), CIccTagXmlFixedNum< T, Tsig >::ParseXml(), CIccTagXmlNum< T, A, Tsig >::ParseXml(), CIccTagXmlFloatNum< T, A, Tsig >::ParseXml(), CIccTagXmlMeasurement::ParseXml(), CIccTagXmlMultiLocalizedUnicode::ParseXml(), CIccTagXmlTagData::ParseXml(), CIccTagXmlDateTime::ParseXml(), CIccTagXmlColorantOrder::ParseXml(), CIccTagXmlColorantTable::ParseXml(), CIccTagXmlViewingConditions::ParseXml(), CIccTagXmlSpectralDataInfo::ParseXml(), CIccTagXmlSpectralViewingConditions::ParseXml(), CIccTagXmlProfileSeqDesc::ParseXml(), CIccTagXmlResponseCurveSet16::ParseXml(), CIccTagXmlParametricCurve::ParseXml(), CIccTagXmlSegmentedCurve::ParseXml(), CIccTagXmlMultiProcessElement::ParseXml(), CIccTagXmlProfileSequenceId::ParseXml(), CIccTagXmlDict::ParseXml(), CIccTagXmlStruct::ParseXml(), CIccTagXmlArray::ParseXml(), CIccTagXmlGamutBoundaryDesc::ParseXml(), CIccTagXmlEmbeddedHeightImage::ParseXml(), CIccTagXmlEmbeddedNormalImage::ParseXml(), and CIccTagXmlEmbeddedProfile::ParseXml().

◆ icXmlGetChildSigVal()

icUInt32Number icXmlGetChildSigVal ( xmlNode *  pNode)
590{
591 if (!pNode || !pNode->children || !pNode->children->content)
592 return 0;
593
594 return icGetSigVal((const char*)pNode->children->content);
595}
ICCPROFLIB_API icUInt32Number icGetSigVal(const icChar *pBuf)
Definition IccUtil.cpp:1258

References icGetSigVal().

Referenced by CIccProfileXml::ParseBasic().

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

◆ icXmlGetHexData()

icUInt32Number icXmlGetHexData ( void *  pBuf,
const char *  szText,
icUInt32Number  nBufSize 
)
610{
611 unsigned char *pDest = (unsigned char*)pBuf;
612 icUInt32Number rv =0;
613
614 while(*szText && rv<nBufSize) {
615 int c1=hexValue(szText[0]);
616 int c2=hexValue(szText[1]);
617 if (c1>=0 && c2>=0) {
618 *pDest = c1*16+ c2;
619 pDest++;
620 szText +=2;
621 rv++;
622 }
623 else {
624 szText++;
625 }
626 }
627 return rv;
628}
static int hexValue(char c)
Definition IccUtilXml.cpp:597

References hexValue().

Referenced by icXmlParseTextString(), CIccProfileXml::ParseBasic(), CIccMpeXmlUnknown::ParseXml(), CIccMpeXmlBAcs::ParseXml(), CIccMpeXmlEAcs::ParseXml(), CIccTagXmlUnknown::ParseXml(), CIccTagXmlZipUtf8Text::ParseXml(), CIccTagXmlZipXml::ParseXml(), CIccTagXmlTextDescription::ParseXml(), CIccTagXmlTagData::ParseXml(), CIccTagXmlProfileSequenceId::ParseXml(), CIccTagXmlEmbeddedHeightImage::ParseXml(), and CIccTagXmlEmbeddedNormalImage::ParseXml().

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

◆ icXmlGetHexDataSize()

icUInt32Number icXmlGetHexDataSize ( const char *  szText)
631{
632 icUInt32Number rv =0;
633
634 while(*szText) {
635 int c1=hexValue(szText[0]);
636 int c2=hexValue(szText[1]);
637 if (c1>=0 && c2>=0) {
638 szText +=2;
639 rv++;
640 }
641 else {
642 szText++;
643 }
644 }
645 return rv;
646}

References hexValue().

Referenced by icXmlParseTextString(), CIccMpeXmlUnknown::ParseXml(), CIccMpeXmlBAcs::ParseXml(), CIccMpeXmlEAcs::ParseXml(), CIccTagXmlUnknown::ParseXml(), CIccTagXmlZipUtf8Text::ParseXml(), CIccTagXmlZipXml::ParseXml(), CIccTagXmlTagData::ParseXml(), CIccTagXmlEmbeddedHeightImage::ParseXml(), and CIccTagXmlEmbeddedNormalImage::ParseXml().

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

◆ icXmlNodeCount()

icUInt32Number icXmlNodeCount ( xmlNode *  pNode,
const char *  szNodeName 
)
704{
705 icUInt32Number rv = 0;
706 for (; pNode; pNode = pNode->next) {
707 if (pNode->type == XML_ELEMENT_NODE &&
708 !icXmlStrCmp(pNode->name, szNodeName)) {
709 rv++;
710 }
711 }
712 return rv;
713}

Referenced by CIccXmlArrayType< T, Tsig >::ParseArray(), CIccXmlArrayType< T, Tsig >::ParseArray(), CIccTagXmlXYZ::ParseXml(), CIccTagXmlChromaticity::ParseXml(), CIccTagXmlColorantOrder::ParseXml(), CIccTagXmlColorantTable::ParseXml(), and CIccTagXmlResponseCurveSet16::ParseXml().

+ Here is the caller graph for this function:

◆ icXmlNodeCount2()

icUInt32Number icXmlNodeCount2 ( xmlNode *  pNode,
const char *  szNodeName1,
const char *  szNodeName2 
)
716{
717 icUInt32Number rv = 0;
718 for (; pNode; pNode = pNode->next) {
719 if (pNode->type == XML_ELEMENT_NODE &&
720 (!icXmlStrCmp(pNode->name, szNodeName1) || !icXmlStrCmp(pNode->name, szNodeName2))) {
721 rv++;
722 }
723 }
724 return rv;
725}

◆ icXmlNodeCount3()

icUInt32Number icXmlNodeCount3 ( xmlNode *  pNode,
const char *  szNodeName1,
const char *  szNodeName2,
const char *  szNodeName3 
)
728{
729 icUInt32Number rv = 0;
730 for (; pNode; pNode = pNode->next) {
731 if (pNode->type == XML_ELEMENT_NODE &&
732 (!icXmlStrCmp(pNode->name, szNodeName1) || !icXmlStrCmp(pNode->name, szNodeName2) || !icXmlStrCmp(pNode->name, szNodeName3))) {
733 rv++;
734 }
735 }
736 return rv;
737}

Referenced by CIccTagXmlNamedColor2::ParseXml().

+ Here is the caller graph for this function:

◆ icXmlStrToFloat()

icFloatNumber icXmlStrToFloat ( const xmlChar *  szStr)
560{
561 float f=0.0;
562 sscanf((const char*)szStr, "%f", &f);
563
564 return (icFloatNumber)f;
565}
float icFloatNumber
Definition IccDefs.h:101

◆ icXmlStrToSig()

icSignature icXmlStrToSig ( const char *  szStr)
568{
569 return icGetSigVal(szStr);
570}

References icGetSigVal().

Referenced by icXmlParseProfDesc(), CIccMpeXmlUnknown::ParseXml(), CIccMpeXmlBAcs::ParseXml(), and CIccMpeXmlEAcs::ParseXml().

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