Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
IccEncoding.h File Reference

File: IccEncode.h. More...

#include "IccProfile.h"
+ Include dependency graph for IccEncoding.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  IIccEncProfileCacheHandler
 
class  IIccEncProfileConverter
 

Enumerations

enum  icStatusEncConvert {
  icEncConvertOk = 0 , icEncConvertBadProfile , icEncConvertNoBaseProfile , icEncConvertBadBaseProfile ,
  icEncConvertBadParams , icEncConvertMemoryError
}
 

Functions

icStatusEncConvert icConvertEncodingProfile (CIccProfilePtr &newIcc, CIccProfile *pEncodeIcc)
 

Detailed Description

File: IccEncode.h.

Contains: Header for implementation of Encoded profile class utiltities

Version: V1

Copyright: (c) see ICC Software License

Definition in file IccEncoding.h.

Enumeration Type Documentation

◆ icStatusEncConvert

Enumerator
icEncConvertOk 
icEncConvertBadProfile 
icEncConvertNoBaseProfile 
icEncConvertBadBaseProfile 
icEncConvertBadParams 
icEncConvertMemoryError 

Definition at line 74 of file IccEncoding.h.

74 {
icStatusEncConvert
Definition IccEncoding.h:74
@ icEncConvertBadParams
Definition IccEncoding.h:79
@ icEncConvertBadProfile
Definition IccEncoding.h:76
@ icEncConvertOk
Definition IccEncoding.h:75
@ icEncConvertNoBaseProfile
Definition IccEncoding.h:77
@ icEncConvertBadBaseProfile
Definition IccEncoding.h:78
@ icEncConvertMemoryError
Definition IccEncoding.h:80

Function Documentation

◆ icConvertEncodingProfile()

icStatusEncConvert icConvertEncodingProfile ( CIccProfilePtr & newIcc,
CIccProfile * pEncodeIcc )

Definition at line 534 of file IccEncoding.cpp.

535{
536 newIcc = NULL;
537
538 if (!pEncodeIcc || pEncodeIcc->m_Header.deviceClass!=icSigColorEncodingClass)
540
541 CIccTag *pTag;
542 CIccTagStruct *pParams=NULL;
543 pTag = pEncodeIcc->FindTagOfType(icSigReferenceNameTag, icSigUtf8TextType);
544 if (pTag) {
545 CIccTagUtf8Text *pText = (CIccTagUtf8Text*)pTag;
546 const icUChar *szRefName = pText->GetText();
547 if (!strcmp((const char*)szRefName, "ISO 22028-1")) {
548 pTag = pEncodeIcc->FindTagOfType(icSigColorEncodingParamsTag, icSigTagStructType);
549 if (pTag)
550 pParams = (CIccTagStruct*)pTag->NewCopy();
551 }
552 else {
553 CIccTag *pNameTag = pEncodeIcc->FindTagOfType(icSigColorSpaceNameTag, icSigUtf8TextType);
554 if (pNameTag) {
555 pText = (CIccTagUtf8Text *)pNameTag;
556 const icUChar *szName = pText->GetText();
557
559 if (!pBaseIcc) {
561 }
562
563 pTag = pBaseIcc->FindTagOfType(icSigColorEncodingParamsTag, icSigTagStructType);
564 if (!pTag) {
565 delete pBaseIcc;
567 }
568 pParams = (CIccTagStruct*)pTag->NewCopy();
569 delete pBaseIcc;
570
571 //Now Copy Overrides into pParams (if they exist in pEncodeIcc
572 CIccTag *pOverridesTag = pEncodeIcc->FindTagOfType(icSigColorEncodingParamsTag, icSigTagStructType);
573 if (pOverridesTag) {
574 CIccTagStruct *pStruct = (CIccTagStruct*)pOverridesTag;
575 TagEntryList *pTags = pStruct->GetElemList();
576 if (pTags) {
577 TagEntryList::iterator entry;
578 for (entry=pTags->begin(); entry!=pTags->end(); entry++) {
579 if (entry->pTag) {
580 pStruct->DeleteElem(entry->TagInfo.sig);
581 pStruct->AttachElem(entry->TagInfo.sig, entry->pTag->NewCopy());
582 }
583 }
584 }
585 }
586 }
587 }
588 }
589
590 if (!pParams) {
592 }
593
594 //Create and initialize new profile from pEncodeIcc and pParams
595 icStatusEncConvert stat = IIccEncProfileConverter::GetHandler()->ConvertFromParams(newIcc, pParams, &pEncodeIcc->m_Header);
596
597 delete pParams;
598
599 return stat;
600}
unsigned char icUChar
Definition IccDefs.h:110
const icChar * szName
Class: CIccTag.
virtual CIccTag * NewCopy() const
Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.
Class: CIccTagStruct.
bool AttachElem(icSignature sig, CIccTag *pTag)
Name: CIccTagStruct::AttachTag.
bool DeleteElem(icSignature sig)
Name: CIccTagStruct::DeleteSubTag.
TagEntryList * GetElemList()
Class: CIccTagUtf8Text()
const icUChar * GetText() const
virtual CIccProfile * GetEncodingProfile(const icUChar *szColorSpaceName)=0
static IIccEncProfileCacheHandler * GetHandler()
static IIccEncProfileConverter * GetHandler()
virtual icStatusEncConvert ConvertFromParams(CIccProfilePtr &newIcc, CIccTagStruct *pParams, icHeader *pHeader)=0
@ icSigColorEncodingClass
@ icSigUtf8TextType
@ icSigTagStructType
@ icSigColorSpaceNameTag
@ icSigColorEncodingParamsTag
@ icSigReferenceNameTag

References CIccTagStruct::AttachElem(), IIccEncProfileConverter::ConvertFromParams(), CIccTagStruct::DeleteElem(), CIccTagStruct::GetElemList(), IIccEncProfileCacheHandler::GetEncodingProfile(), IIccEncProfileCacheHandler::GetHandler(), IIccEncProfileConverter::GetHandler(), CIccTagUtf8Text::GetText(), icEncConvertBadBaseProfile, icEncConvertBadProfile, icEncConvertNoBaseProfile, icSigColorEncodingClass, icSigColorEncodingParamsTag, icSigColorSpaceNameTag, icSigReferenceNameTag, icSigTagStructType, icSigUtf8TextType, CIccTag::NewCopy(), and szName.

+ Here is the call graph for this function: