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

Data Class: CIccResponseCurveStruct. More...

#include <IccTagBasic.h>

+ Collaboration diagram for CIccResponseCurveStruct:

Public Member Functions

 CIccResponseCurveStruct (const CIccResponseCurveStruct &IRCS)
 Name: CIccResponseCurveStruct::CIccResponseCurveStruct.
 
 CIccResponseCurveStruct (icMeasurementUnitSig sig, icUInt16Number nChannels=0)
 Name: CIccResponseCurveStruct::CIccResponseCurveStruct.
 
 CIccResponseCurveStruct (icUInt16Number nChannels=0)
 Name: CIccResponseCurveStruct::CIccResponseCurveStruct.
 
void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccResponseCurveStruct::Describe.
 
icMeasurementUnitSig GetMeasurementType () const
 
icUInt16Number GetNumChannels () const
 
CIccResponse16ListGetResponseList (icUInt16Number nChannel)
 
CIccResponseCurveStructGetThis ()
 
icXYZNumberGetXYZ (icUInt32Number index)
 
CIccResponseCurveStructoperator= (const CIccResponseCurveStruct &RespCurveStruct)
 Name: CIccResponseCurveStruct::operator=.
 
bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccResponseCurveStruct::Read.
 
icValidateStatus Validate (std::string &sReport)
 Name: CIccResponseCurveStruct::Validate.
 
bool Write (CIccIO *pIO)
 Name: CIccResponseCurveStruct::Write.
 
virtual ~CIccResponseCurveStruct ()
 Name: CIccResponseCurveStruct::~CIccResponseCurveStruct.
 

Protected Attributes

icXYZNumberm_maxColorantXYZ
 
icMeasurementUnitSig m_measurementUnitSig
 
icUInt16Number m_nChannels
 
CIccResponse16Listm_Response16ListArray
 

Friends

class CIccTagResponseCurveSet16
 

Detailed Description

Data Class: CIccResponseCurveStruct.

Purpose: The base class for response curve structure

Definition at line 1561 of file IccTagBasic.h.

Constructor & Destructor Documentation

◆ CIccResponseCurveStruct() [1/3]

CIccResponseCurveStruct::CIccResponseCurveStruct ( icMeasurementUnitSig sig,
icUInt16Number nChannels = 0 )

Name: CIccResponseCurveStruct::CIccResponseCurveStruct.

Purpose: Constructor

Args: sig = measurement unit signature indicating the type of measurement data, nChannels = number of channels

Definition at line 9746 of file IccTagBasic.cpp.

9747{
9748 m_nChannels = nChannels;
9750 m_maxColorantXYZ = (icXYZNumber*)calloc(nChannels, sizeof(icXYZNumber));
9752}
icArraySignature sig
std::list< icResponse16Number > CIccResponse16List
List Class: CIccResponse16List.
icUInt16Number m_nChannels
icXYZNumber * m_maxColorantXYZ
CIccResponse16List * m_Response16ListArray
icMeasurementUnitSig m_measurementUnitSig

References sig.

◆ CIccResponseCurveStruct() [2/3]

CIccResponseCurveStruct::CIccResponseCurveStruct ( icUInt16Number nChannels = 0)

Name: CIccResponseCurveStruct::CIccResponseCurveStruct.

Purpose: Constructor

Args: nChannels = number of channels

Definition at line 9727 of file IccTagBasic.cpp.

9728{
9729 m_nChannels = nChannels;
9730 m_maxColorantXYZ = (icXYZNumber*)calloc(nChannels, sizeof(icXYZNumber));
9732}

◆ CIccResponseCurveStruct() [3/3]

CIccResponseCurveStruct::CIccResponseCurveStruct ( const CIccResponseCurveStruct & IRCS)

Name: CIccResponseCurveStruct::CIccResponseCurveStruct.

Purpose: Copy Constructor

Args: IRCS = The CIccTagUnknown object to be copied

Definition at line 9764 of file IccTagBasic.cpp.

9765{
9766 m_nChannels = IRCS.m_nChannels;
9768
9771
9773 for (icUInt32Number i=0; i<m_nChannels; i++)
9775}
unsigned int icUInt32Number

References m_maxColorantXYZ, m_measurementUnitSig, m_nChannels, and m_Response16ListArray.

◆ ~CIccResponseCurveStruct()

CIccResponseCurveStruct::~CIccResponseCurveStruct ( )
virtual

Name: CIccResponseCurveStruct::~CIccResponseCurveStruct.

Purpose: Destructor

Definition at line 9820 of file IccTagBasic.cpp.

9821{
9822 if (m_maxColorantXYZ)
9823 free(m_maxColorantXYZ);
9824
9826 delete [] m_Response16ListArray;
9827}

Member Function Documentation

◆ Describe()

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

Name: CIccResponseCurveStruct::Describe.

Purpose: Dump data associated with the tag to a string

Args: sDescription - string to concatenate tag dump to

Definition at line 9970 of file IccTagBasic.cpp.

9971{
9972 icChar buf[128];
9973 CIccInfo Fmt;
9974 CIccResponse16List nResponseList;
9975 CIccResponse16List::iterator j;
9976
9977 sDescription += "Measurement Unit: ";
9978 sDescription += Fmt.GetMeasurementUnit((icSignature)GetMeasurementType()); sDescription += "\n";
9979
9980
9981 for (int i=0; i<m_nChannels; i++) {
9982 nResponseList = m_Response16ListArray[i];
9983
9984 sDescription += "\n";
9985 sprintf(buf, "Maximum Colorant XYZ Measurement for Channel-%u : X=%.4lf, Y=%.4lf, Z=%.4lf\n", i+1,
9987 sDescription += buf;
9988
9989 sprintf(buf, "Number of Measurements for Channel-%u : %u\n", i+1, (icUInt32Number)nResponseList.size());
9990 sDescription += buf;
9991
9992 sprintf(buf, "Measurement Data for Channel-%u follows:\n", i+1);
9993 sDescription += buf;
9994
9995 for (j=nResponseList.begin(); j!=nResponseList.end(); j++) {
9996 sprintf(buf, "Device Value= %u : Measurement Value= %.4lf\n", j->deviceCode, icFtoD(j->measurementValue));
9997 sDescription += buf;
9998 }
9999 }
10000}
char icChar
Definition IccDefs.h:109
icFloatNumber icFtoD(icS15Fixed16Number num)
Definition IccUtil.cpp:559
Type: Class.
Definition IccUtil.h:303
const icChar * GetMeasurementUnit(icSignature sig)
Definition IccUtil.cpp:2247
icMeasurementUnitSig GetMeasurementType() const
icUInt32Number icSignature

References CIccInfo::GetMeasurementUnit(), and icFtoD().

+ Here is the call graph for this function:

◆ GetMeasurementType()

icMeasurementUnitSig CIccResponseCurveStruct::GetMeasurementType ( ) const
inline

Definition at line 1576 of file IccTagBasic.h.

1576{return m_measurementUnitSig;}

Referenced by CIccTagXmlResponseCurveSet16::ToXml().

+ Here is the caller graph for this function:

◆ GetNumChannels()

icUInt16Number CIccResponseCurveStruct::GetNumChannels ( ) const
inline

Definition at line 1577 of file IccTagBasic.h.

1577{return m_nChannels;}

Referenced by CIccTagXmlResponseCurveSet16::ToXml().

+ Here is the caller graph for this function:

◆ GetResponseList()

CIccResponse16List * CIccResponseCurveStruct::GetResponseList ( icUInt16Number nChannel)
inline

Definition at line 1580 of file IccTagBasic.h.

1580{return &m_Response16ListArray[nChannel];}

Referenced by CIccTagXmlResponseCurveSet16::ParseXml(), and CIccTagXmlResponseCurveSet16::ToXml().

+ Here is the caller graph for this function:

◆ GetThis()

CIccResponseCurveStruct * CIccResponseCurveStruct::GetThis ( )
inline

Definition at line 1581 of file IccTagBasic.h.

1581{return this;}

Referenced by CIccTagResponseCurveSet16::GetFirstCurves(), and CIccTagResponseCurveSet16::GetNextCurves().

+ Here is the caller graph for this function:

◆ GetXYZ()

icXYZNumber * CIccResponseCurveStruct::GetXYZ ( icUInt32Number index)
inline

Definition at line 1579 of file IccTagBasic.h.

1579{return &m_maxColorantXYZ[index];}

Referenced by CIccTagXmlResponseCurveSet16::ParseXml(), and CIccTagXmlResponseCurveSet16::ToXml().

+ Here is the caller graph for this function:

◆ operator=()

CIccResponseCurveStruct & CIccResponseCurveStruct::operator= ( const CIccResponseCurveStruct & RespCurveStruct)

Name: CIccResponseCurveStruct::operator=.

Purpose: Copy Operator

Args: RespCurveStruct = The CIccResponseCurveStruct object to be copied

Definition at line 9788 of file IccTagBasic.cpp.

9789{
9790 if (&RespCurveStruct == this)
9791 return *this;
9792
9793 m_nChannels = RespCurveStruct.m_nChannels;
9795
9796 if (m_maxColorantXYZ)
9797 free(m_maxColorantXYZ);
9798
9800 memcpy(m_maxColorantXYZ, RespCurveStruct.m_maxColorantXYZ, m_nChannels*sizeof(icXYZNumber));
9801
9803 delete [] m_Response16ListArray;
9805 for (icUInt32Number i=0; i<m_nChannels; i++)
9806 m_Response16ListArray[i] = RespCurveStruct.m_Response16ListArray[i];
9807
9808 return *this;
9809}

References m_maxColorantXYZ, m_measurementUnitSig, m_nChannels, and m_Response16ListArray.

◆ Read()

bool CIccResponseCurveStruct::Read ( icUInt32Number size,
CIccIO * pIO )

Name: CIccResponseCurveStruct::Read.

Purpose: Read in the tag contents into a data block

Args: size - # of bytes in tag, pIO - IO object to read tag from

Return: true = successful, false = failure

Definition at line 9844 of file IccTagBasic.cpp.

9845{
9846 if (!m_nChannels)
9847 return false;
9848
9849 if (sizeof(icTagTypeSignature) +
9850 m_nChannels * (sizeof(icUInt32Number) +
9851 sizeof(icXYZNumber) +
9852 sizeof(icResponse16Number)) > size)
9853 return false;
9854
9855 if (!pIO) {
9856 return false;
9857 }
9858
9859 if (!pIO->Read32(&m_measurementUnitSig))
9860 return false;
9861
9862 icUInt32Number* nMeasurements = new icUInt32Number[m_nChannels];
9863
9864 if (pIO->Read32(&nMeasurements[0],m_nChannels) != m_nChannels) {
9865 delete[] nMeasurements;
9866 return false;
9867 }
9868
9870 if (pIO->Read32(&m_maxColorantXYZ[0], nNum32) != (icInt32Number)nNum32) {
9871 delete[] nMeasurements;
9872 return false;
9873 }
9874
9875 icResponse16Number nResponse16 = {};
9876 CIccResponse16List nResponseList;
9877
9878 for (int i = 0; i<m_nChannels; i++) {
9879 if (!nResponseList.empty())
9880 nResponseList.clear();
9881 for (int j=0; j<(int)nMeasurements[i]; j++) {
9882 if (!pIO->Read16(&nResponse16.deviceCode) ||
9883 !pIO->Read16(&nResponse16.reserved) ||
9884 !pIO->Read32(&nResponse16.measurementValue)) {
9885 delete[] nMeasurements;
9886 return false;
9887 }
9888 nResponseList.push_back(nResponse16);
9889 }
9890 m_Response16ListArray[i] = nResponseList;
9891 }
9892
9893 delete [] nMeasurements;
9894 return true;
9895}
icTagTypeSignature
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:114
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
long icInt32Number
icInt32Number icS15Fixed16Number
Fixed numbers.
response16Number
icUInt16Number deviceCode
icS15Fixed16Number measurementValue
icUInt16Number reserved

References icResponse16Number::deviceCode, icResponse16Number::measurementValue, CIccIO::Read16(), CIccIO::Read32(), and icResponse16Number::reserved.

Referenced by CIccTagResponseCurveSet16::Read().

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

◆ Validate()

icValidateStatus CIccResponseCurveStruct::Validate ( std::string & sReport)

Name: CIccResponseCurveStruct::Validate.

Purpose: Check tag data validity.

Args: sig = signature of tag being validated, sReport = String to add report information to

Return: icValidateStatusOK if valid, or other error status.

Definition at line 10017 of file IccTagBasic.cpp.

10018{
10020
10021 CIccInfo Info;
10022 std::string sSigName = Info.GetSigName(m_measurementUnitSig);
10023 switch(m_measurementUnitSig) {
10024 case icSigStatusA:
10025 case icSigStatusE:
10026 case icSigStatusI:
10027 case icSigStatusT:
10028 case icSigStatusM:
10029 case icSigDN:
10030 case icSigDNP:
10031 case icSigDNN:
10032 case icSigDNNP:
10033 break;
10034
10035 default:
10036 sReport += icMsgValidateNonCompliant;
10037 sReport += sSigName;
10038 sReport += " - Unknown measurement unit signature.\n";
10040 }
10041
10042 if (!m_nChannels) {
10043 sReport += icMsgValidateNonCompliant;
10044 sReport += sSigName;
10045 sReport += " - Incorrect number of channels.\n";
10047 return rv;
10048 }
10049 for (int i=0; i<m_nChannels; i++) {
10050 rv = icMaxStatus(rv, Info.CheckData(sReport, m_maxColorantXYZ[i], "Max Colorant XYZ"));
10051 }
10052
10053 return rv;
10054}
icValidateStatus
Definition IccDefs.h:118
@ icValidateOK
Definition IccDefs.h:119
@ icValidateNonCompliant
Definition IccDefs.h:121
icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Name: icMaxStatus.
Definition IccUtil.cpp:244
const char * icMsgValidateNonCompliant
Definition IccUtil.cpp:91
const icChar * GetSigName(icUInt32Number val)
Definition IccUtil.cpp:2000
icValidateStatus CheckData(std::string &sReport, const icDateTimeNumber &dateTime, std::string sDesc="")
Definition IccUtil.cpp:2414
@ icSigStatusI
@ icSigStatusE
@ icSigDNNP
@ icSigStatusA
@ icSigDN
@ icSigStatusT
@ icSigDNP
@ icSigDNN
@ icSigStatusM

References CIccInfo::CheckData(), CIccInfo::GetSigName(), icMaxStatus(), icMsgValidateNonCompliant, icSigDN, icSigDNN, icSigDNNP, icSigDNP, icSigStatusA, icSigStatusE, icSigStatusI, icSigStatusM, icSigStatusT, icValidateNonCompliant, and icValidateOK.

+ Here is the call graph for this function:

◆ Write()

bool CIccResponseCurveStruct::Write ( CIccIO * pIO)

Name: CIccResponseCurveStruct::Write.

Purpose: Write the tag to a file

Args: pIO - The IO object to write tag to.

Return: true = succesful, false = failure

Definition at line 9911 of file IccTagBasic.cpp.

9912{
9913 if (!m_nChannels)
9914 return false;
9915
9917
9918 if (!pIO) {
9919 return false;
9920 }
9921
9922 if (!pIO->Write32(&sig))
9923 return false;
9924
9925 if (m_nChannels) {
9926
9927 icUInt32Number* nMeasurements = new icUInt32Number[m_nChannels];
9928 for (int i=0; i<m_nChannels; i++)
9929 nMeasurements[i] = (icUInt32Number)m_Response16ListArray[i].size();
9930
9931 if (pIO->Write32(&nMeasurements[0],m_nChannels) != m_nChannels)
9932 return false;
9933 delete [] nMeasurements;
9934
9936 if (pIO->Write32(&m_maxColorantXYZ[0], nNum32) != (icInt32Number)nNum32)
9937 return false;
9938 }
9939 else
9940 return false;
9941
9942 CIccResponse16List nResponseList;
9943 CIccResponse16List::iterator j;
9944
9945 for (int i = 0; i<m_nChannels; i++) {
9946 nResponseList = m_Response16ListArray[i];
9947 for (j=nResponseList.begin(); j!=nResponseList.end(); j++) {
9948 if (!pIO->Write16(&j->deviceCode) ||
9949 !pIO->Write16(&j->reserved) ||
9950 !pIO->Write32(&j->measurementValue))
9951 return false;
9952 }
9953 nResponseList.clear();
9954 }
9955
9956 return true;
9957}
icInt32Number Write16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:122
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
icMeasurementUnitSig
Measurement Unit Signatures used in ResponseCurveSet16Type.

References sig, CIccIO::Write16(), and CIccIO::Write32().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ CIccTagResponseCurveSet16

friend class CIccTagResponseCurveSet16
friend

Definition at line 1563 of file IccTagBasic.h.

Member Data Documentation

◆ m_maxColorantXYZ

icXYZNumber* CIccResponseCurveStruct::m_maxColorantXYZ
protected

Definition at line 1587 of file IccTagBasic.h.

Referenced by CIccResponseCurveStruct(), and operator=().

◆ m_measurementUnitSig

icMeasurementUnitSig CIccResponseCurveStruct::m_measurementUnitSig
protected

Definition at line 1586 of file IccTagBasic.h.

Referenced by CIccResponseCurveStruct(), and operator=().

◆ m_nChannels

icUInt16Number CIccResponseCurveStruct::m_nChannels
protected

Definition at line 1585 of file IccTagBasic.h.

Referenced by CIccResponseCurveStruct(), and operator=().

◆ m_Response16ListArray

CIccResponse16List* CIccResponseCurveStruct::m_Response16ListArray
protected

Definition at line 1588 of file IccTagBasic.h.

Referenced by CIccResponseCurveStruct(), and operator=().


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