72 #pragma warning( disable: 4786)
90#ifdef USEREFICCMAXNAMESPACE
118 sDescription +=
"\nCIccArrayUnknown::Describe()\n";
129 sReport +=
"Unknown tag array type!\n";
130 for (i=0; i<m_pTag->GetSize(); i++) {
131 CIccTag *pTag = m_pTag->GetIndex(i);
135 sprintf(buf,
"Tag at index %d is NULL\n", i);
144 sReport +=
"Array Handler not connected to CIccTagArray object!";
176 sDescription +=
"\nCIccArrayColorantInfo::Describe()\n";
187 for (i = 0; i < m_pTag->GetSize(); i++) {
188 CIccTag *pTag = m_pTag->GetIndex(i);
192 sprintf(buf,
"Tag at index %d is NULL\n", i);
199 sprintf(buf,
"Tag at index %d is not a colorantInfoStruct\n", i);
207 sReport +=
"Array Handler not connected to CIccTagArray object!";
223 m_nDeviceSamples = 0;
225 m_nSpectralSamples = 0;
226 m_spectralRange = m_biSpectralRange = {};
257 sDescription +=
"\nCIccArrayNamedColor::Describe()\n";
267 m_csDevice = csDevice;
268 m_csSpectralPcs = csSpectralPcs;
270 m_spectralRange = *pSpectralRange;
272 memset(&m_spectralRange, 0,
sizeof(m_spectralRange));
274 if (pBiSpectralRange)
275 m_biSpectralRange = *pBiSpectralRange;
277 memset(&m_biSpectralRange, 0,
sizeof(m_biSpectralRange));
290 int i, n=m_pTag->GetSize();
291 for (i=1; i<n; i++) {
294 std::string name = pNamedColor->
getName();
296 (*m_list)[name] = pNamedColor;
305 std::string name(szColor);
307 icNamedColorStructList::const_iterator i;
308 i=m_list->find(name);
309 if (i!=m_list->end())
323 for (i=1; i<n; i++) {
331 v->
GetValues(temp, (n-1)*m_nDeviceSamples, m_nDeviceSamples);
333 for (j=0; j<m_nDeviceSamples; j++) {
334 if (temp[j]!=pDevColor[j])
337 if (n==m_nDeviceSamples) {
362 for (i=1; i<n; i++) {
370 v->
GetValues(pLab, (n-1)*m_nDeviceSamples, 3);
374 if (dCalcDE<dMinDE && dCalcDE<dLeastDE) {
376 leastDEindex = pNamedColor;
397 for (i=1; i<n; i++) {
405 v->
GetValues(temp, (n-1)*m_nSpectralSamples, m_nSpectralSamples);
407 dCalcRMS =
icRmsDif(pSpec, temp, m_nSpectralSamples);
409 if (dCalcRMS<dMinRMS && dCalcRMS<dLeastRMS) {
410 dLeastRMS = dCalcRMS;
411 leastRMSindex = pNamedColor;
418 return leastRMSindex;
429 pZero = m_pZeroTint->GetNumArray(
sig);
436 return pColor->
GetTint(dstColor, tint, pZero,
sig, m_nDeviceSamples);
448 pZero = m_pZeroTint->GetNumArray(
sig);
455 return pColor->
GetTint(dstColor, tint, pZero,
sig, m_nPcsSamples);
466 pZero = m_pZeroTint->GetNumArray(
sig);
473 return pColor->
GetTint(dstColor, tint, pZero,
sig, m_nSpectralSamples);
487 sReport +=
"Named Color array must have at least 1 entry\n";
491 for (i=0; i<n; i++) {
492 pSubTag = m_pTag->GetIndex(i);
509 if (pArray && m_nDeviceSamples) {
513 sprintf(str,
"Insufficient device samples in NamedColor[%d]\n", i);
517 else if (pArray->
GetNumValues() != n*m_nDeviceSamples) {
518 sprintf(str,
"Number of Device samples isn't an even multiple of Device samples in NamedColor[%d]!\n", i);
523 sprintf(str,
"Number of device samples doesn't match tint values in NamedColor[%d]\n", i);
530 if (pArray && m_nPcsSamples) {
534 sprintf(str,
"Insufficient PCS samples in NamedColor[%d]\n", i);
539 sprintf(str,
"Number of PCS samples isn't an even multiple of PCS samples in NamedColor[%d]!\n", i);
544 sprintf(str,
"Number of PCS samples doesn't match tint values in NamedColor[%d]\n", i);
556 sprintf(str,
"Incompatible SpectralPcs samples in NamedColor[%d]\n", i);
561 else if (m_nSpectralSamples) {
565 sprintf(str,
"Insufficient SpectralPcs samples in NamedColor[%d]\n", i);
569 else if (pArray->
GetNumValues() != n*m_nSpectralSamples) {
570 sprintf(str,
"Number of spectral samples isn't an even multiple of spectral PCS samples in Namedcolor[%d]!\n", i);
575 sprintf(str,
"Number of SpectralPCS samples doesn't match tint values in NamedColor[%d]\n", i);
591 sReport +=
"Named Color array has invalid tag struct entries!\n";
600#ifdef USEREFICCMAXNAMESPACE
std::map< std::string, CIccStructNamedColor * > icNamedColorStructList
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
@ icValidateCriticalError
IIccStruct * icGetTagStructHandlerOfType(CIccTag *pTag, icStructSignature sig)
icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Name: icMaxStatus.
std::string icGetSigPath(icUInt32Number nSig)
icUInt32Number icGetSpaceSamples(icColorSpaceSignature sig)
icFloatNumber icRmsDif(const icFloatNumber *v1, const icFloatNumber *v2, icUInt32Number nSample)
icFloatNumber icDeltaE(const icFloatNumber *lab1, const icFloatNumber *lab2)
void icXYZtoLab(icFloatNumber *Lab, const icFloatNumber *XYZ, const icFloatNumber *WhiteXYZ)
unsigned int icUInt32Number
Class: CIccArrayColorantInfo.
virtual void Describe(std::string &sDescription, int nVerboseness) const
virtual ~CIccArrayColorantInfo()
CIccArrayColorantInfo(CIccTagArray *pTagArray=NULL)
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
virtual IIccArray * NewCopy(CIccTagArray *pTagArray) const
Class: CIccArrayNamedColor.
icColorSpaceSignature m_csDevice
icSpectralColorSignature m_csSpectralPcs
icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
CIccStructNamedColor * FindColor(const icChar *szColor) const
bool GetSpectralTint(icFloatNumber *dstColor, const CIccStructNamedColor *pColor, icFloatNumber tint=1.0f, icNamedColorlMemberSignature sig=icSigNmclSpectralDataMbr) const
CIccArrayNamedColor(CIccTagArray *pTagArray=NULL)
virtual IIccArray * NewCopy(CIccTagArray *pTagArray) const
icSpectralRange m_spectralRange
virtual ~CIccArrayNamedColor()
CIccStructNamedColor * FindSpectralColor(const icFloatNumber *pSpec, icFloatNumber dMinRms=1000.0) const
void SetColorSpaces(icColorSpaceSignature csPcs, icColorSpaceSignature csDevice, icSpectralColorSignature csSpectralPCS=icSigNoSpectralData, const icSpectralRange *pSpectralRange=NULL, const icSpectralRange *pBiSPectralRange=NULL)
CIccStructNamedColor * FindDeviceColor(const icFloatNumber *pDevColor) const
CIccStructNamedColor * FindPcsColor(const icFloatNumber *pPCS, icFloatNumber dMinDE=1000.0) const
icColorSpaceSignature m_csPcs
icSpectralRange m_biSpectralRange
virtual void Describe(std::string &sDescription, int nVerboseness) const
bool GetDeviceTint(icFloatNumber *dstColor, const CIccStructNamedColor *pColor, icFloatNumber tint=1.0f, icNamedColorlMemberSignature sig=icSigNmclDeviceDataMbr) const
bool GetPcsTint(icFloatNumber *dstColor, const CIccStructNamedColor *pColor, icFloatNumber tint=1.0f, icNamedColorlMemberSignature sig=icSigNmclPcsDataMbr) const
virtual void Describe(std::string &sDescription, int nVerboseness) const
CIccArrayUnknown(CIccTagArray *pTagArray=NULL, icArraySignature sigArray=(icArraySignature) 0)
virtual ~CIccArrayUnknown()
virtual IIccArray * NewCopy(CIccTagArray *pTagArray) const
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
Class: CIccStructNamedColor.
CIccTagNumArray * GetNumArray(icSignature sigElem) const
bool GetTint(icFloatNumber *dstColor, icFloatNumber tint, CIccTagNumArray *pZero, icSignature sigElem, icUInt32Number nSamples) const
std::string getName() const
CIccTag * GetElem(icSignature sigElem) const
virtual icTagTypeSignature GetType() const
Function: GetType()
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
Function: Validate Each derived tag will implement it's own IsValid() function.
virtual bool IsNumArrayType() const
virtual icStructSignature GetTagStructType() const
virtual bool GetValues(icFloatNumber *DstVector, icUInt32Number nStart=0, icUInt32Number nVectorSize=1) const =0
virtual icUInt32Number GetNumValues() const =0
virtual bool IsMatrixArray() const =0
Class: CIccTagSparseMatrixArray.
icUInt32Number GetChannelsPerMatrix() const
IIccStruct * GetStructHandler()
Name: CIccTagStruct::GetStructHandler.