72#pragma warning( disable: 4786)
92 sprintf(buf,
"BEGIN UNKNOWN_TAG_STRUCT ");
95 sDescription +=
"\n\n";
97 TagEntryList::iterator i;
99 for (i=pList->begin(); i!=pList->end(); i++) {
100 i->pTag->Describe(sDescription, nVerboseness);
103 sDescription +=
"\n";
104 sprintf(buf,
"END TAG_STRUCT\n");
106 sDescription +=
"\n";
153 TagEntryList::const_iterator i;
156 entry.pTag = i->pTag->NewCopy();
157 memcpy(&entry.TagInfo, &i->TagInfo,
sizeof(
icTag));
163 TagPtrList::const_iterator i;
166 tagptr.ptr = i->ptr->NewCopy();
191 if (&subTags ==
this)
200 TagEntryList::const_iterator i;
203 entry.pTag = i->pTag->NewCopy();
204 memcpy(&entry.TagInfo, &i->TagInfo,
sizeof(
icTag));
211 TagPtrList::const_iterator i;
214 tagptr.ptr = i->ptr->NewCopy();
284 if (!IO.
Attach(pMem, size))
289 if (!pTags->
Read(size, &IO)) {
313 sDescription +=
"BEGIN STRUCT \"";
314 sDescription += name +
"\"\n";
322 pStruct->
Describe(sDescription, nVerboseness);
328 structHandler.
Describe(sDescription, nVerboseness);
331 sDescription +=
"END STRUCT \"";
332 sDescription += name +
"\"\n";
357 if (headerSize > size)
376 if (!pIO->
Read32(&sigStructType))
382 IccTagEntry TagEntry;
384 TagEntry.pTag = NULL;
393 for (i=0; i<count; i++) {
394 if (!pIO->
Read32(&TagEntry.TagInfo.sig) ||
395 !pIO->
Read32(&TagEntry.TagInfo.offset) ||
396 !pIO->
Read32(&TagEntry.TagInfo.size)) {
402 TagEntryList::iterator entry;
405 if (!
LoadElem((IccTagEntry*)&(entry->TagInfo), pIO)) {
443 TagEntryList::iterator i, j;
458 i->TagInfo.offset = 0;
462 pIO->
Write32(&i->TagInfo.offset);
463 pIO->
Write32(&i->TagInfo.size);
471 if (i->pTag == j->pTag)
478 i->TagInfo.size = pIO->
GetLength() - i->TagInfo.offset;
484 i->TagInfo.offset = j->TagInfo.offset;
485 i->TagInfo.size = j->TagInfo.size;
497 pIO->
Write32(&i->TagInfo.offset);
498 pIO->
Write32(&i->TagInfo.size);
520 const CIccProfile* pProfile )
const
530 sReport += sSigPathName;
531 sReport +=
" - There are duplicate elements.\n";
539 sReport +=
"Unknown tag struct type - Validating struct sub-tags\n";
543 TagEntryList::iterator i;
561 TagPtrList::iterator i;
591 TagEntryList::const_iterator i;
594 if (i->TagInfo.sig==
sig)
595 return (IccTagEntry*)&(i->TagInfo);
617 TagEntryList::const_iterator i, j;
622 if (i->TagInfo.sig == j->TagInfo.sig)
647 TagEntryList::const_iterator i;
651 return (IccTagEntry*)&(i->TagInfo);
702 if (pEntry && pEntry->pTag && pEntry->pTag->GetType()==sigType) {
762 if (pEntry->pTag == pTag)
770 Entry.TagInfo.offset = 0;
771 Entry.TagInfo.size = 0;
776 TagPtrList::iterator i;
809 TagEntryList::iterator i;
812 if (i->TagInfo.sig==
sig)
859 if (pTagEntry->TagInfo.offset<headerSize ||
860 !pTagEntry->TagInfo.size ||
861 pTagEntry->TagInfo.offset+pTagEntry->TagInfo.size >
m_tagSize) {
873 if (!pIO->
Read32(&sigType))
889 if (!pTag->
Read(pTagEntry->TagInfo.size, pIO)) {
894 pTagEntry->pTag = pTag;
902 TagEntryList::iterator i;
905 if (i->TagInfo.offset == pTagEntry->TagInfo.offset &&
937 TagPtrList::iterator i;
949 TagEntryList::iterator j;
951 if (j->pTag == pTag) {
1036 for (i=0; i<tagAry.
m_nSize; i++) {
1064 if (&tagAry ==
this)
1150 if (!pTag || pTag->
GetType()!=sigTagType)
1177 sDescription +=
"BEGIN TAG_ARRAY \"";
1178 sDescription += name;
1179 sDescription +=
"\"\n\n";
1185 sDescription +=
"\n";
1186 sprintf(buf,
"BEGIN INDEX[%d]\n", i);
1187 sDescription += buf;
1190 m_TagVals[i].ptr->Describe(sDescription, nVerboseness);
1192 sprintf(buf,
"END INDEX[%d]\n", i);
1193 sDescription += buf;
1196 sDescription +=
"\n";
1197 sDescription +=
"END TAG_ARRAY \"";
1198 sDescription += name;
1199 sDescription +=
"\"\n";
1223 if (headerSize > size)
1240 !pIO->
Read32(&sigArrayType))
1246 IccTagEntry TagEntry;
1248 TagEntry.pTag = NULL;
1250 if (!pIO->
Read32(&count))
1264 for (i=0; i<count; i++) {
1272 for (i=0; i<count; i++) {
1273 if (!tagPos[i].offset || !tagPos[i].size) {
1278 for (j=0; j<i; j++) {
1279 if (tagPos[i].offset == tagPos[j].offset)
1287 if (tagPos[i].offset + tagPos[i].size > size) {
1299 if (!pTag->
Read(tagPos[i].
size, pIO)) {
1367 for (j=0; j<i; j++) {
1422 m_TagVals = (IccTagPtr*)calloc(nSize,
sizeof(IccTagPtr));
1455 const CIccProfile* pProfile )
const
1473 sReport += sSigPathName;
1474 sReport +=
" - Number of material channel names does not match MCS in header.\n";
1484 sReport +=
"Unknown tag array type - Validating array sub-tags\n";
1565 if (nIndex>
m_nSize || !pTag) {
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
@ icValidateCriticalError
File: IccStructFactory.h.
IIccArray * icGetTagArrayHandlerOfType(CIccTag *pTag, icArraySignature sig)
IIccArray * icGetTagArrayHandler(CIccTag *pTag)
IIccStruct * icGetTagStructHandlerOfType(CIccTag *pTag, icStructSignature sig)
IIccStruct * icGetTagStructHandler(CIccTag *pTag)
icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Name: icMaxStatus.
std::string icGetSigPath(icUInt32Number nSig)
const char * icMsgValidateWarning
void * icRealloc(void *ptr, size_t size)
Name: icRealloc.
icUInt32Number icGetMaterialColorSpaceSamples(icMaterialColorSignature sig)
const char * icMsgValidateCriticalError
icSignature icGetFirstSigPathSig(std::string sigPath)
unsigned int icUInt32Number
static IIccArray * CreateArray(icArraySignature arrayTypeSig, CIccTagArray *pTagArray=NULL)
Function: CreateArray(structTypeSig) Create a element of type structTypeSig.
static bool GetArraySigName(std::string &arrayName, icArraySignature arrayTypeSig, bool bFillUnknown=true)
Function: GetArraySigName(structTypeSig) Get display name of structTypeSig.
virtual icInt32Number GetLength()
virtual icInt32Number Tell()
bool Align32()
Write operation to make sure that filelength is evenly divisible by 4.
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
const icChar * GetStructSigName(icStructSignature sig)
std::string GetSigPathName(std::string sigPath)
bool Attach(icUInt8Number *pData, icUInt32Number nSize, bool bWrite=false)
static bool GetStructSigName(std::string &structName, icStructSignature structTypeSig, bool bFillUnknown=true)
Function: GetStructSigName(structTypeSig) Get display name of structTypeSig.
static IIccStruct * CreateStruct(icStructSignature structTypeSig, CIccTagStruct *pTagStruct)
Function: CreateStruct(structTypeSig) Create a element of type structTypeSig.
Class: CIccStructUnknown.
virtual void Describe(std::string &sDescription, int nVerboseness) const
bool AreAllOfType(icTagTypeSignature sigTagType)
Name: CIccTagArray::AreAllOftype.
icArraySignature m_sigArrayType
CIccTagArray & operator=(const CIccTagArray &lut)
Name: &operator=.
bool AttachTag(icUInt32Number nIndex, CIccTag *pTag)
Name: CIccTagArray::AttachTag.
virtual void Describe(std::string &sDescription, int nVerboseness)
Name: CIccTagArray::Describe.
CIccTag * DetachTag(icUInt32Number nIndex, bool bDeleteFlag=false)
Name: CIccTagArray::DetachTag.
virtual bool SetTagArrayType(icArraySignature sig)
Name: CIccTagArray::~SetTagArrayType.
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Name: CIccTagArray::Read.
bool SetSize(icUInt32Number nSize)
Name: CIccTagArray::SetSize.
IIccArray * GetArrayHandler()
Name: CIccTagArray::GetArrayHandler.
CIccTag * GetIndex(icUInt32Number index) const
Name: CIccTagArray::GetIndex.
virtual ~CIccTagArray()
Name: CIccTagArray::~CIccTagArray.
virtual bool Write(CIccIO *pIO)
Name: CIccTagArray::Write.
virtual icTagTypeSignature GetType() const
Function: GetType()
CIccTagArray()
Name: CIccTagArray::CIccTagArray.
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
Name: CIccTagArray::Validate.
void Cleanup()
Name: CIccTagArray::Cleanup.
static CIccTag * CreateTag(icTagTypeSignature tagTypeSig)
Function: CreateTag(tagTypeSig) Create a tag of type tagTypeSig.
virtual icTagTypeSignature GetType() const
Function: GetType()
icUInt32Number m_nReserved
static CIccTag * Create(icTagTypeSignature sig)
Name: CIccTag::Create.
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Function: Read(size, pIO) - Read tag from file.
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 icArraySignature GetTagArrayType() const
virtual icStructSignature GetTagStructType() const
virtual bool GetValues(icFloatNumber *DstVector, icUInt32Number nStart=0, icUInt32Number nVectorSize=1) const =0
bool AttachElem(icSignature sig, CIccTag *pTag)
Name: CIccTagStruct::AttachTag.
bool AreElemsUnique() const
Name: CIccTagStruct::AreElemsUnique.
CIccTag * FindElemOfType(icSignature sig, icTagTypeSignature sigType)
Name: CIccTagStruct::FindElemOfType.
static CIccTagStruct * ParseMem(icUInt8Number *pMem, icUInt32Number size)
Name: CIccTagStruct::ParseMem.
TagEntryList * m_ElemEntries
virtual void Describe(std::string &sDescription, int nVerboseness)
Name: CIccTagStruct::Describe.
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
Name: CIccTagStruct::Validate.
icFloatNumber GetElemNumberValue(icSignature sig, icFloatNumber defaultValue=0)
Name: CIccTagStruct::GetElemNumberValue.
bool DetachElem(CIccTag *pTag)
Name: CIccTagStruct::DetachSubTag.
virtual bool SetTagStructType(icStructSignature sig)
Name: CIccTagStruct::SetTagStructType.
CIccTagStruct & operator=(const CIccTagStruct &lut)
Name: &operator=.
bool DeleteElem(icSignature sig)
Name: CIccTagStruct::DeleteSubTag.
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Name: CIccTagStruct::Read.
TagEntryList * GetElemList()
icStructSignature m_sigStructType
virtual icStructSignature GetTagStructType() const
IIccStruct * GetStructHandler()
Name: CIccTagStruct::GetStructHandler.
virtual ~CIccTagStruct()
Name: CIccTagStruct::~CIccTagStruct.
CIccTag * FindElem(icSignature sig)
Name: CIccTagStruct::FindElem.
virtual bool Write(CIccIO *pIO)
Name: CIccTagStruct::Write.
icUInt32Number m_tagStart
CIccTagStruct()
Name: CIccTagStruct::CIccTagStruct.
bool LoadElem(IccTagEntry *pTagEntry, CIccIO *pIO)
Name: CIccTagStruct::LoadSubTag.
IccTagEntry * GetElem(icSignature sig) const
Name: CIccTagStruct::GetElem.
void Cleanup()
Name: CIccTagStruct::Cleanup.
virtual icTagTypeSignature GetType() const
Function: GetType()
virtual IIccArray * NewCopy(CIccTagArray *pNewTagArray) const =0
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const =0
virtual void Describe(std::string &sDescription, int nVerboseness) const
virtual IIccStruct * NewCopy(CIccTagStruct *pNewTagStruct) const =0
CIccTagStruct * m_pTagStruct
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const =0
TagEntryList * getTagEntries() const
Lists of tags, tags, profile header and profile structure.