IccMAX 2.1.27
Color Profile Tools
Loading...
Searching...
No Matches
CIccSampledCurveSegmentXml Class Reference
+ Inheritance diagram for CIccSampledCurveSegmentXml:
+ Collaboration diagram for CIccSampledCurveSegmentXml:

Public Member Functions

 CIccSampledCurveSegmentXml (icFloatNumber start, icFloatNumber end)
 
virtual icFloatNumber Apply (icFloatNumber v) const
 
virtual bool Begin (CIccCurveSegment *pPrevSeg)
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
icFloatNumber EndPoint ()
 
virtual const icCharGetClassName () const
 
virtual icFloatNumberGetSamples ()
 
virtual icUInt32Number GetSize ()
 
virtual icCurveSegSignature GetType () const
 
virtual CIccCurveSegmentNewCopy () const
 
bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
virtual bool SetSize (icUInt32Number nSize, bool bZeroAlloc=true)
 
icFloatNumber StartPoint ()
 
bool ToXml (std::string &xml, std::string blanks)
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 
virtual bool Write (CIccIO *pIO)
 

Static Public Member Functions

static CIccCurveSegmentCreate (icCurveSegSignature sig, icFloatNumber start, icFloatNumber end)
 

Protected Attributes

icFloatNumber m_endPoint
 
icFloatNumber m_last
 
icUInt32Number m_nCount
 
icUInt32Number m_nReserved
 
icFloatNumberm_pSamples
 
icFloatNumber m_range
 
icFloatNumber m_startPoint
 

Detailed Description

Constructor & Destructor Documentation

◆ CIccSampledCurveSegmentXml()

CIccSampledCurveSegmentXml::CIccSampledCurveSegmentXml ( icFloatNumber  start,
icFloatNumber  end 
)
inline
261: CIccSampledCurveSegment(start, end) {}
Definition IccMpeBasic.h:172

References CIccSampledCurveSegment::CIccSampledCurveSegment().

Referenced by CIccSegmentedCurveXml::ParseXml().

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

Member Function Documentation

◆ Apply()

icFloatNumber CIccSampledCurveSegment::Apply ( icFloatNumber  v) const
virtualinherited

Name: CIccSampledCurveSegment::Apply

Purpose:

Args:

Return:

Implements CIccCurveSegment.

1207{
1208 if (v<m_startPoint)
1209 v=m_startPoint;
1210 else if (v>m_endPoint)
1211 v=m_endPoint;
1212
1214 icUInt32Number index = (icUInt32Number) pos;
1215 icFloatNumber remainder = pos - (icFloatNumber)index;
1216
1217 if (remainder==0.0)
1218 return m_pSamples[index];
1219
1220 return (icFloatNumber)((1.0-remainder)*m_pSamples[index] + remainder*m_pSamples[index+1]);
1221}
unsigned long icUInt32Number
Definition icProfileHeader.h:262
float icFloatNumber
Definition IccDefs.h:101
icFloatNumber m_startPoint
Definition IccMpeBasic.h:119
icFloatNumber m_endPoint
Definition IccMpeBasic.h:120
icFloatNumber * m_pSamples
Definition IccMpeBasic.h:199
icFloatNumber m_last
Definition IccMpeBasic.h:202
icFloatNumber m_range
Definition IccMpeBasic.h:201

References CIccCurveSegment::m_endPoint, CIccSampledCurveSegment::m_last, CIccSampledCurveSegment::m_pSamples, CIccSampledCurveSegment::m_range, and CIccCurveSegment::m_startPoint.

◆ Begin()

bool CIccSampledCurveSegment::Begin ( CIccCurveSegment pPrevSeg = NULL)
virtualinherited

Name: CIccSampledCurveSegment::Begin

Purpose:

Args:

Return:

Implements CIccCurveSegment.

1177{
1178 if (m_nCount<2)
1179 return false;
1180
1182 m_last = (icFloatNumber)(m_nCount - 1);
1183
1184 if (m_endPoint-m_startPoint == 0.0)
1185 return false;
1186
1187 if (!pPrevSeg)
1188 return false;
1189
1190 //Set up interpolation from Application of last segment
1191 m_pSamples[0] = pPrevSeg->Apply(m_startPoint);
1192
1193 return true;
1194}
virtual icFloatNumber Apply(icFloatNumber v) const =0
icUInt32Number m_nCount
Definition IccMpeBasic.h:198

References CIccCurveSegment::Apply(), CIccCurveSegment::m_endPoint, CIccSampledCurveSegment::m_last, CIccSampledCurveSegment::m_nCount, CIccSampledCurveSegment::m_pSamples, CIccSampledCurveSegment::m_range, and CIccCurveSegment::m_startPoint.

+ Here is the call graph for this function:

◆ Create()

CIccCurveSegment * CIccCurveSegment::Create ( icCurveSegSignature  sig,
icFloatNumber  start,
icFloatNumber  end 
)
staticinherited

Name: CIccCurveSegment::Create

Purpose:

Args:

Return:

2518{
2519 switch(sig) {
2521 return new CIccFormulaCurveSegment(start, end);
2523 return new CIccSampledCurveSegment(start, end);
2524 default:
2525 return NULL;
2526 }
2527
2528}
@ icSigSampledCurveSeg
Definition icProfileHeader.h:1047
@ icSigFormulaCurveSeg
Definition icProfileHeader.h:1046
Definition IccMpeBasic.h:133

References CIccFormulaCurveSegment::CIccFormulaCurveSegment(), CIccSampledCurveSegment::CIccSampledCurveSegment(), icSigFormulaCurveSeg, and icSigSampledCurveSeg.

Referenced by CIccSegmentedCurve::Read().

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

◆ Describe()

void CIccSampledCurveSegment::Describe ( std::string &  sDescription,
int  nVerboseness 
)
virtualinherited

Name: CIccSampledCurveSegment::Describe

Purpose:

Args:

Return:

Implements CIccCurveSegment.

1018{
1019 icChar buf[128];
1020
1021 if (m_nCount<2) {
1022 sDescription += "Empty Segment [";
1024 sDescription += "-Infinity, ";
1025 else {
1026 sprintf(buf, "%.8f, ", m_startPoint);
1027 sDescription += buf;
1028 }
1030 sDescription += "+Infinity";
1031 else {
1032 sprintf(buf, "%.8f", m_endPoint);
1033 sDescription += buf;
1034 }
1035
1036 sprintf(buf, "]\n");
1037 sDescription += buf;
1038 }
1039 else {
1040 sDescription += "Sampled Segment [";
1042 sDescription += "-Infinity, ";
1043 else {
1044 sprintf(buf, "%.8f, ", m_startPoint);
1045 sDescription += buf;
1046 }
1048 sDescription += "+Infinity";
1049 else {
1050 sprintf(buf, "%.8f", m_endPoint);
1051 sDescription += buf;
1052 }
1053 sprintf(buf, "]\n");
1054 sDescription += buf;
1055 sDescription += "IN OUT\n";
1056
1058
1061
1062 for (i=1; i<m_nCount; i++) {
1063 sprintf(buf, "%.8f %.8f\n", m_startPoint + (icFloatNumber)i*range/last, m_pSamples[i]);
1064 sDescription += buf;
1065 }
1066 }
1067 sDescription += "\n";
1068}
#define icMinFloat32Number
Definition icProfileHeader.h:318
#define icMaxFloat32Number
Definition icProfileHeader.h:317
char icChar
Definition IccDefs.h:110

References CIccCurveSegment::m_endPoint, CIccSampledCurveSegment::m_nCount, CIccSampledCurveSegment::m_pSamples, and CIccCurveSegment::m_startPoint.

◆ EndPoint()

icFloatNumber CIccCurveSegment::EndPoint ( )
inlineinherited
116{ return m_endPoint;}

References CIccCurveSegment::m_endPoint.

Referenced by CIccSegmentedCurve::Apply(), and CIccSegmentedCurve::Insert().

+ Here is the caller graph for this function:

◆ GetClassName()

virtual const icChar * CIccSampledCurveSegment::GetClassName ( ) const
inlinevirtualinherited

Implements CIccCurveSegment.

181{ return "CIccSampledCurveSegment"; }

◆ GetSamples()

virtual icFloatNumber * CIccSampledCurveSegment::GetSamples ( )
inlinevirtualinherited
186{ return m_pSamples; }

References CIccSampledCurveSegment::m_pSamples.

◆ GetSize()

virtual icUInt32Number CIccSampledCurveSegment::GetSize ( )
inlinevirtualinherited
184{ return m_nCount; }

References CIccSampledCurveSegment::m_nCount.

◆ GetType()

virtual icCurveSegSignature CIccSampledCurveSegment::GetType ( ) const
inlinevirtualinherited

Implements CIccCurveSegment.

180{ return icSigSampledCurveSeg; }

References icSigSampledCurveSeg.

Referenced by CIccSampledCurveSegment::Write().

+ Here is the caller graph for this function:

◆ NewCopy()

virtual CIccCurveSegment * CIccSampledCurveSegment::NewCopy ( ) const
inlinevirtualinherited

Implements CIccCurveSegment.

177{ return new CIccSampledCurveSegment(*this);}

References CIccSampledCurveSegment::CIccSampledCurveSegment().

+ Here is the call graph for this function:

◆ ParseXml()

bool CIccSampledCurveSegmentXml::ParseXml ( xmlNode *  pNode,
std::string &  parseStr 
)
287{
288 const char *filename = icXmlAttrValue(pNode, "Filename");
289
290 // file exists
291 if (filename[0]) {
292 CIccIO *file = IccOpenFileIO(filename, "rb");
293 if (!file){
294 parseStr += "Error! - File '";
295 parseStr += filename;
296 parseStr +="' not found.\n";
297 delete file;
298 return false;
299 }
300
301 const char *format = icXmlAttrValue(pNode, "Format");
302
303 // format is text
304 if (!strcmp(format, "text")) {
305 icUInt32Number num = file->GetLength();
306 char *buf = new char[num];
307
308 if (!buf) {
309 perror("Memory Error");
310 parseStr += "'";
311 parseStr += filename;
312 parseStr += "' may not be a valid text file.\n";
313 delete file;
314 return false;
315 }
316
317 if (file->Read8(buf, num) !=num) {
318 perror("Read-File Error");
319 parseStr += "'";
320 parseStr += filename;
321 parseStr += "' may not be a valid text file.\n";
322 delete[] buf;
323 delete file;
324 return false;
325 }
326
327 CIccFloatArray data;
328
329 //if (!data.ParseTextArray(buf)) {
330 if (!data.ParseTextArrayNum(buf, num, parseStr)){
331 parseStr += "File '";
332 parseStr += filename;
333 parseStr += "' is not a valid text file.\n";
334 SetSize(0);
335 delete[] buf;
336 delete file;
337 return false;
338 }
339
340 else {
341 SetSize(data.GetSize());
342 icFloatNumber *src = data.GetBuf();
344
346 for (i=0; i<data.GetSize(); i++) {
347 *dst = *src;
348 dst++;
349 src++;
350 }
351 }
352
353 delete[] buf;
354 delete file;
355 return true;
356
357 }
358 // format is binary
359 else if (!strcmp(format, "binary")) {
360 const char *order = icXmlAttrValue(pNode, "Endian");
361 bool little_endian = !strcmp(order, "little");
362
364 xmlAttr *attr = icXmlFindAttr(pNode, "StorageType");
365 if (attr) {
366 storageType = (icUInt16Number)atoi(icXmlAttrValue(attr));
367 }
368
369 if (storageType == icValueTypeUInt8){
370 icUInt32Number num = file->GetLength();
371 icUInt8Number value;
372
373 SetSize(num);
376 for (i=0; i<num; i++) {
377 if (!file->Read8(&value)) {
378 perror("Read-File Error");
379 parseStr += "'";
380 parseStr += filename;
381 parseStr += "' may not be a valid binary file.\n";
382 delete file;
383 return false;
384 }
385 *dst++ = (icFloatNumber)value / 255.0f;
386 }
387 delete file;
388 return true;
389 }
390 else if (storageType == icValueTypeUInt16){
391 icUInt32Number num = file->GetLength() / sizeof(icUInt16Number);
392 icUInt16Number value;
393 icUInt8Number *m_ptr = (icUInt8Number*)&value;
394
395 SetSize(num);
398 for (i=0; i<num; i++) {
399 if (!file->Read16(&value)) { //assumes data is big endian
400 perror("Read-File Error");
401 parseStr += "'";
402 parseStr += filename;
403 parseStr += "' may not be a valid binary file.\n";
404 delete file;
405 return false;
406 }
407#ifdef ICC_BYTE_ORDER_LITTLE_ENDIAN
408 if (little_endian) {
409#else
410 if (!little_endian) {
411#endif
412 icUInt8Number t = m_ptr[0];
413 m_ptr[0] = m_ptr[1];
414 m_ptr[1] = t;
415 }
416 *dst++ = (icFloatNumber)value / 65535.0f;
417 }
418 delete file;
419 return true;
420 }
421 else if (storageType == icValueTypeFloat16){
422 icUInt32Number num = file->GetLength() / sizeof(icFloat16Number);
423 icFloat16Number value;
424 icUInt8Number *m_ptr = (icUInt8Number*)&value;
425
426 SetSize(num);
429 for (i=0; i<num; i++) {
430 if (!file->Read16(&value)) { //assumes data is big endian
431 perror("Read-File Error");
432 parseStr += "'";
433 parseStr += filename;
434 parseStr += "' may not be a valid binary file.\n";
435 delete file;
436 return false;
437 }
438#ifdef ICC_BYTE_ORDER_LITTLE_ENDIAN
439 if (little_endian) {
440#else
441 if (!little_endian) {
442#endif
443 icUInt8Number t = m_ptr[0];
444 m_ptr[0] = m_ptr[1];
445 m_ptr[1] = t;
446 }
447 *dst++ = icF16toF(value);
448 }
449 delete file;
450 return true;
451 }
452 else if (storageType == icValueTypeFloat32) {
453 icUInt32Number num = file->GetLength()/sizeof(icFloat32Number);
454 icFloat32Number value;
455 icUInt8Number *m_ptr = (icUInt8Number*)&value;
456
457 SetSize(num);
459
461 for (i=0; i<num; i++) {
462 if (!file->ReadFloat32Float(&value)) { //assumes data is big endian
463 perror("Read-File Error");
464 parseStr += "'";
465 parseStr += filename;
466 parseStr += "' may not be a valid binary file.\n";
467 delete file;
468 return false;
469 }
470#ifdef ICC_BYTE_ORDER_LITTLE_ENDIAN
471 if (little_endian) {
472#else
473 if (!little_endian) {
474#endif
475 icUInt8Number tmp;
476 tmp = m_ptr[0]; m_ptr[0] = m_ptr[3]; m_ptr[3] = tmp;
477 tmp = m_ptr[1]; m_ptr[1] = m_ptr[2]; m_ptr[2] = tmp;
478 }
479 *dst++ = value;
480 }
481 delete file;
482 return true;
483 }
484 else { //not 8bit/16bit/float
485 delete file;
486 return false;
487 }
488 }
489 }
490 else {
491 CIccFloatArray samples;
492
493 if (!samples.ParseArray(pNode->children)) {
494 return false;
495 }
496
497 if (!SetSize(samples.GetSize())) {
498 return false;
499 }
500
501 memcpy(m_pSamples, samples.GetBuf(), samples.GetSize() * sizeof(icFloatNumber));
502 }
503
504 return true;
505}
unsigned char icUInt8Number
Definition icProfileHeader.h:250
float icFloat32Number
Definition icProfileHeader.h:313
unsigned short icUInt16Number
Definition icProfileHeader.h:256
icUInt16Number icFloat16Number
Definition icProfileHeader.h:310
@ icValueTypeFloat16
Definition icProfileHeader.h:1087
@ icValueTypeUInt8
Definition icProfileHeader.h:1089
@ icValueTypeUInt16
Definition icProfileHeader.h:1088
@ icValueTypeFloat32
Definition icProfileHeader.h:1086
ICCPROFLIB_API icFloat32Number icF16toF(icFloat16Number num)
Definition IccUtil.cpp:629
xmlAttr * icXmlFindAttr(xmlNode *pNode, const char *szAttrName)
Definition IccUtilXml.cpp:669
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault="")
Definition IccUtilXml.cpp:572
CIccIO * IccOpenFileIO(const icChar *szFilename, const char *szAttr)
Definition IccIoXml.cpp:100
virtual bool SetSize(icUInt32Number nSize, bool bZeroAlloc=true)
Definition IccMpeBasic.cpp:980
Definition IccIO.h:97
icInt32Number ReadFloat32Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:302
virtual icInt32Number GetLength()
Definition IccIO.h:130
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:114
Definition IccUtilXml.h:145
static bool ParseArray(T *buf, icUInt32Number nBufSize, xmlNode *pNode)
Definition IccUtilXml.cpp:1034
bool ParseTextArrayNum(const char *szText, icUInt32Number num, std::string &parseStr)
Definition IccUtilXml.cpp:807
T * GetBuf()
Definition IccUtilXml.h:165
icUInt32Number GetSize()
Definition IccUtilXml.h:166

References CIccXmlArrayType< T, Tsig >::GetBuf(), CIccIO::GetLength(), CIccXmlArrayType< T, Tsig >::GetSize(), IccOpenFileIO(), icF16toF(), icValueTypeFloat16, icValueTypeFloat32, icValueTypeUInt16, icValueTypeUInt8, icXmlAttrValue(), icXmlAttrValue(), icXmlFindAttr(), CIccSampledCurveSegment::m_pSamples, CIccXmlArrayType< T, Tsig >::ParseArray(), CIccXmlArrayType< T, Tsig >::ParseTextArrayNum(), CIccIO::Read16(), CIccIO::Read8(), CIccIO::ReadFloat32Float(), and CIccSampledCurveSegment::SetSize().

Referenced by CIccSegmentedCurveXml::ParseXml().

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

◆ Read()

bool CIccSampledCurveSegment::Read ( icUInt32Number  size,
CIccIO pIO 
)
virtualinherited

Name: CIccSampledCurveSegment::Read

Purpose:

Args:

Return:

Implements CIccCurveSegment.

1081{
1083
1084 icUInt32Number headerSize = sizeof(icTagTypeSignature) +
1085 sizeof(icUInt32Number) +
1086 sizeof(icUInt32Number);
1087
1088 if (headerSize > size)
1089 return false;
1090
1091 if (!pIO) {
1092 return false;
1093 }
1094
1095 if (!pIO->Read32(&sig))
1096 return false;
1097
1098 if (!pIO->Read32(&m_nReserved))
1099 return false;
1100
1101 if (!pIO->Read32(&m_nCount))
1102 return false;
1103
1104 if (m_nCount > size - headerSize || m_nCount * sizeof(icFloat32Number) > size - headerSize)
1105 return false;
1106
1107 //Reserve room for first point who's value comes from previous segment
1108 m_nCount++;
1109
1110 if (!SetSize(m_nCount, false))
1111 return false;
1112
1113 if (m_nCount) {
1115 return false;
1116 }
1117
1118 //Initialize first point with zero. Properly initialized during Begin()
1119 m_pSamples[0] = 0;
1120
1121 return true;
1122}
long icInt32Number
Definition icProfileHeader.h:291
icCurveSegSignature
Definition icProfileHeader.h:1045
icTagTypeSignature
Definition icProfileHeader.h:526
icUInt32Number m_nReserved
Definition IccMpeBasic.h:121
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143

References CIccSampledCurveSegment::m_nCount, CIccCurveSegment::m_nReserved, CIccSampledCurveSegment::m_pSamples, CIccIO::Read32(), CIccIO::ReadFloat32Float(), and CIccSampledCurveSegment::SetSize().

+ Here is the call graph for this function:

◆ SetSize()

bool CIccSampledCurveSegment::SetSize ( icUInt32Number  nCount,
bool  bZeroAlloc = true 
)
virtualinherited

Name: CIccSampledCurveSegment::SetSize

Purpose: Sets size of sampled lookup table. Previous data (if exists) is lost.

Args: nCount = number of elements in lut (must be >= 2). Note: the m_pSample[0] is initialized from the the previous segment. It is not saved as part of Write(), or loaded as part of Read(). It will be initialized during the call to Begin(), The actual count of elements written to the file will be nCount-1 bZeroAlloc = flag to decide if memory should be set to zero.

Return: true if allocation successful.

981{
982 if (!nCount) {
983 if (m_pSamples)
984 free(m_pSamples);
985 m_pSamples = NULL;
986 m_nCount = nCount;
987 return true;
988 }
989
990 if (m_pSamples) {
991 free(m_pSamples);
992 }
993
994 if (bZeroAlloc)
995 m_pSamples = (icFloatNumber*)calloc(nCount, sizeof(icFloatNumber));
996 else
997 m_pSamples = (icFloatNumber*)malloc(nCount * sizeof(icFloatNumber));
998
999 if (m_pSamples)
1000 m_nCount = nCount;
1001 else
1002 m_nCount = 0;
1003
1004 return (m_pSamples != NULL);
1005}

References CIccSampledCurveSegment::m_nCount, and CIccSampledCurveSegment::m_pSamples.

Referenced by ParseXml(), and CIccSampledCurveSegment::Read().

+ Here is the caller graph for this function:

◆ StartPoint()

icFloatNumber CIccCurveSegment::StartPoint ( )
inlineinherited
115{ return m_startPoint; }

References CIccCurveSegment::m_startPoint.

Referenced by CIccSegmentedCurve::Insert(), and CIccSegmentedCurve::Write().

+ Here is the caller graph for this function:

◆ ToXml()

bool CIccSampledCurveSegmentXml::ToXml ( std::string &  xml,
std::string  blanks 
)
268{
269 char buf[256];
270 char line[256];
271
272 sprintf(line, "<SampledSegment Start=\"%s\"", icSegPos(buf, m_startPoint));
273 xml += blanks + line;
274
275 sprintf(line, " End=\"%s\">\n",icSegPos(buf, m_endPoint));
276 xml += line;
277
279
280 xml += blanks + "</SampledSegment>\n";
281
282 return true;
283}
@ icConvertFloat
Definition IccXmlConfig.h:70
static char * icSegPos(char *buf, icFloatNumber pos)
Definition IccMpeXml.cpp:136
static bool DumpArray(std::string &xml, std::string blanks, T *buf, icUInt32Number nBufSize, icConvertType nType, icUInt8Number nColumns)
Definition IccUtilXml.cpp:820

References CIccXmlArrayType< T, Tsig >::DumpArray(), icConvertFloat, icSegPos(), CIccCurveSegment::m_endPoint, CIccSampledCurveSegment::m_nCount, CIccSampledCurveSegment::m_pSamples, and CIccCurveSegment::m_startPoint.

Referenced by CIccSegmentedCurveXml::ToXml().

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

◆ Validate()

icValidateStatus CIccSampledCurveSegment::Validate ( std::string  sigPath,
std::string &  sReport,
const CIccTagMultiProcessElement pMPE = NULL,
const CIccProfile pProfile = NULL 
) const
virtualinherited

Name: CIccSampledCurveSegment::Validate

Purpose:

Args:

Return:

Implements CIccCurveSegment.

1234{
1235 CIccInfo Info;
1236 std::string sSigPathName = Info.GetSigPathName(sigPath);
1237
1239 if (m_nReserved) {
1240 sReport += icMsgValidateWarning;
1241 sReport += sSigPathName;
1242 sReport += " sampled curve has non zero reserved data.\n";
1243 rv = icValidateWarning;
1244 }
1245
1246 if (m_nCount<1) {
1247 sReport += icMsgValidateCriticalError;
1248 sReport += sSigPathName;
1249 sReport += " sampled curve has too few sample points.\n";
1251 }
1252 else if (m_endPoint-m_startPoint == 0.0) {
1253 sReport += icMsgValidateWarning;
1254 sReport += sSigPathName;
1255 sReport += " sampled curve has a range of zero.\n";
1257 }
1258
1259 return rv;
1260}
icValidateStatus
Definition IccDefs.h:119
@ icValidateOK
Definition IccDefs.h:120
@ icValidateWarning
Definition IccDefs.h:121
@ icValidateCriticalError
Definition IccDefs.h:123
ICCPROFLIB_API const char * icMsgValidateWarning
Definition IccUtil.cpp:90
ICCPROFLIB_API const char * icMsgValidateCriticalError
Definition IccUtil.cpp:92
ICCPROFLIB_API icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Definition IccUtil.cpp:244
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614

References CIccInfo::GetSigPathName(), icMaxStatus(), icMsgValidateCriticalError, icMsgValidateWarning, icValidateCriticalError, icValidateOK, icValidateWarning, CIccCurveSegment::m_endPoint, CIccSampledCurveSegment::m_nCount, CIccCurveSegment::m_nReserved, and CIccCurveSegment::m_startPoint.

+ Here is the call graph for this function:

◆ Write()

bool CIccSampledCurveSegment::Write ( CIccIO pIO)
virtualinherited

Name: CIccSampledCurveSegment::Write

Purpose:

Args:

Return:

Implements CIccCurveSegment.

1135{
1137
1138 if (!pIO)
1139 return false;
1140
1141 if (!pIO->Write32(&sig))
1142 return false;
1143
1144 if (!pIO->Write32(&m_nReserved))
1145 return false;
1146
1147 icUInt32Number nCount;
1148
1149 if (m_nCount)
1150 nCount = m_nCount -1;
1151 else
1152 nCount = 0;
1153
1154 if (!pIO->Write32(&nCount))
1155 return false;
1156
1157 //First point in samples is ONLY for interpolation (not saved)
1158 if (nCount) {
1159 if (pIO->WriteFloat32Float(m_pSamples+1, nCount)!=(icInt32Number)nCount)
1160 return false;
1161 }
1162
1163 return true;
1164}
virtual icCurveSegSignature GetType() const
Definition IccMpeBasic.h:180
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
icInt32Number WriteFloat32Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:321

References CIccSampledCurveSegment::GetType(), CIccSampledCurveSegment::m_nCount, CIccCurveSegment::m_nReserved, CIccSampledCurveSegment::m_pSamples, CIccIO::Write32(), and CIccIO::WriteFloat32Float().

+ Here is the call graph for this function:

Field Documentation

◆ m_endPoint

◆ m_last

◆ m_nCount

◆ m_nReserved

◆ m_pSamples

◆ m_range

◆ m_startPoint


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