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

Class: CIccTagColorantOrder. More...

#include <IccTagBasic.h>

+ Inheritance diagram for CIccTagColorantOrder:
+ Collaboration diagram for CIccTagColorantOrder:

Public Member Functions

 CIccTagColorantOrder (const CIccTagColorantOrder &ITCO)
 Name: CIccTagColorantOrder::CIccTagColorantOrder.
 
 CIccTagColorantOrder (int nsize=1)
 Name: CIccTagColorantOrder::CIccTagColorantOrder.
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccTagColorantOrder::Describe.
 
virtual const icCharGetClassName () const
 
icUInt8NumberGetData (int index)
 
icUInt32Number GetSize () const
 
virtual icTagTypeSignature GetType () const
 Function: GetType()
 
virtual CIccTagNewCopy () const
 Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.
 
CIccTagColorantOrderoperator= (const CIccTagColorantOrder &ColorantOrderTag)
 Name: CIccTagColorantOrder::operator=.
 
icUInt8Numberoperator[] (int index)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccTagColorantOrder::Read.
 
bool SetSize (icUInt16Number nsize, bool bZeronew=true)
 Name: CIccTagColorantOrder::SetSize.
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 Name: CIccTagColorantOrder::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccTagColorantOrder::Write.
 
virtual ~CIccTagColorantOrder ()
 Name: CIccTagColorantOrder::~CIccTagColorantOrder.
 
- Public Member Functions inherited from CIccTag
 CIccTag ()
 Name: CIccTag::CIccTag.
 
virtual void DetachIO ()
 Function: ReadAll() - Read All sub data for tag from file.
 
virtual IIccExtensionTagGetExtension ()
 
virtual icArraySignature GetTagArrayType () const
 
virtual icStructSignature GetTagStructType () const
 
virtual bool IsArrayType ()
 
virtual bool IsMBBType ()
 
virtual bool IsNumArrayType () const
 
virtual bool IsSupported ()
 Function: IsSupported(size, pIO) - Check if tag fully supported for apply purposes.
 
virtual bool Read (icUInt32Number size, CIccIO *pIO, CIccProfile *pProfile)
 Function: Read(size, pIO) - Read tag from file.
 
virtual bool ReadAll ()
 Function: ReadAll() - Read All sub data for tag from file.
 
virtual ~CIccTag ()
 Name: CIccTag::CIccTag.
 

Protected Attributes

icUInt32Number m_nCount
 
icUInt8Numberm_pData
 

Additional Inherited Members

- Static Public Member Functions inherited from CIccTag
static CIccTagCreate (icTagTypeSignature sig)
 Name: CIccTag::Create.
 
- Public Attributes inherited from CIccTag
icUInt32Number m_nReserved
 

Detailed Description

Class: CIccTagColorantOrder.

Purpose: Colorant Order Tag

Definition at line 1352 of file IccTagBasic.h.

Constructor & Destructor Documentation

◆ CIccTagColorantOrder() [1/2]

CIccTagColorantOrder::CIccTagColorantOrder ( int nsize = 1)

Name: CIccTagColorantOrder::CIccTagColorantOrder.

Purpose: Constructor

Args: nSize = number of channels

Definition at line 8265 of file IccTagBasic.cpp.

8266{
8267 m_nCount = nsize;
8268 if (m_nCount <1)
8269 m_nCount = 1;
8270 m_pData = (icUInt8Number*)calloc(nsize, sizeof(icUInt8Number));
8271}
icUInt32Number m_nCount
icUInt8Number * m_pData
unsigned char icUInt8Number
Number definitions.

◆ CIccTagColorantOrder() [2/2]

CIccTagColorantOrder::CIccTagColorantOrder ( const CIccTagColorantOrder & ITCO)

Name: CIccTagColorantOrder::CIccTagColorantOrder.

Purpose: Copy Constructor

Args: ITCO = The CIccTagColorantOrder object to be copied

Definition at line 8285 of file IccTagBasic.cpp.

8286{
8287 m_nCount = ITCO.m_nCount;
8288
8289 m_pData = (icUInt8Number*)calloc(m_nCount, sizeof(icUInt8Number));
8290 memcpy(m_pData, ITCO.m_pData, sizeof(icUInt8Number)*m_nCount);
8291}

References m_nCount, and m_pData.

◆ ~CIccTagColorantOrder()

CIccTagColorantOrder::~CIccTagColorantOrder ( )
virtual

Name: CIccTagColorantOrder::~CIccTagColorantOrder.

Purpose: Destructor

Definition at line 8328 of file IccTagBasic.cpp.

8329{
8330 if (m_pData)
8331 free(m_pData);
8332}

Member Function Documentation

◆ Describe()

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

Name: CIccTagColorantOrder::Describe.

Purpose: Dump data associated with the tag to a string

Args: sDescription - string to concatenate tag dump to

Reimplemented from CIccTag.

Definition at line 8436 of file IccTagBasic.cpp.

8437{
8438 icChar buf[128];
8439
8440 sprintf(buf, "Colorant Count : %u\n", m_nCount);
8441 sDescription += buf;
8442 sDescription += "Order of Colorants:\n";
8443
8444 for (int i=0; i<(int)m_nCount; i++) {
8445 sprintf(buf, "%u\n", m_pData[i]);
8446 sDescription += buf;
8447 }
8448}
char icChar
Definition IccDefs.h:109

◆ GetClassName()

virtual const icChar * CIccTagColorantOrder::GetClassName ( ) const
inlinevirtual

Reimplemented from CIccTag.

Reimplemented in CIccTagXmlColorantOrder.

Definition at line 1362 of file IccTagBasic.h.

1362{ return "CIccTagColorantOrder"; }

◆ GetData()

icUInt8Number * CIccTagColorantOrder::GetData ( int index)
inline

Definition at line 1369 of file IccTagBasic.h.

1369{ return &m_pData[index]; }

◆ GetSize()

icUInt32Number CIccTagColorantOrder::GetSize ( ) const
inline

Definition at line 1371 of file IccTagBasic.h.

1371{return m_nCount;}

◆ GetType()

virtual icTagTypeSignature CIccTagColorantOrder::GetType ( ) const
inlinevirtual

Function: GetType()

Purpose: Get Tag Type. Each derived tag will implement it's own GetType() function.

Reimplemented from CIccTag.

Definition at line 1361 of file IccTagBasic.h.

1361{ return icSigColorantOrderType; }
@ icSigColorantOrderType

References icSigColorantOrderType.

◆ NewCopy()

virtual CIccTag * CIccTagColorantOrder::NewCopy ( ) const
inlinevirtual

Function: NewCopy(sDescription) Each derived tag will implement it's own NewCopy() function.

Parameter(s): none

Returns a new CIccTag object that is a copy of this object.

Reimplemented from CIccTag.

Definition at line 1358 of file IccTagBasic.h.

1358{return new CIccTagColorantOrder(*this);}
CIccTagColorantOrder(int nsize=1)
Name: CIccTagColorantOrder::CIccTagColorantOrder.

◆ operator=()

CIccTagColorantOrder & CIccTagColorantOrder::operator= ( const CIccTagColorantOrder & ColorantOrderTag)

Name: CIccTagColorantOrder::operator=.

Purpose: Copy Operator

Args: ColorantOrderTag = The CIccTagColorantOrder object to be copied

Definition at line 8304 of file IccTagBasic.cpp.

8305{
8306 if (&ColorantOrderTag == this)
8307 return *this;
8308
8309 m_nCount = ColorantOrderTag.m_nCount;
8310
8311 if (m_pData)
8312 free(m_pData);
8313 m_pData = (icUInt8Number*)calloc(m_nCount, sizeof(icUInt8Number));
8314 memcpy(m_pData, ColorantOrderTag.m_pData, sizeof(icUInt8Number)*m_nCount);
8315
8316 return *this;
8317}

References m_nCount, and m_pData.

◆ operator[]()

icUInt8Number & CIccTagColorantOrder::operator[] ( int index)
inline

Definition at line 1368 of file IccTagBasic.h.

1368{ return m_pData[index]; }

◆ Read()

bool CIccTagColorantOrder::Read ( icUInt32Number size,
CIccIO * pIO )
virtual

Name: CIccTagColorantOrder::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

Reimplemented from CIccTag.

Definition at line 8350 of file IccTagBasic.cpp.

8351{
8353 icUInt32Number nCount;
8354
8355 if (sizeof(icTagTypeSignature) +
8356 sizeof(icUInt32Number) +
8357 sizeof(icUInt32Number) > size)
8358 return false;
8359
8360 if (!pIO) {
8361 return false;
8362 }
8363
8364 if (!pIO->Read32(&sig))
8365 return false;
8366
8367 if (!pIO->Read32(&m_nReserved))
8368 return false;
8369
8370 if (!pIO->Read32(&nCount))
8371 return false;
8372
8373 icUInt32Number nNum = (size - 3*sizeof(icUInt32Number))/sizeof(icUInt8Number);
8374
8375 if (nNum < nCount)
8376 return false;
8377
8378 if (!SetSize((icUInt16Number)nCount))
8379 return false;
8380
8381 if (pIO->Read8(&m_pData[0], m_nCount) != (icInt32Number)m_nCount)
8382 return false;
8383
8384 return true;
8385}
icArraySignature sig
icTagTypeSignature
unsigned int icUInt32Number
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
bool SetSize(icUInt16Number nsize, bool bZeronew=true)
Name: CIccTagColorantOrder::SetSize.
icUInt32Number m_nReserved
unsigned short icUInt16Number
long icInt32Number

References CIccIO::Read32(), CIccIO::Read8(), and sig.

+ Here is the call graph for this function:

◆ SetSize()

bool CIccTagColorantOrder::SetSize ( icUInt16Number nSize,
bool bZeroNew = true )

Name: CIccTagColorantOrder::SetSize.

Purpose: Sets the size of the data array.

Args: nSize - number of channels, bZeroNew - flag to zero newly formed values

Definition at line 8462 of file IccTagBasic.cpp.

8463{
8464 if (m_nCount == nSize)
8465 return true;
8466
8468
8469 if (!m_pData) {
8470 m_nCount = 0;
8471 return false;
8472 }
8473
8474 if (bZeroNew && nSize > m_nCount) {
8475 memset(&m_pData[m_nCount], 0, (nSize - m_nCount)*sizeof(icUInt8Number));
8476 }
8477
8478 m_nCount = nSize;
8479
8480 return true;
8481}
void * icRealloc(void *ptr, size_t size)
Name: icRealloc.
Definition IccUtil.cpp:111

References icRealloc().

+ Here is the call graph for this function:

◆ Validate()

icValidateStatus CIccTagColorantOrder::Validate ( std::string sigPath,
std::string & sReport,
const CIccProfile * pProfile = NULL ) const
virtual

Name: CIccTagColorantOrder::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.

Reimplemented from CIccTag.

Definition at line 8498 of file IccTagBasic.cpp.

8499{
8500 icValidateStatus rv = CIccTag::Validate(sigPath, sReport, pProfile);
8501
8502 CIccInfo Info;
8503 std::string sSigPathName = Info.GetSigPathName(sigPath);
8504
8505 if (!pProfile) {
8506 sReport += icMsgValidateWarning;
8507 sReport += sSigPathName;
8508 sReport += " - Tag validation incomplete: Pointer to profile unavailable.\n";
8510 return rv;
8511 }
8512
8513 if (sigPath==icGetSigPath(icSigColorantTableTag)) {
8514 if (m_nCount != icGetSpaceSamples(pProfile->m_Header.colorSpace)) {
8515 sReport += icMsgValidateNonCompliant;
8516 sReport += sSigPathName;
8517 sReport += " - Incorrect number of colorants.\n";
8519 }
8520 }
8521 else if (sigPath==icGetSigPath(icSigColorantTableOutTag)) {
8522 if (m_nCount != icGetSpaceSamples(pProfile->m_Header.pcs)) {
8523 sReport += icMsgValidateNonCompliant;
8524 sReport += sSigPathName;
8525 sReport += " - Incorrect number of colorants.\n";
8527 }
8528 }
8529 else {
8530 sReport += icMsgValidateWarning;
8531 sReport += sSigPathName;
8532 sReport += " - Unknown number of required colorants.\n";
8534 }
8535
8536 return rv;
8537}
icValidateStatus
Definition IccDefs.h:118
@ icValidateWarning
Definition IccDefs.h:120
@ icValidateNonCompliant
Definition IccDefs.h:121
icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Name: icMaxStatus.
Definition IccUtil.cpp:244
std::string icGetSigPath(icUInt32Number nSig)
Definition IccUtil.cpp:1191
const char * icMsgValidateWarning
Definition IccUtil.cpp:90
icUInt32Number icGetSpaceSamples(icColorSpaceSignature sig)
Definition IccUtil.cpp:1303
const char * icMsgValidateNonCompliant
Definition IccUtil.cpp:91
Type: Class.
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614
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.
@ icSigColorantTableTag
@ icSigColorantTableOutTag

References CIccInfo::GetSigPathName(), icGetSigPath(), icGetSpaceSamples(), icMaxStatus(), icMsgValidateNonCompliant, icMsgValidateWarning, icSigColorantTableOutTag, icSigColorantTableTag, icValidateNonCompliant, icValidateWarning, and CIccTag::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccTagColorantOrder::Write ( CIccIO * pIO)
virtual

Name: CIccTagColorantOrder::Write.

Purpose: Write the tag to a file

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

Return: true = succesful, false = failure

Reimplemented from CIccTag.

Definition at line 8402 of file IccTagBasic.cpp.

8403{
8405
8406 if (!pIO)
8407 return false;
8408
8409 if (!pIO->Write32(&sig))
8410 return false;
8411
8412 if (!pIO->Write32(&m_nReserved))
8413 return false;
8414
8415 if (!pIO->Write32(&m_nCount))
8416 return false;
8417
8418 if (pIO->Write8(&m_pData[0], m_nCount) != (icInt32Number)m_nCount)
8419 return false;
8420
8421 return true;
8422}
virtual icInt32Number Write8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:105
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
virtual icTagTypeSignature GetType() const
Function: GetType()

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

+ Here is the call graph for this function:

Member Data Documentation

◆ m_nCount

icUInt32Number CIccTagColorantOrder::m_nCount
protected

Definition at line 1375 of file IccTagBasic.h.

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

◆ m_pData

icUInt8Number* CIccTagColorantOrder::m_pData
protected

Definition at line 1376 of file IccTagBasic.h.

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


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