IccMAX 2.1.27
Color Profile Tools
Loading...
Searching...
No Matches
CIccTagXmlGamutBoundaryDesc Class Reference

#include <IccTagXml.h>

+ Inheritance diagram for CIccTagXmlGamutBoundaryDesc:
+ Collaboration diagram for CIccTagXmlGamutBoundaryDesc:

Public Member Functions

virtual ~CIccTagXmlGamutBoundaryDesc ()
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
virtual void DetachIO ()
 
virtual const icCharGetClassName () const
 
virtual IIccExtensionTagGetExtension ()
 
virtual const char * GetGlassName () const
 
icInt32Number getNumberOfTriangles ()
 
icInt32Number getNumberOfVertices ()
 
icInt16Number getNumDeviceChannels ()
 
icInt16Number getNumPCSChannels ()
 
virtual icArraySignature GetTagArrayType () const
 
virtual icStructSignature GetTagStructType () const
 
bool getTriangle (icInt32Number triangleNumber, icGamutBoundaryTriangle &triangle)
 
virtual icTagTypeSignature GetType () const
 
icFloatNumbergetVertexDeviceCoord (icInt32Number vertexNumber)
 
icFloatNumbergetVertexPCSCoord (icInt32Number vertexNumber)
 
virtual bool IsArrayType ()
 
virtual bool IsMBBType ()
 
virtual bool IsNumArrayType () const
 
virtual bool IsSupported ()
 
virtual CIccTagNewCopy () const
 
virtual bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO, CIccProfile *pProfile)
 
virtual bool ReadAll ()
 
bool setTriangle (icInt32Number triangleNumber, icGamutBoundaryTriangle &triangle)
 
bool setVertex (icInt32Number vertexNumber, icFloatNumber *pcsCoords, icFloatNumber *deviceCoords=NULL)
 
virtual bool ToXml (std::string &xml, std::string blanks="")
 
icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile) const
 
virtual bool Write (CIccIO *pIO)
 

Static Public Member Functions

static CIccTagCreate (icTagTypeSignature sig)
 

Data Fields

icUInt32Number m_nReserved
 

Protected Attributes

icFloatNumberm_DeviceValues
 
icInt16Number m_nDeviceChannels
 
icInt16Number m_nPCSChannels
 
icInt32Number m_NumberOfTriangles
 
icInt32Number m_NumberOfVertices
 
icFloatNumberm_PCSValues
 
icGamutBoundaryTrianglem_Triangles
 

Private Member Functions

virtual const char * GetExtClassName () const
 
virtual const char * GetExtDerivedClassName () const
 

Detailed Description

Constructor & Destructor Documentation

◆ ~CIccTagXmlGamutBoundaryDesc()

virtual CIccTagXmlGamutBoundaryDesc::~CIccTagXmlGamutBoundaryDesc ( )
inlinevirtual
673{}

Member Function Documentation

◆ Create()

CIccTag * CIccTag::Create ( icTagTypeSignature  sig)
staticinherited

Name: CIccTag::Create

Purpose: This is a static tag creator based upon tag signature type

Args: sig = tag type signature

Return: Pointer to Allocated tag

144{
145 return CIccTagCreator::CreateTag(sig);
146}
static CIccTag * CreateTag(icTagTypeSignature tagTypeSig)
Definition IccTagFactory.h:279

References CIccTagCreator::CreateTag().

Referenced by CIccDefaultEncProfileConverter::ConvertFromParams(), CIccTagStruct::LoadElem(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), CIccTagXmlArray::ParseXml(), CIccMpeTintArray::Read(), CIccTagLutAtoB::Read(), CIccTagLut8::Read(), CIccTagLut16::Read(), CIccTagLut8::SetColorSpaces(), CIccTagLut16::SetColorSpaces(), and CIccProfileDescText::SetType().

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

◆ Describe()

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

Name: CIccTagGamutBoundaryDescription::Describe

Purpose: Dump data associated with gamut boundary tag to a string

Args: sDescription - string to concatenate tag dump to

Reimplemented from CIccTag.

5635{
5636 icChar buf[256];
5637
5638 sprintf(buf,"Number Of Vertices = %d, Number of Triangles = %d\n",m_NumberOfVertices,m_NumberOfTriangles);
5639 sDescription += buf;
5640
5641 sprintf(buf,"Number Of Inputs = %d, Number of Outputs = %d\n",m_nPCSChannels,m_nDeviceChannels);
5642 sDescription += buf;
5643
5644 if (nVerboseness > 75) {
5645 int c = 0;
5646 int d = 0;
5647 for (int i=0; i<m_NumberOfVertices; i++)
5648 {
5649 sprintf(buf,"V = %d:\t",i);
5650 sDescription += buf;
5651 for (int j=0; j<m_nPCSChannels; j++)
5652 {
5653 sprintf(buf,"%.4lf\t",m_PCSValues[c++]);
5654 sDescription += buf;
5655 }
5656 if (m_nDeviceChannels > 0)
5657 {
5658 sprintf(buf,":\t");
5659 sDescription += buf;
5660
5661 for (int j=0; j<m_nDeviceChannels; j++)
5662 {
5663 sprintf(buf,"%.4lf\t",m_DeviceValues[d++]);
5664 sDescription += buf;
5665 }
5666 }
5667 sprintf(buf,"\n");
5668 sDescription += buf;
5669 }
5670
5671 for (int i=0; i<m_NumberOfTriangles; i++)
5672 {
5673 sprintf(buf,"V1 = %u\tV2 = %u\tV3 = %u\n",m_Triangles[i].m_VertexNumbers[0],m_Triangles[i].m_VertexNumbers[1],m_Triangles[i].m_VertexNumbers[2]);
5674 sDescription += buf;
5675 }
5676 }
5677}
char icChar
Definition IccDefs.h:110
icGamutBoundaryTriangle * m_Triangles
Definition IccTagLut.h:664
icInt32Number m_NumberOfTriangles
Definition IccTagLut.h:659
icInt16Number m_nPCSChannels
Definition IccTagLut.h:660
icFloatNumber * m_DeviceValues
Definition IccTagLut.h:663
icFloatNumber * m_PCSValues
Definition IccTagLut.h:662
icInt16Number m_nDeviceChannels
Definition IccTagLut.h:661
icInt32Number m_NumberOfVertices
Definition IccTagLut.h:658

References CIccTagGamutBoundaryDesc::m_DeviceValues, CIccTagGamutBoundaryDesc::m_nDeviceChannels, CIccTagGamutBoundaryDesc::m_nPCSChannels, CIccTagGamutBoundaryDesc::m_NumberOfTriangles, CIccTagGamutBoundaryDesc::m_NumberOfVertices, CIccTagGamutBoundaryDesc::m_PCSValues, CIccTagGamutBoundaryDesc::m_Triangles, and icGamutBoundaryTriangle::m_VertexNumbers.

◆ DetachIO()

virtual void CIccTag::DetachIO ( )
inlinevirtualinherited

Function: ReadAll() - Read All sub data for tag from file. Called by CIccProfile::ReadAll() to read all sub data for tag

Returns true if ReadAll is successful.

183{}

◆ GetClassName()

virtual const icChar * CIccTagGamutBoundaryDesc::GetClassName ( ) const
inlinevirtualinherited

Reimplemented from CIccTag.

622{ return "icSigTagGamutBoundaryDesc"; }

◆ GetExtClassName()

virtual const char * CIccTagXml::GetExtClassName ( ) const
inlinevirtualinherited

Implements IIccExtensionTag.

79{ return "CIccTagXml"; }

Referenced by icProfDescToXml(), and icXmlParseProfDesc().

+ Here is the caller graph for this function:

◆ GetExtDerivedClassName()

virtual const char * CIccTagXml::GetExtDerivedClassName ( ) const
inlinevirtualinherited

Implements IIccExtensionTag.

Reimplemented in CIccCurveXml.

80{ return ""; }

◆ GetExtension()

virtual IIccExtensionTag * CIccTagXmlGamutBoundaryDesc::GetExtension ( )
inlinevirtual

Reimplemented from CIccTag.

677{return this; }

◆ GetGlassName()

virtual const char * CIccTagXmlGamutBoundaryDesc::GetGlassName ( ) const
inlinevirtual
675{return "CIccTagXmlGamutBoundaryDesc"; }

◆ getNumberOfTriangles()

icInt32Number CIccTagGamutBoundaryDesc::getNumberOfTriangles ( )
inlineinherited

◆ getNumberOfVertices()

icInt32Number CIccTagGamutBoundaryDesc::getNumberOfVertices ( )
inlineinherited

◆ getNumDeviceChannels()

icInt16Number CIccTagGamutBoundaryDesc::getNumDeviceChannels ( )
inlineinherited

◆ getNumPCSChannels()

icInt16Number CIccTagGamutBoundaryDesc::getNumPCSChannels ( )
inlineinherited
648 {
649 return m_nPCSChannels;
650 }

References CIccTagGamutBoundaryDesc::m_nPCSChannels.

◆ GetTagArrayType()

virtual icArraySignature CIccTag::GetTagArrayType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagArray.

133{ return icSigUndefinedArray; }
@ icSigUndefinedArray
Definition icProfileHeader.h:617

References icSigUndefinedArray.

Referenced by icGetTagArrayHandlerOfType(), and CIccProfileXml::ParseTag().

+ Here is the caller graph for this function:

◆ GetTagStructType()

virtual icStructSignature CIccTag::GetTagStructType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagStruct.

132{ return icSigUndefinedStruct; }
@ icSigUndefinedStruct
Definition icProfileHeader.h:606

References icSigUndefinedStruct.

Referenced by icGetTagStructHandlerOfType(), CIccArrayColorantInfo::Validate(), and CIccArrayNamedColor::Validate().

+ Here is the caller graph for this function:

◆ getTriangle()

bool CIccTagGamutBoundaryDesc::getTriangle ( icInt32Number  triangleNumber,
icGamutBoundaryTriangle triangle 
)
inherited

Name: CIccTagGamutBoundaryDescription::getTriangle

Purpose: Dump data associated with gamut boundary tag to a string

Args: triangleNumber = the number of the triangle to set triangle = the triangle to copy from the gamut boundary

Return: true = succesful, false = failure

5792{
5793 if ((triangleNumber < 0) || (triangleNumber >= m_NumberOfTriangles))
5794 return false;
5795
5796 memcpy(&triangle,&m_Triangles[triangleNumber],sizeof(icGamutBoundaryTriangle));
5797 return true;
5798}
Definition IccTagLut.h:600

References CIccTagGamutBoundaryDesc::m_NumberOfTriangles, and CIccTagGamutBoundaryDesc::m_Triangles.

◆ GetType()

virtual icTagTypeSignature CIccTagGamutBoundaryDesc::GetType ( ) const
inlinevirtualinherited

Function: GetType()

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

Reimplemented from CIccTag.

@ icSigGamutBoundaryDescType
Definition icProfileHeader.h:543

References icSigGamutBoundaryDescType.

Referenced by CIccTagGamutBoundaryDesc::Write().

+ Here is the caller graph for this function:

◆ getVertexDeviceCoord()

icFloatNumber * CIccTagGamutBoundaryDesc::getVertexDeviceCoord ( icInt32Number  vertexNumber)
inherited

Name: CIccTagGamutBoundaryDescription::getVertexDeviceCoord

Purpose: Dump data associated with gamut boundaty tag to a string

Args: vertexNumber = the number of the vertex to get

Return: NULL = failure, otherwise a pointer to the device coordinate

5742{
5743 if ((vertexNumber < 0) || (vertexNumber >= m_NumberOfVertices))
5744 return NULL;
5745
5746 if (!m_DeviceValues)
5747 return NULL;
5748
5749 return &m_DeviceValues[vertexNumber*m_nDeviceChannels];
5750}

References CIccTagGamutBoundaryDesc::m_DeviceValues, CIccTagGamutBoundaryDesc::m_nDeviceChannels, and CIccTagGamutBoundaryDesc::m_NumberOfVertices.

◆ getVertexPCSCoord()

icFloatNumber * CIccTagGamutBoundaryDesc::getVertexPCSCoord ( icInt32Number  vertexNumber)
inherited

Name: CIccTagGamutBoundaryDescription::getVertexPCSCoord

Purpose: Dump data associated with gamut boundary tag to a string

Args: vertexNumber = the number of the vertex to get

Return: NULL = failure, otherwise a pointer to the PCS coordinate

5721{
5722 if ((vertexNumber < 0) || (vertexNumber >= m_NumberOfVertices))
5723 return NULL;
5724
5725 return &m_PCSValues[vertexNumber*m_nPCSChannels];
5726}

References CIccTagGamutBoundaryDesc::m_nPCSChannels, CIccTagGamutBoundaryDesc::m_NumberOfVertices, and CIccTagGamutBoundaryDesc::m_PCSValues.

◆ IsArrayType()

virtual bool CIccTag::IsArrayType ( )
inlinevirtualinherited

Reimplemented in CIccTagXYZ, CIccTagChromaticity, CIccTagSparseMatrixArray, CIccTagFixedNum< T, Tsig >, CIccTagNum< T, Tsig >, CIccTagFloatNum< T, Tsig >, and CIccTagData.

135{ return false; }

Referenced by MyTagDialog::MyTagDialog(), and DumpTag().

+ Here is the caller graph for this function:

◆ IsMBBType()

virtual bool CIccTag::IsMBBType ( )
inlinevirtualinherited

Reimplemented in CIccMBB.

136{ return false; } //If true then CIccTag can be cast as an CIccMBB

Referenced by CIccProfileXml::ParseTag().

+ Here is the caller graph for this function:

◆ IsNumArrayType()

virtual bool CIccTag::IsNumArrayType ( ) const
inlinevirtualinherited

Reimplemented in CIccTagSparseMatrixArray, CIccTagFixedNum< T, Tsig >, CIccTagNum< T, Tsig >, and CIccTagFloatNum< T, Tsig >.

137{ return false;} //If true then CIccTag can be cast as a CIccTagNumArray

Referenced by CIccArrayNamedColor::FindDeviceColor(), CIccArrayNamedColor::FindPcsColor(), CIccArrayNamedColor::FindSpectralColor(), CIccTagStruct::GetElemNumberValue(), CIccStructNamedColor::GetNumArray(), CIccMpeXmlTintArray::ParseXml(), and CIccMpeTintArray::Read().

+ Here is the caller graph for this function:

◆ IsSupported()

virtual bool CIccTag::IsSupported ( )
inlinevirtualinherited

Function: IsSupported(size, pIO) - Check if tag fully supported for apply purposes. By Default inherited classes are supported. Unknown tag types are not supported.

Returns true if tag type is supported.

Reimplemented in CIccTagUnknown, CIccTagEmbeddedProfile, and CIccTagMultiProcessElement.

153{ return true; }

◆ NewCopy()

virtual CIccTag * CIccTagGamutBoundaryDesc::NewCopy ( ) const
inlinevirtualinherited

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.

618{return new CIccTagGamutBoundaryDesc(*this);}
CIccTagGamutBoundaryDesc()
Definition IccTagLut.cpp:5325

References CIccTagGamutBoundaryDesc::CIccTagGamutBoundaryDesc().

+ Here is the call graph for this function:

◆ ParseXml()

bool CIccTagXmlGamutBoundaryDesc::ParseXml ( xmlNode *  pNode,
std::string &  parseStr 
)
virtual

Implements CIccTagXml.

4949{
4950 // parse each tag
4951 xmlNode *childNode, *subNode;
4952
4953 childNode = icXmlFindNode(pNode, "Vertices");
4954 if (!childNode) {
4955 parseStr += "Cannot find Vertices\n";
4956 return false;
4957 }
4958
4959 subNode = icXmlFindNode(childNode->children, "PCSValues");
4960
4961 if (subNode) {
4962 m_nPCSChannels = atoi(icXmlAttrValue(subNode, "channels", "0"));
4963
4964 if (!m_nPCSChannels) {
4965 parseStr += "Bad PCSValues channels\n";
4966 return false;
4967 }
4968
4969 CIccFloatArray vals;
4970 if (!vals.ParseArray(subNode->children)) {
4971 parseStr += "Unable to parse GamutBoundaryDesc PCSValues\n";
4972 return false;
4973 }
4974
4976
4977 if (m_NumberOfVertices<4) {
4978 parseStr += "Must have at least 4 PCSValues vertices\n";
4979 return false;
4980 }
4981
4983
4984 if (!m_PCSValues)
4985 return false;
4986
4988 }
4989 else {
4990 parseStr += "Cannot find PCSValues\n";
4991 return false;
4992 }
4993
4994 subNode = icXmlFindNode(childNode->children, "DeviceValues");
4995
4996 if (subNode) {
4997 m_nDeviceChannels = atoi(icXmlAttrValue(subNode, "channels", "0"));
4998
4999 if (!m_nDeviceChannels) {
5000 parseStr += "Bad DeviceValues channels\n";
5001 return false;
5002 }
5003
5004 CIccFloatArray vals;
5005 if (!vals.ParseArray(subNode->children)) {
5006 parseStr += "Unable to parse GamutBoundaryDesc DeviceValues\n";
5007 return false;
5008 }
5009
5010 int nVertices = vals.GetSize() / m_nDeviceChannels;
5011
5012 if (m_NumberOfVertices != nVertices) {
5013 parseStr += "Number of Device vertices doesn't match PCS verticies\n";
5014 return false;
5015 }
5016
5018
5019 if (!m_DeviceValues)
5020 return false;
5021
5023 }
5024 else if (!m_PCSValues)
5026
5027 childNode = icXmlFindNode(pNode, "Triangles");
5028 if (!childNode) {
5029 parseStr += "Cannot find Triangles\n";
5030 return false;
5031 }
5032
5033 int nMaxIndex = 0, n=0;
5034 for (subNode = childNode->children; subNode; subNode = subNode->next) {
5035 if (subNode->type == XML_ELEMENT_NODE && !strcmp((icChar*)subNode->name, "T")) {
5036 nMaxIndex++;
5037 }
5038 }
5039 m_NumberOfTriangles = nMaxIndex;
5041
5042 n=0;
5043 for (subNode = childNode->children; subNode && n<nMaxIndex; subNode = subNode->next) {
5044 if (subNode->type == XML_ELEMENT_NODE && !strcmp((icChar*)subNode->name, "T")) {
5045 CIccUInt32Array ids;
5046
5047 if (!ids.ParseArray(subNode->children) || ids.GetSize()!=3) {
5048 parseStr += "Invalid Triangle entry\n";
5049 return false;
5050 }
5051 icUInt32Number *v = ids.GetBuf();
5052
5053 m_Triangles[n].m_VertexNumbers[0] = v[0];
5054 m_Triangles[n].m_VertexNumbers[1] = v[1];
5055 m_Triangles[n].m_VertexNumbers[2] = v[2];
5056
5057 n++;
5058 }
5059 }
5060
5061 return true;
5062}
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icUInt32Number m_VertexNumbers[3]
Definition IccTagLut.h:601
float icFloatNumber
Definition IccDefs.h:101
xmlNode * icXmlFindNode(xmlNode *pNode, const char *szNodeName)
Definition IccUtilXml.cpp:687
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault="")
Definition IccUtilXml.cpp:572
Definition IccUtilXml.h:145
static bool ParseArray(T *buf, icUInt32Number nBufSize, xmlNode *pNode)
Definition IccUtilXml.cpp:1034
T * GetBuf()
Definition IccUtilXml.h:165
icUInt32Number GetSize()
Definition IccUtilXml.h:166

References CIccXmlArrayType< T, Tsig >::GetBuf(), CIccXmlArrayType< T, Tsig >::GetSize(), icXmlAttrValue(), icXmlFindNode(), CIccTagGamutBoundaryDesc::m_DeviceValues, CIccTagGamutBoundaryDesc::m_nDeviceChannels, CIccTagGamutBoundaryDesc::m_nPCSChannels, CIccTagGamutBoundaryDesc::m_NumberOfTriangles, CIccTagGamutBoundaryDesc::m_NumberOfVertices, CIccTagGamutBoundaryDesc::m_PCSValues, CIccTagGamutBoundaryDesc::m_Triangles, icGamutBoundaryTriangle::m_VertexNumbers, and CIccXmlArrayType< T, Tsig >::ParseArray().

+ Here is the call graph for this function:

◆ Read() [1/2]

bool CIccTagGamutBoundaryDesc::Read ( icUInt32Number  size,
CIccIO pIO 
)
virtualinherited

Name: CIccTagGamutBoundaryDescription::Read

Purpose: Read in an gamut boundary tag type 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.

5485{
5487
5488 if (sizeof(icTagTypeSignature) +
5489 sizeof(icUInt32Number)*3 +
5490 sizeof(icUInt16Number)*2 > size)
5491 return false;
5492
5493 if (!pIO) {
5494 return false;
5495 }
5496
5497 if (!pIO->Read32(&sig) ||
5498 !pIO->Read32(&m_nReserved))
5499 return false;
5500
5501 if (!pIO->Read16(&m_nPCSChannels) ||
5502 !pIO->Read16(&m_nDeviceChannels))
5503 return false;
5504
5505 if (!pIO->Read32(&m_NumberOfVertices) ||
5507 return false;
5508
5509 if (sizeof(icTagTypeSignature) +
5510 sizeof(icUInt32Number)*3 +
5511 sizeof(icUInt16Number)*2 +
5515 return false;
5516
5517 if (m_PCSValues)
5518 delete [] m_PCSValues;
5519 if (m_DeviceValues)
5520 delete [] m_DeviceValues;
5521 if (m_Triangles)
5522 delete [] m_Triangles;
5523
5525
5526 if (!m_PCSValues)
5527 return false;
5528
5529 if (m_nDeviceChannels > 0)
5530 {
5532
5533 if (!m_DeviceValues)
5534 return false;
5535 }
5536 else
5537 {
5538 m_DeviceValues = NULL;
5539 }
5541
5543
5544 if (pIO->Read32(m_Triangles, nNum32)!=nNum32)
5545 return false;
5546
5548
5549 if (pIO->ReadFloat32Float(m_PCSValues, nNum32)!=nNum32)
5550 return false;
5551
5552 if (m_nDeviceChannels > 0)
5553 {
5555
5556 if (pIO->ReadFloat32Float(m_DeviceValues, nNum32)!=nNum32)
5557 return false;
5558 }
5559
5560 return true;
5561}
float icFloat32Number
Definition icProfileHeader.h:313
unsigned short icUInt16Number
Definition icProfileHeader.h:256
icTagTypeSignature
Definition icProfileHeader.h:526
icUInt32Number icUInt64Number[2]
Definition icProfileHeader.h:268
icInt32Number ReadFloat32Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:302
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:114
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
icUInt32Number m_nReserved
Definition IccTagBasic.h:235

References CIccTagGamutBoundaryDesc::m_DeviceValues, CIccTagGamutBoundaryDesc::m_nDeviceChannels, CIccTagGamutBoundaryDesc::m_nPCSChannels, CIccTag::m_nReserved, CIccTagGamutBoundaryDesc::m_NumberOfTriangles, CIccTagGamutBoundaryDesc::m_NumberOfVertices, CIccTagGamutBoundaryDesc::m_PCSValues, CIccTagGamutBoundaryDesc::m_Triangles, CIccIO::Read16(), CIccIO::Read32(), and CIccIO::ReadFloat32Float().

+ Here is the call graph for this function:

◆ Read() [2/2]

virtual bool CIccTag::Read ( icUInt32Number  size,
CIccIO pIO,
CIccProfile pProfile 
)
inlinevirtualinherited

Function: Read(size, pIO) - Read tag from file. Each derived tag will implement it's own Read() function.

Parameter(s): size - number of bytes in tag including the type signature. pIO - IO object used to read in tag. The IO object should already be initialized to point to the begining of the tag.

Returns true if Read is successful.

Reimplemented in CIccTagEmbeddedProfile.

197{ return Read(size, pIO); }
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Definition IccTagBasic.h:167

References CIccTag::Read().

+ Here is the call graph for this function:

◆ ReadAll()

virtual bool CIccTag::ReadAll ( )
inlinevirtualinherited

Function: ReadAll() - Read All sub data for tag from file. Called by CIccProfile::ReadAll() to read all sub data for tag

Returns true if ReadAll is successful.

Reimplemented in CIccTagEmbeddedProfile.

175{ return true; }

◆ setTriangle()

bool CIccTagGamutBoundaryDesc::setTriangle ( icInt32Number  triangleNumber,
icGamutBoundaryTriangle triangle 
)
inherited

Name: CIccTagGamutBoundaryDescription::setTriangle

Purpose: Dump data associated with gamut boundary tag to a string

Args: triangleNumber = the number of the triangle to set triangle = the triangle to copy into the gamut boundary

Return: true = succesful, false = failure

5767{
5768 if ((triangleNumber < 0) || (triangleNumber >= m_NumberOfTriangles))
5769 return false;
5770
5771 memcpy(&m_Triangles[triangleNumber],&triangle,sizeof(icGamutBoundaryTriangle));
5772
5773 return true;
5774}

References CIccTagGamutBoundaryDesc::m_NumberOfTriangles, and CIccTagGamutBoundaryDesc::m_Triangles.

◆ setVertex()

bool CIccTagGamutBoundaryDesc::setVertex ( icInt32Number  vertexNumber,
icFloatNumber pcsCoords,
icFloatNumber deviceCoords = NULL 
)
inherited

Name: CIccTagGamutBoundaryDescription::setVertex

Purpose: Dump data associated with gamut boundary tag to a string

Args: vertexNumber = the number of the vertex to set pcsCoords = the pcs coordinates of the vertex deviceCoords = the device coordinates of the vertex

Return: true = succesful, false = failure

5695{
5696 if ((vertexNumber < 0) || (vertexNumber >= m_NumberOfVertices))
5697 return false;
5698
5699 memcpy(&m_PCSValues[vertexNumber*m_nPCSChannels],pcsCoords,sizeof(icFloatNumber)*m_nPCSChannels);
5700 if ((m_DeviceValues) && (deviceCoords))
5701 memcpy(&m_DeviceValues[vertexNumber*m_nDeviceChannels],deviceCoords,sizeof(icFloatNumber)*m_nDeviceChannels);
5702
5703 return true;
5704}

References CIccTagGamutBoundaryDesc::m_DeviceValues, CIccTagGamutBoundaryDesc::m_nDeviceChannels, CIccTagGamutBoundaryDesc::m_nPCSChannels, CIccTagGamutBoundaryDesc::m_NumberOfVertices, and CIccTagGamutBoundaryDesc::m_PCSValues.

◆ ToXml()

bool CIccTagXmlGamutBoundaryDesc::ToXml ( std::string &  xml,
std::string  blanks = "" 
)
virtual

Implements CIccTagXml.

4910{
4911 std::string info;
4912 char line[256];
4913 int i;
4914
4916 xml += blanks + "<Vertices>\n";
4917
4918 if (m_PCSValues) {
4919 sprintf(line, " <PCSValues channels=\"%d\">\n", m_nPCSChannels);
4920 xml += blanks + line;
4922 xml += blanks + " </PCSValues>\n";
4923 }
4924 if (m_DeviceValues) {
4925 sprintf(line, " <DeviceValues channels=\"%d\">\n", m_nDeviceChannels);
4926 xml += blanks + line;
4928 xml += blanks + " </DeviceValues>\n";
4929 }
4930 xml += blanks + "</Vertices>\n";
4931 }
4932
4934 xml += blanks + "<Triangles>\n";
4935
4936 for (i=0; i<m_NumberOfTriangles; i++) {
4937 sprintf(line, " <T>%u %u %u</T>\n", m_Triangles[i].m_VertexNumbers[0], m_Triangles[i].m_VertexNumbers[1], m_Triangles[i].m_VertexNumbers[2]);
4938 xml += blanks + line;
4939 }
4940
4941 xml += blanks + "</Triangles>\n";
4942 }
4943
4944 return true;
4945}
@ icConvertFloat
Definition IccXmlConfig.h:70
static bool DumpArray(std::string &xml, std::string blanks, T *buf, icUInt32Number nBufSize, icConvertType nType, icUInt8Number nColumns)
Definition IccUtilXml.cpp:820

References CIccXmlArrayType< T, Tsig >::DumpArray(), icConvertFloat, CIccTagGamutBoundaryDesc::m_DeviceValues, CIccTagGamutBoundaryDesc::m_nDeviceChannels, CIccTagGamutBoundaryDesc::m_nPCSChannels, CIccTagGamutBoundaryDesc::m_NumberOfTriangles, CIccTagGamutBoundaryDesc::m_NumberOfVertices, CIccTagGamutBoundaryDesc::m_PCSValues, CIccTagGamutBoundaryDesc::m_Triangles, and icGamutBoundaryTriangle::m_VertexNumbers.

+ Here is the call graph for this function:

◆ Validate()

icValidateStatus CIccTagGamutBoundaryDesc::Validate ( std::string  sigPath,
std::string &  sReport,
const CIccProfile pProfile 
) const
virtualinherited

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

5817{
5818 icValidateStatus rv = CIccTag::Validate(sigPath, sReport, pProfile);
5819
5820 CIccInfo Info;
5821 std::string sSigPathName = Info.GetSigPathName(sigPath);
5822
5823 if ((m_NumberOfVertices == 0) || (m_NumberOfTriangles == 0) || (m_nPCSChannels < 3)) {
5824 sReport += icMsgValidateWarning;
5825 sReport += sSigPathName;
5826 sReport += " - Invalid tag.\n";
5827
5829 return rv;
5830 }
5831
5832 return rv;
5833}
icValidateStatus
Definition IccDefs.h:119
@ icValidateWarning
Definition IccDefs.h:121
ICCPROFLIB_API const char * icMsgValidateWarning
Definition IccUtil.cpp:90
ICCPROFLIB_API icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Definition IccUtil.cpp:244
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
Definition IccTagBasic.cpp:164

References CIccInfo::GetSigPathName(), icMaxStatus(), icMsgValidateWarning, icValidateWarning, CIccTagGamutBoundaryDesc::m_nPCSChannels, CIccTagGamutBoundaryDesc::m_NumberOfTriangles, CIccTagGamutBoundaryDesc::m_NumberOfVertices, and CIccTag::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccTagGamutBoundaryDesc::Write ( CIccIO pIO)
virtualinherited

Name: CIccTagGamutBoundaryDescription::Write

Purpose: Write a gamut boundary type tag to a file

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

Return: true = succesful, false = failure

Reimplemented from CIccTag.

5577{
5578
5580
5581 if (!pIO) {
5582 return false;
5583 }
5584
5585 icUInt32Number startPos = pIO->GetLength();
5586
5587 if (!pIO->Write32(&sig) ||
5588 !pIO->Write32(&m_nReserved))
5589 return false;
5590
5591
5592 if (!pIO->Write16(&m_nPCSChannels) ||
5593 !pIO->Write16(&m_nDeviceChannels))
5594 return false;
5595
5596 if (!pIO->Write32(&m_NumberOfVertices) ||
5598 return false;
5599
5601
5602 if (pIO->Write32(m_Triangles, nNum32)!=nNum32)
5603 return false;
5604
5605
5607
5608 if (pIO->WriteFloat32Float(m_PCSValues, nNum32)!=nNum32)
5609 return false;
5610
5611 if (m_nDeviceChannels > 0)
5612 {
5614
5615 if (pIO->WriteFloat32Float(m_DeviceValues, nNum32)!=nNum32)
5616 return false;
5617 }
5618
5619 return true;
5620
5621}
virtual icInt32Number GetLength()
Definition IccIO.h:130
icInt32Number Write16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:122
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
icInt32Number WriteFloat32Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:321
virtual icTagTypeSignature GetType() const
Definition IccTagLut.h:621

References CIccIO::GetLength(), CIccTagGamutBoundaryDesc::GetType(), CIccTagGamutBoundaryDesc::m_DeviceValues, CIccTagGamutBoundaryDesc::m_nDeviceChannels, CIccTagGamutBoundaryDesc::m_nPCSChannels, CIccTag::m_nReserved, CIccTagGamutBoundaryDesc::m_NumberOfTriangles, CIccTagGamutBoundaryDesc::m_NumberOfVertices, CIccTagGamutBoundaryDesc::m_PCSValues, CIccTagGamutBoundaryDesc::m_Triangles, CIccIO::Write16(), CIccIO::Write32(), and CIccIO::WriteFloat32Float().

+ Here is the call graph for this function:

Field Documentation

◆ m_DeviceValues

◆ m_nDeviceChannels

◆ m_nPCSChannels

◆ m_nReserved

icUInt32Number CIccTag::m_nReserved
inherited

Referenced by CIccTag::CIccTag(), CIccTagMultiProcessElement::CIccTagMultiProcessElement(), CIccTagMultiProcessElement::CIccTagMultiProcessElement(), CIccTagMultiProcessElement::operator=(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), CIccTagXmlArray::ParseXml(), CIccTagText::Read(), CIccTagUtf8Text::Read(), CIccTagZipUtf8Text::Read(), CIccTagUtf16Text::Read(), CIccTagTextDescription::Read(), CIccTagSignature::Read(), CIccTagNamedColor2::Read(), CIccTagXYZ::Read(), CIccTagChromaticity::Read(), CIccTagCicp::Read(), CIccTagSparseMatrixArray::Read(), CIccTagFixedNum< T, Tsig >::Read(), CIccTagNum< T, Tsig >::Read(), CIccTagFloatNum< T, Tsig >::Read(), CIccTagMeasurement::Read(), CIccTagMultiLocalizedUnicode::Read(), CIccTagData::Read(), CIccTagDateTime::Read(), CIccTagColorantOrder::Read(), CIccTagColorantTable::Read(), CIccTagViewingConditions::Read(), CIccTagProfileSeqDesc::Read(), CIccTagResponseCurveSet16::Read(), CIccTagSpectralDataInfo::Read(), CIccTagSpectralViewingConditions::Read(), CIccTagEmbeddedHeightImage::Read(), CIccTagEmbeddedNormalImage::Read(), CIccTagStruct::Read(), CIccTagArray::Read(), CIccTagDict::Read(), CIccTagCurve::Read(), CIccTagParametricCurve::Read(), CIccTagLutAtoB::Read(), CIccTagLut8::Read(), CIccTagLut16::Read(), CIccTagGamutBoundaryDesc::Read(), CIccTagMultiProcessElement::Read(), CIccTagProfileSequenceId::Read(), CIccTagEmbeddedProfile::Read(), CIccTag::Validate(), CIccTagText::Write(), CIccTagUtf8Text::Write(), CIccTagZipUtf8Text::Write(), CIccTagUtf16Text::Write(), CIccTagTextDescription::Write(), CIccTagSignature::Write(), CIccTagNamedColor2::Write(), CIccTagXYZ::Write(), CIccTagChromaticity::Write(), CIccTagCicp::Write(), CIccTagSparseMatrixArray::Write(), CIccTagFixedNum< T, Tsig >::Write(), CIccTagNum< T, Tsig >::Write(), CIccTagFloatNum< T, Tsig >::Write(), CIccTagMeasurement::Write(), CIccTagMultiLocalizedUnicode::Write(), CIccTagData::Write(), CIccTagDateTime::Write(), CIccTagColorantOrder::Write(), CIccTagColorantTable::Write(), CIccTagViewingConditions::Write(), CIccTagProfileSeqDesc::Write(), CIccTagResponseCurveSet16::Write(), CIccTagSpectralDataInfo::Write(), CIccTagSpectralViewingConditions::Write(), CIccTagEmbeddedHeightImage::Write(), CIccTagEmbeddedNormalImage::Write(), CIccTagStruct::Write(), CIccTagArray::Write(), CIccTagDict::Write(), CIccTagEmbeddedProfile::Write(), CIccTagCurve::Write(), CIccTagParametricCurve::Write(), CIccTagLutAtoB::Write(), CIccTagLut8::Write(), CIccTagLut16::Write(), CIccTagGamutBoundaryDesc::Write(), CIccTagMultiProcessElement::Write(), and CIccTagProfileSequenceId::Write().

◆ m_NumberOfTriangles

◆ m_NumberOfVertices

◆ m_PCSValues

◆ m_Triangles


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