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

#include <IccTagXml.h>

+ Inheritance diagram for CIccTagXmlEmbeddedHeightImage:
+ Collaboration diagram for CIccTagXmlEmbeddedHeightImage:

Public Member Functions

virtual IIccExtensionTagGetExtension ()
 
virtual const char * GetGlassName () const
 
virtual bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
virtual bool ToXml (std::string &xml, std::string blanks="")
 
virtual ~CIccTagXmlEmbeddedHeightImage ()
 
- Public Member Functions inherited from CIccTagEmbeddedHeightImage
 CIccTagEmbeddedHeightImage (const CIccTagEmbeddedHeightImage &IEHI)
 Name: CIccTagEmbeddedHeightImage::CIccTagEmbeddedHeightImage.
 
 CIccTagEmbeddedHeightImage (int nSize=1)
 Name: CIccEmbeddedHeightImage::CIccEmbeddedHeightImage.
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccTagEmbeddedHeightImage::Describe.
 
virtual const icCharGetClassName () const
 
icUInt8NumberGetData (icUInt32Number index=0)
 
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.
 
CIccTagEmbeddedHeightImageoperator= (const CIccTagEmbeddedHeightImage &HeightTag)
 Name: CIccTagEmbeddedHeightImage::operator=.
 
icUInt8Numberoperator[] (icUInt32Number index)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccTagEmbeddedHeightImage::Read.
 
bool SetSize (icUInt32Number nSize, bool bZeroNew=true)
 Name: CIccTagEmbeddedHeightImage::SetSize.
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 Name: CIccTagEmbeddedHeightImage::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccTagEmbeddedHeightImage::Write.
 
virtual ~CIccTagEmbeddedHeightImage ()
 Name: CIccTagEmbeddedHeightImage::~CIccTagEmbeddedHeightImage.
 
- Public Member Functions inherited from CIccTag
 CIccTag ()
 Name: CIccTag::CIccTag.
 
virtual void DetachIO ()
 Function: ReadAll() - Read All sub data for tag from file.
 
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.
 

Additional Inherited Members

- Static Public Member Functions inherited from CIccTag
static CIccTagCreate (icTagTypeSignature sig)
 Name: CIccTag::Create.
 
- Public Attributes inherited from CIccTagEmbeddedHeightImage
icFloatNumber m_fMetersMaxPixelValue
 
icFloatNumber m_fMetersMinPixelValue
 
icImageEncodingType m_nEncodingFormat
 
icUInt32Number m_nSeamlesIndicator
 
- Public Attributes inherited from CIccTag
icUInt32Number m_nReserved
 
- Protected Attributes inherited from CIccTagEmbeddedHeightImage
icUInt32Number m_nSize
 
icUInt8Numberm_pData
 
- Private Member Functions inherited from CIccTagXml
virtual const char * GetExtClassName () const
 
virtual const char * GetExtDerivedClassName () const
 
virtual ~CIccTagXml (void)
 

Detailed Description

Definition at line 684 of file IccTagXml.h.

Constructor & Destructor Documentation

◆ ~CIccTagXmlEmbeddedHeightImage()

virtual CIccTagXmlEmbeddedHeightImage::~CIccTagXmlEmbeddedHeightImage ( )
inlinevirtual

Definition at line 687 of file IccTagXml.h.

687{}

Member Function Documentation

◆ GetExtension()

virtual IIccExtensionTag * CIccTagXmlEmbeddedHeightImage::GetExtension ( )
inlinevirtual

Reimplemented from CIccTag.

Definition at line 691 of file IccTagXml.h.

691{ return this; }

◆ GetGlassName()

virtual const char * CIccTagXmlEmbeddedHeightImage::GetGlassName ( ) const
inlinevirtual

Definition at line 689 of file IccTagXml.h.

689{ return "CIccTagXmlEmbeddedHeightImage"; }

◆ ParseXml()

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

Implements CIccTagXml.

Definition at line 5080 of file IccTagXml.cpp.

5081{
5082 // parse tag
5083 xmlNode *tagNode;
5084
5085 tagNode = icXmlFindNode(pNode, "HeightImage");
5086 if (!tagNode)
5087 return false;
5088
5089 m_nSeamlesIndicator = atoi(icXmlAttrValue(tagNode, "SeamlessIndicator", "0"));
5090 m_nEncodingFormat = (icImageEncodingType)atoi(icXmlAttrValue(tagNode, "EncodingFormat", "0"));
5091 m_fMetersMinPixelValue = (icFloatNumber)atof(icXmlAttrValue(tagNode, "MetersMinPixelValue", "0.0"));
5092 m_fMetersMaxPixelValue = (icFloatNumber)atof(icXmlAttrValue(tagNode, "MetersMaxPixelValue", "0.0"));
5093
5094 xmlNode *pImageNode;
5095 pImageNode = icXmlFindNode(tagNode->children, "Image");
5096
5097 if (pImageNode) {
5098 const char *filename = icXmlAttrValue(pImageNode, "File");
5099 if (!filename || !filename[0]) {
5100 filename = icXmlAttrValue(pImageNode, "Filename");
5101 }
5102
5103 // file exists
5104 if (filename[0]) {
5105 CIccIO *file = IccOpenFileIO(filename, "rb");
5106 if (!file) {
5107 parseStr += "Error! - File '";
5108 parseStr += filename;
5109 parseStr += "' not found.\n";
5110 delete file;
5111 return false;
5112 }
5113
5114 icUInt32Number num = file->GetLength();
5115
5116 SetSize(num);
5117 icUInt8Number *dst = GetData(0);
5118 if (file->Read8(dst, num)!=num) {
5119 perror("Read-File Error");
5120 parseStr += "'";
5121 parseStr += filename;
5122 parseStr += "' may not be a valid binary file.\n";
5123 delete file;
5124 return false;
5125 }
5126 delete file;
5127 return true;
5128 }
5129 // no file
5130 else if (pImageNode->children && pImageNode->children->content){
5131 unsigned long nSize = icXmlGetHexDataSize((const icChar*)pImageNode->children->content);
5132
5133 SetSize(nSize);
5134 if (m_pData) {
5135 if (icXmlGetHexData(m_pData, (const icChar*)pImageNode->children->content, m_nSize) != m_nSize)
5136 return false;
5137 }
5138
5139 return true;
5140 }
5141 }
5142 return false;
5143}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
char icChar
Definition IccDefs.h:109
CIccIO * IccOpenFileIO(const icChar *szFilename, const char *szAttr)
Definition IccIoXml.cpp:100
icUInt32Number icXmlGetHexDataSize(const char *szText)
xmlNode * icXmlFindNode(xmlNode *pNode, const char *szNodeName)
icUInt32Number icXmlGetHexData(void *pBuf, const char *szText, icUInt32Number nBufSize)
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault)
unsigned int icUInt32Number
Type: Class.
Definition IccIO.h:97
virtual icInt32Number GetLength()
Definition IccIO.h:130
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104
icUInt32Number m_nSeamlesIndicator
icUInt8Number * GetData(icUInt32Number index=0)
icFloatNumber m_fMetersMaxPixelValue
icImageEncodingType m_nEncodingFormat
bool SetSize(icUInt32Number nSize, bool bZeroNew=true)
Name: CIccTagEmbeddedHeightImage::SetSize.
icFloatNumber m_fMetersMinPixelValue
unsigned char icUInt8Number
Number definitions.
icImageEncodingType

References CIccIO::GetLength(), IccOpenFileIO(), icXmlAttrValue(), icXmlFindNode(), icXmlGetHexData(), icXmlGetHexDataSize(), and CIccIO::Read8().

+ Here is the call graph for this function:

◆ ToXml()

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

Implements CIccTagXml.

Definition at line 5145 of file IccTagXml.cpp.

5146{
5147 char buf[200];
5148
5149 xml += blanks + "<HeightImage";
5150 sprintf(buf, " SeamlessIndicator=\"%d\"", m_nSeamlesIndicator);
5151 xml += buf;
5152
5153 sprintf(buf, " EncodingFormat=\"%d\"", m_nEncodingFormat);
5154 xml += buf;
5155
5156 sprintf(buf, " MetersMinPixelValue=\"%.12f\"", m_fMetersMinPixelValue);
5157 xml += buf;
5158
5159 sprintf(buf, " MetersMaxPixelValue=\"%.12f\"", m_fMetersMaxPixelValue);
5160 xml += buf;
5161
5162 if (!m_nSize) {
5163 xml += blanks + "/>\n";
5164 }
5165 else {
5166 xml += ">\n";
5167 xml += blanks + " <Image>\n";
5168 icXmlDumpHexData(xml, blanks + " ", m_pData, m_nSize);
5169 xml += blanks + " </Image>\n";
5170 xml += blanks + "</HeightImage>\n";
5171 }
5172
5173 return true;
5174}
icUInt32Number icXmlDumpHexData(std::string &xml, std::string blanks, void *pBuf, icUInt32Number nBufSize)

References icXmlDumpHexData().

+ Here is the call graph for this function:

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