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

#include <IccMpeXml.h>

+ Inheritance diagram for CIccXmlToneMapFunc:
+ Collaboration diagram for CIccXmlToneMapFunc:

Public Member Functions

virtual const char * GetClassName () const
 
virtual CIccToneMapFuncNewCopy ()
 
virtual bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
virtual bool ToXml (std::string &xml, std::string blanks="")
 
virtual ~CIccXmlToneMapFunc ()
 
- Public Member Functions inherited from CIccToneMapFunc
icFloatNumber Apply (icFloatNumber lumValue, icFloatNumber pixelValue) const
 
bool Begin ()
 
 CIccToneMapFunc ()
 
void Describe (std::string &sDescription, int nVerboseness=0)
 
virtual icToneFunctionSignature GetType () const
 
virtual CIccToneMapFuncNewCopy () const
 
CIccToneMapFuncoperator= (const CIccToneMapFunc &toneMap)
 
bool Read (icUInt32Number size, CIccIO *pIO)
 
bool SetFunction (icUInt16Number nFunc, icUInt8Number, icFloatNumber *pParams)
 
icValidateStatus Validate (std::string &sFuncReport, int nVerboseness=0) const
 
bool Write (CIccIO *pIO)
 
virtual ~CIccToneMapFunc ()
 

Additional Inherited Members

- Protected Member Functions inherited from CIccToneMapFunc
int NumArgs () const
 
- Protected Attributes inherited from CIccToneMapFunc
icUInt16Number m_nFunctionType
 
icUInt8Number m_nParameters
 
icUInt32Number m_nReserved
 
icUInt16Number m_nReserved2
 
icFloatNumberm_params
 

Detailed Description

Definition at line 138 of file IccMpeXml.h.

Constructor & Destructor Documentation

◆ ~CIccXmlToneMapFunc()

virtual CIccXmlToneMapFunc::~CIccXmlToneMapFunc ( )
inlinevirtual

Definition at line 141 of file IccMpeXml.h.

141{}

Member Function Documentation

◆ GetClassName()

virtual const char * CIccXmlToneMapFunc::GetClassName ( ) const
inlinevirtual

Reimplemented from CIccToneMapFunc.

Definition at line 145 of file IccMpeXml.h.

145{ return "CIccXmlToneMapFunc"; }

◆ NewCopy()

CIccToneMapFunc * CIccXmlToneMapFunc::NewCopy ( )
virtual

Definition at line 1641 of file IccMpeXml.cpp.

1642{
1644
1645 if (rv)
1646 *rv = *this;
1647
1648 return rv;
1649}
Class: CIccToneMapFunc.

◆ ParseXml()

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

Definition at line 1676 of file IccMpeXml.cpp.

1677{
1678 xmlAttr* funcType = icXmlFindAttr(pNode, "FunctionType");
1679
1680 if (!funcType) {
1681 parseStr += "Bad FunctionType in Tone Map Function\n";
1682 return false;
1683 }
1684
1685 m_nReserved2 = atoi(icXmlAttrValue(pNode, "Reserved2"));
1686 m_nFunctionType = atoi(icXmlAttrValue(funcType));
1687
1688 switch (m_nFunctionType) {
1689 case 0x0000:
1690 m_nParameters = 3;
1691 break;
1692
1693 default:
1694 parseStr += "Unsupported FunctionType value in Tone Map Function\n";
1695 return false;
1696 }
1697
1698 CIccFloatArray args;
1699
1700 if (!args.ParseArray(pNode->children))
1701 return false;
1702
1703 if (args.GetSize() < m_nParameters)
1704 return false;
1705
1706 if (m_params) {
1707 free(m_params);
1708 }
1709
1710 if (m_nParameters) {
1711 m_params = (icFloatNumber*)malloc(m_nParameters * sizeof(icFloatNumber));
1712 if (!m_params)
1713 return false;
1714
1715 memcpy(m_params, args.GetBuf(), m_nParameters * sizeof(icFloatNumber));
1716 }
1717 else
1718 m_params = NULL;
1719
1720 return true;
1721}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
xmlAttr * icXmlFindAttr(xmlNode *pNode, const char *szAttrName)
const char * icXmlAttrValue(xmlAttr *attr, const char *szDefault)
icUInt16Number m_nReserved2
icUInt16Number m_nFunctionType
icUInt8Number m_nParameters
icFloatNumber * m_params
static bool ParseArray(T *buf, icUInt32Number nBufSize, xmlNode *pNode)
icUInt32Number GetSize()
Definition IccUtilXml.h:166

References CIccXmlArrayType< T, Tsig >::GetBuf(), CIccXmlArrayType< T, Tsig >::GetSize(), icXmlAttrValue(), icXmlFindAttr(), and CIccXmlArrayType< T, Tsig >::ParseArray().

Referenced by CIccMpeXmlToneMap::ParseXml().

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

◆ ToXml()

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

Definition at line 1651 of file IccMpeXml.cpp.

1652{
1653 char line[256];
1654
1655 sprintf(line, "<ToneMapFunction FunctionType=\"%d\"", m_nFunctionType);
1656 xml += blanks + line;
1657
1658 if (m_nReserved) {
1659 sprintf(line, " Reserved=\"%d\"", m_nReserved);
1660 xml += line;
1661 }
1662 if (m_nReserved2) {
1663 sprintf(line, " Reserved2=\"%d\"", m_nReserved2);
1664 xml += line;
1665 }
1666 xml += ">\n";
1667
1669
1670 xml += blanks + "</ToneMapFunction>\n";
1671
1672 return true;
1673
1674}
@ icConvertFloat
icUInt32Number m_nReserved
static bool DumpArray(std::string &xml, std::string blanks, T *buf, icUInt32Number nBufSize, icConvertType nType, icUInt8Number nColumns)

References CIccXmlArrayType< T, Tsig >::DumpArray(), and icConvertFloat.

Referenced by CIccMpeXmlToneMap::ToXml().

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

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