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

Class: CIccMpeMatrix. More...

#include <IccMpeBasic.h>

+ Inheritance diagram for CIccMpeMatrix:
+ Collaboration diagram for CIccMpeMatrix:

Public Member Functions

virtual void Apply (CIccApplyMpe *pApply, icFloatNumber *dstPixel, const icFloatNumber *srcPixel) const
 Name: CIccMpeMatrix::Apply.
 
virtual bool Begin (icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
 Name: CIccMpeMatrix::Begin.
 
 CIccMpeMatrix ()
 Name: CIccMpeMatrix::CIccMpeMatrix.
 
 CIccMpeMatrix (const CIccMpeMatrix &ITPC)
 Name: CIccMpeMatrix::CIccMpeMatrix.
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 Name: CIccMpeMatrix::Describe.
 
bool GetApplyConstants () const
 
virtual const icCharGetClassName () const
 
icFloatNumberGetConstants () const
 
icFloatNumberGetMatrix () const
 
virtual icElemTypeSignature GetType () const
 
virtual CIccMultiProcessElementNewCopy () const
 
CIccMpeMatrixoperator= (const CIccMpeMatrix &ParamCurveTag)
 Name: &CIccMpeMatrix::operator=.
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccMpeMatrix::Read.
 
bool SetSize (icUInt16Number nInputChannels, icUInt16Number nOutputChannels, bool bUseConstants=true)
 Name: CIccMpeMatrix::SetSize.
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 Name: CIccMpeMatrix::Validate.
 
virtual bool Write (CIccIO *pIO)
 Name: CIccMpeMatrix::Write.
 
virtual ~CIccMpeMatrix ()
 Name: CIccMpeMatrix::~CIccMpeMatrix.
 
- Public Member Functions inherited from CIccMultiProcessElement
 CIccMultiProcessElement ()
 
virtual icAcsSignature GetBAcsSig ()
 
virtual icAcsSignature GetEAcsSig ()
 
virtual IIccExtensionMpeGetExtension ()
 
virtual CIccApplyMpeGetNewApply (CIccApplyTagMpe *pApplyTag)
 Name: CIccMultiProcessElement::GetNewApply()
 
virtual bool IsAcs ()
 
virtual bool IsLateBinding () const
 
virtual bool IsLateBindingReflectance () const
 
virtual bool IsSupported ()
 
virtual icUInt16Number NumInputChannels () const
 
virtual icUInt16Number NumOutputChannels () const
 
virtual ~CIccMultiProcessElement ()
 

Protected Attributes

bool m_bApplyConstants
 
icFloatNumberm_pConstants
 
icFloatNumberm_pMatrix
 
icUInt32Number m_size
 
icMatrixElemType m_type
 
- Protected Attributes inherited from CIccMultiProcessElement
icUInt16Number m_nInputChannels
 
icUInt16Number m_nOutputChannels
 

Additional Inherited Members

- Static Public Member Functions inherited from CIccMultiProcessElement
static CIccMultiProcessElementCreate (icElemTypeSignature sig)
 Name: CIccMultiProcessElement::Create.
 
- Public Attributes inherited from CIccMultiProcessElement
icUInt32Number m_nReserved
 

Detailed Description

Class: CIccMpeMatrix.

Purpose: The Matrix element with constant offset

Definition at line 599 of file IccMpeBasic.h.

Constructor & Destructor Documentation

◆ CIccMpeMatrix() [1/2]

CIccMpeMatrix::CIccMpeMatrix ( )

Name: CIccMpeMatrix::CIccMpeMatrix.

Purpose:

Args:

Return:

Definition at line 4823 of file IccMpeBasic.cpp.

4824{
4825 m_nReserved = 0;
4827 m_size = 0;
4828 m_pMatrix = NULL;
4829 m_pConstants = NULL;
4830}
icUInt32Number m_size
icFloatNumber * m_pConstants
icFloatNumber * m_pMatrix
icUInt16Number m_nOutputChannels
Definition IccTagMPE.h:192
icUInt16Number m_nInputChannels
Definition IccTagMPE.h:191
icUInt32Number m_nReserved
Definition IccTagMPE.h:188

◆ CIccMpeMatrix() [2/2]

CIccMpeMatrix::CIccMpeMatrix ( const CIccMpeMatrix & matrix)

Name: CIccMpeMatrix::CIccMpeMatrix.

Purpose:

Args:

Return:

Definition at line 4843 of file IccMpeBasic.cpp.

4844{
4845 m_nReserved = matrix.m_nReserved;
4846
4849
4850 m_size = matrix.m_size;
4851 if(matrix.m_pMatrix) {
4852 int num = m_size * sizeof(icFloatNumber);
4853 m_pMatrix = (icFloatNumber*)malloc(num);
4854 memcpy(m_pMatrix, matrix.m_pMatrix, num);
4855 }
4856 else
4857 m_pMatrix = NULL;
4858
4859 if (matrix.m_pConstants) {
4860 int num = m_nOutputChannels*sizeof(icFloatNumber);
4861 m_pConstants = (icFloatNumber*)malloc(num);
4862 memcpy(m_pConstants, matrix.m_pConstants, num);
4863 }
4864 else
4865 m_pConstants = NULL;
4866
4867 m_bApplyConstants = true;
4868}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
bool m_bApplyConstants

References CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, m_pConstants, m_pMatrix, and m_size.

◆ ~CIccMpeMatrix()

CIccMpeMatrix::~CIccMpeMatrix ( )
virtual

Name: CIccMpeMatrix::~CIccMpeMatrix.

Purpose:

Args:

Return:

Definition at line 4925 of file IccMpeBasic.cpp.

4926{
4927 if (m_pMatrix)
4928 free(m_pMatrix);
4929
4930 if (m_pConstants)
4931 free(m_pConstants);
4932}

Member Function Documentation

◆ Apply()

void CIccMpeMatrix::Apply ( CIccApplyMpe * pApply,
icFloatNumber * dstPixel,
const icFloatNumber * srcPixel ) const
virtual

Name: CIccMpeMatrix::Apply.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 5211 of file IccMpeBasic.cpp.

5212{
5213 icFloatNumber *data = m_pMatrix;
5214 if (data) {
5215 if (m_bApplyConstants) {
5216 switch (m_type) {
5217 case ic3x3Matrix:
5218 *dstPixel++ = data[ 0]*srcPixel[0] + data[ 1]*srcPixel[1] + data[ 2]*srcPixel[2] + m_pConstants[0];
5219 *dstPixel++ = data[ 3]*srcPixel[0] + data[ 4]*srcPixel[1] + data[ 5]*srcPixel[2] + m_pConstants[1];
5220 *dstPixel = data[ 6]*srcPixel[0] + data[ 7]*srcPixel[1] + data[ 8]*srcPixel[2] + m_pConstants[2];
5221 break;
5222
5223 case ic3x4Matrix:
5224 *dstPixel++ = data[ 0]*srcPixel[0] + data[ 1]*srcPixel[1] + data[ 2]*srcPixel[2] + m_pConstants[0];
5225 *dstPixel++ = data[ 3]*srcPixel[0] + data[ 4]*srcPixel[1] + data[ 5]*srcPixel[2] + m_pConstants[1];
5226 *dstPixel++ = data[ 6]*srcPixel[0] + data[ 7]*srcPixel[1] + data[ 8]*srcPixel[2] + m_pConstants[2];
5227 *dstPixel = data[ 9]*srcPixel[0] + data[10]*srcPixel[1] + data[11]*srcPixel[2] + m_pConstants[3];
5228 break;
5229
5230 case ic4x3Matrix:
5231 *dstPixel++ = data[ 0]*srcPixel[0] + data[ 1]*srcPixel[1] + data[ 2]*srcPixel[2] + data[ 3]*srcPixel[3] + m_pConstants[0];
5232 *dstPixel++ = data[ 4]*srcPixel[0] + data[ 5]*srcPixel[1] + data[ 6]*srcPixel[2] + data[ 7]*srcPixel[3] + m_pConstants[1];
5233 *dstPixel = data[ 8]*srcPixel[0] + data[ 9]*srcPixel[1] + data[10]*srcPixel[2] + data[11]*srcPixel[3] + m_pConstants[2];
5234 break;
5235
5236 case ic4x4Matrix:
5237 *dstPixel++ = data[ 0]*srcPixel[0] + data[ 1]*srcPixel[1] + data[ 2]*srcPixel[2] + data[ 3]*srcPixel[3] + m_pConstants[0];
5238 *dstPixel++ = data[ 4]*srcPixel[0] + data[ 5]*srcPixel[1] + data[ 6]*srcPixel[2] + data[ 7]*srcPixel[3] + m_pConstants[1];
5239 *dstPixel++ = data[ 8]*srcPixel[0] + data[ 9]*srcPixel[1] + data[10]*srcPixel[2] + data[11]*srcPixel[3] + m_pConstants[2];
5240 *dstPixel = data[12]*srcPixel[0] + data[13]*srcPixel[1] + data[14]*srcPixel[2] + data[15]*srcPixel[3] + m_pConstants[3];
5241 break;
5242
5243 case icOtherMatrix:
5244 default:
5245 {
5246 int i, j;
5247
5248 for (j=0; j<m_nOutputChannels; j++) {
5249 *dstPixel = m_pConstants[j];
5250
5251 for (i=0; i<m_nInputChannels; i++) {
5252 *dstPixel += data[i]*srcPixel[i];
5253 }
5254
5255 data += i;
5256 dstPixel++;
5257 }
5258 }
5259 break;
5260 }
5261 }
5262 else {
5263 switch (m_type) {
5264 case ic3x3Matrix:
5265 *dstPixel++ = data[0] * srcPixel[0] + data[1] * srcPixel[1] + data[2] * srcPixel[2];
5266 *dstPixel++ = data[3] * srcPixel[0] + data[4] * srcPixel[1] + data[5] * srcPixel[2];
5267 *dstPixel = data[6] * srcPixel[0] + data[7] * srcPixel[1] + data[8] * srcPixel[2];
5268 break;
5269
5270 case ic3x4Matrix:
5271 *dstPixel++ = data[0] * srcPixel[0] + data[1] * srcPixel[1] + data[2] * srcPixel[2];
5272 *dstPixel++ = data[3] * srcPixel[0] + data[4] * srcPixel[1] + data[5] * srcPixel[2];
5273 *dstPixel++ = data[6] * srcPixel[0] + data[7] * srcPixel[1] + data[8] * srcPixel[2];
5274 *dstPixel = data[9] * srcPixel[0] + data[10] * srcPixel[1] + data[11] * srcPixel[2];
5275 break;
5276
5277 case ic4x3Matrix:
5278 *dstPixel++ = data[0] * srcPixel[0] + data[1] * srcPixel[1] + data[2] * srcPixel[2] + data[3] * srcPixel[3];
5279 *dstPixel++ = data[4] * srcPixel[0] + data[5] * srcPixel[1] + data[6] * srcPixel[2] + data[7] * srcPixel[3];
5280 *dstPixel = data[8] * srcPixel[0] + data[9] * srcPixel[1] + data[10] * srcPixel[2] + data[11] * srcPixel[3];
5281 break;
5282
5283 case ic4x4Matrix:
5284 *dstPixel++ = data[0] * srcPixel[0] + data[1] * srcPixel[1] + data[2] * srcPixel[2] + data[3] * srcPixel[3];
5285 *dstPixel++ = data[4] * srcPixel[0] + data[5] * srcPixel[1] + data[6] * srcPixel[2] + data[7] * srcPixel[3];
5286 *dstPixel++ = data[8] * srcPixel[0] + data[9] * srcPixel[1] + data[10] * srcPixel[2] + data[11] * srcPixel[3];
5287 *dstPixel = data[12] * srcPixel[0] + data[13] * srcPixel[1] + data[14] * srcPixel[2] + data[15] * srcPixel[3];
5288 break;
5289
5290 case icOtherMatrix:
5291 default:
5292 {
5293 int i, j;
5294
5295 for (j = 0; j < m_nOutputChannels; j++) {
5296 *dstPixel = 0.0f;
5297
5298 for (i = 0; i < m_nInputChannels; i++) {
5299 *dstPixel += data[i] * srcPixel[i];
5300 }
5301
5302 data += i;
5303 dstPixel++;
5304 }
5305 }
5306 break;
5307 }
5308 }
5309 }
5310 else if (m_bApplyConstants) {
5311 memcpy(dstPixel, m_pConstants, m_nOutputChannels*sizeof(icFloatNumber));
5312 }
5313 else {
5314 memset(dstPixel, 0, m_nOutputChannels * sizeof(icFloatNumber));
5315 }
5316}
@ ic3x3Matrix
@ icOtherMatrix
@ ic3x4Matrix
@ ic4x3Matrix
@ ic4x4Matrix
icMatrixElemType m_type

References ic3x3Matrix, ic3x4Matrix, ic4x3Matrix, ic4x4Matrix, and icOtherMatrix.

◆ Begin()

bool CIccMpeMatrix::Begin ( icElemInterp nInterp,
CIccTagMultiProcessElement * pMPE )
virtual

Name: CIccMpeMatrix::Begin.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 5174 of file IccMpeBasic.cpp.

5175{
5176 m_bApplyConstants = false;
5177 if (m_pConstants) {
5178 int i;
5179 for (i = 0; i < m_nOutputChannels; i++) {
5180 if (icNotZero(m_pConstants[i])) {
5181 m_bApplyConstants = true;
5182 break;
5183 }
5184 }
5185 }
5186
5189 else if (m_nInputChannels==3 && m_nOutputChannels==4)
5191 else if (m_nInputChannels==4 && m_nOutputChannels==3)
5193 else if (m_nInputChannels==4 && m_nOutputChannels==4)
5195 else
5197
5198 return true;
5199}
#define icNotZero(v)
Definition IccUtil.h:89

References ic3x3Matrix, ic3x4Matrix, ic4x3Matrix, ic4x4Matrix, icNotZero, and icOtherMatrix.

◆ Describe()

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

Name: CIccMpeMatrix::Describe.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 4986 of file IccMpeBasic.cpp.

4987{
4988 icChar buf[81];
4989 int i, j;
4990 icFloatNumber *data = m_pMatrix;
4991
4992 sprintf(buf, "BEGIN_ELEM_MATRIX %d %d\n", m_nInputChannels, m_nOutputChannels);
4993 sDescription += buf;
4994
4995 for (j=0; j<m_nOutputChannels; j++) {
4996 if (data) {
4997 for (i=0; i<m_nInputChannels; i++) {
4998 if (i)
4999 sDescription += " ";
5000 sprintf(buf, "%12.8lf", data[i]);
5001 sDescription += buf;
5002 }
5003 if (m_pConstants) {
5004 sprintf(buf, " + %12.8lf\n", m_pConstants[j]);
5005 sDescription += buf;
5006 }
5007 data += i;
5008 }
5009 else {
5010 sprintf(buf, "ZeroRow + %12.8lf\n", m_pConstants[j]);
5011 sDescription += buf;
5012 }
5013 }
5014 sDescription += "END_ELEM_MATRIX\n";
5015}
char icChar
Definition IccDefs.h:109

◆ GetApplyConstants()

bool CIccMpeMatrix::GetApplyConstants ( ) const
inline

Definition at line 620 of file IccMpeBasic.h.

620{return m_bApplyConstants;}

◆ GetClassName()

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

Implements CIccMultiProcessElement.

Reimplemented in CIccMpeXmlMatrix.

Definition at line 609 of file IccMpeBasic.h.

609{ return "CIccMpeMatrix"; }

◆ GetConstants()

icFloatNumber * CIccMpeMatrix::GetConstants ( ) const
inline

Definition at line 619 of file IccMpeBasic.h.

619{return m_pConstants;}

◆ GetMatrix()

icFloatNumber * CIccMpeMatrix::GetMatrix ( ) const
inline

Definition at line 618 of file IccMpeBasic.h.

618{return m_pMatrix;}

Referenced by CIccDefaultEncProfileConverter::ConvertFromParams().

+ Here is the caller graph for this function:

◆ GetType()

virtual icElemTypeSignature CIccMpeMatrix::GetType ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Definition at line 608 of file IccMpeBasic.h.

608{ return icSigMatrixElemType; }
@ icSigMatrixElemType

References icSigMatrixElemType.

◆ NewCopy()

virtual CIccMultiProcessElement * CIccMpeMatrix::NewCopy ( ) const
inlinevirtual

Implements CIccMultiProcessElement.

Definition at line 605 of file IccMpeBasic.h.

605{ return new CIccMpeMatrix(*this);}
CIccMpeMatrix()
Name: CIccMpeMatrix::CIccMpeMatrix.

Referenced by CIccDefaultEncProfileConverter::ConvertFromParams().

+ Here is the caller graph for this function:

◆ operator=()

CIccMpeMatrix & CIccMpeMatrix::operator= ( const CIccMpeMatrix & matrix)

Name: &CIccMpeMatrix::operator=.

Purpose:

Args:

Return:

Definition at line 4880 of file IccMpeBasic.cpp.

4881{
4882 m_nReserved = matrix.m_nReserved;
4883
4886
4887 if (m_pMatrix)
4888 free(m_pMatrix);
4889
4890 m_size = matrix.m_size;
4891 if (matrix.m_pMatrix) {
4892 int num = m_size * sizeof(icFloatNumber);
4893 m_pMatrix = (icFloatNumber*)malloc(num);
4894 memcpy(m_pMatrix, matrix.m_pMatrix, num);
4895 }
4896 else
4897 m_pMatrix = NULL;
4898
4899 if (m_pConstants)
4900 free(m_pConstants);
4901
4902 if (matrix.m_pConstants) {
4903 int num = m_nOutputChannels*sizeof(icFloatNumber);
4904 m_pConstants = (icFloatNumber*)malloc(num);
4905 memcpy(m_pConstants, matrix.m_pConstants, num);
4906 }
4907 else
4908 m_pConstants = NULL;
4909
4911
4912 return *this;
4913}

References m_bApplyConstants, CIccMultiProcessElement::m_nInputChannels, CIccMultiProcessElement::m_nOutputChannels, CIccMultiProcessElement::m_nReserved, m_pConstants, m_pMatrix, and m_size.

◆ Read()

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

Name: CIccMpeMatrix::Read.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 5027 of file IccMpeBasic.cpp.

5028{
5030
5031 icUInt32Number headerSize = sizeof(icElemTypeSignature) +
5032 sizeof(icUInt32Number) +
5033 sizeof(icUInt16Number) +
5034 sizeof(icUInt16Number);
5035
5036 if (headerSize > size)
5037 return false;
5038
5039 icUInt32Number dataSize = size - headerSize;
5040
5041 if (!pIO) {
5042 return false;
5043 }
5044
5045 icUInt16Number nInputChannels, nOutputChannels;
5046
5047 if (!pIO->Read32(&sig))
5048 return false;
5049
5050 if (!pIO->Read32(&m_nReserved))
5051 return false;
5052
5053 if (!pIO->Read16(&nInputChannels))
5054 return false;
5055
5056 if (!pIO->Read16(&nOutputChannels))
5057 return false;
5058
5059 if (dataSize >= (icUInt32Number)nInputChannels * nOutputChannels * sizeof(icFloatNumber) &&
5060 dataSize < ((icUInt32Number)nInputChannels+1) * nOutputChannels * sizeof(icFloatNumber)) {
5061 //Matrix with no constants
5062 if (!SetSize(nInputChannels, nOutputChannels, false))
5063 return false;
5064
5065 if (!m_pMatrix)
5066 return false;
5067
5068 //Read Matrix data
5070 return false;
5071 }
5072 else if (dataSize < (icUInt32Number)nInputChannels * nOutputChannels *sizeof(icFloatNumber) &&
5073 dataSize >= (icUInt32Number)nOutputChannels * sizeof(icFloatNumber)) {
5074 //Constants with no matrix
5075 if (!SetSize(0, nOutputChannels))
5076 return false;
5077
5078 m_nInputChannels = nInputChannels;
5079
5080 //Read Constant data
5082 return false;
5083 }
5084 else {
5085 if ((icUInt32Number)nInputChannels*nOutputChannels > dataSize ||
5086 ((icUInt32Number)nInputChannels*nOutputChannels + nOutputChannels) > dataSize ||
5087 ((icUInt32Number)nInputChannels*nOutputChannels + nOutputChannels) * sizeof(icFloat32Number) > dataSize)
5088 return false;
5089
5090 //Matrix with constants
5091 if (!SetSize(nInputChannels, nOutputChannels))
5092 return false;
5093
5094 if (!m_pMatrix)
5095 return false;
5096
5097 if ((m_size + nOutputChannels)*sizeof(icFloat32Number) > dataSize)
5098 return false;
5099
5100 //Read Matrix data
5102 return false;
5103
5104 //Read Constant data
5106 return false;
5107 }
5108
5109 return true;
5110}
icArraySignature sig
unsigned int icUInt32Number
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
bool SetSize(icUInt16Number nInputChannels, icUInt16Number nOutputChannels, bool bUseConstants=true)
Name: CIccMpeMatrix::SetSize.
float icFloat32Number
unsigned short icUInt16Number
long icInt32Number
icElemTypeSignature
Multi-Processing Element type signatures.

References CIccIO::Read16(), CIccIO::Read32(), CIccIO::ReadFloat32Float(), and sig.

+ Here is the call graph for this function:

◆ SetSize()

bool CIccMpeMatrix::SetSize ( icUInt16Number nInputChannels,
icUInt16Number nOutputChannels,
bool bUseConstants = true )

Name: CIccMpeMatrix::SetSize.

Purpose:

Args:

Return:

Definition at line 4944 of file IccMpeBasic.cpp.

4945{
4946 if (m_pMatrix) {
4947 free(m_pMatrix);
4948 m_pMatrix = NULL;
4949 }
4950 if (m_pConstants) {
4951 free(m_pConstants);
4952 m_pConstants = NULL;
4953 }
4954
4955 m_size = (icUInt32Number)nInputChannels * nOutputChannels;
4956
4957 if (m_size) {
4958 m_pMatrix = (icFloatNumber*)calloc(m_size, sizeof(icFloatNumber));
4959 if (!m_pMatrix)
4960 return false;
4961 }
4962
4963 if (bUseConstants) {
4964 m_pConstants = (icFloatNumber*)calloc(nOutputChannels, sizeof(icFloatNumber));
4965
4966 if (!m_pConstants)
4967 return false;
4968 }
4969
4970 m_nInputChannels = nInputChannels;
4971 m_nOutputChannels = nOutputChannels;
4972
4973 return true;
4974}

Referenced by CIccDefaultEncProfileConverter::ConvertFromParams().

+ Here is the caller graph for this function:

◆ Validate()

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

Name: CIccMpeMatrix::Validate.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 5328 of file IccMpeBasic.cpp.

5329{
5330 std::string mpeSigPath = sigPath + icGetSigPath(GetType());
5331 icValidateStatus rv = CIccMultiProcessElement::Validate(sigPath, sReport, pMPE, pProfile);
5332
5333 if (!m_pConstants) {
5334 CIccInfo Info;
5335 std::string sSigPathName = Info.GetSigPathName(mpeSigPath);
5336
5337 sReport += icMsgValidateCriticalError;
5338 sReport += sSigPathName;
5339 sReport += " - Has Empty Matrix Constant data!\n";
5341 }
5342
5343 return rv;
5344}
icValidateStatus
Definition IccDefs.h:118
@ icValidateCriticalError
Definition IccDefs.h:122
std::string icGetSigPath(icUInt32Number nSig)
Definition IccUtil.cpp:1191
const char * icMsgValidateCriticalError
Definition IccUtil.cpp:92
Type: Class.
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614
virtual icElemTypeSignature GetType() const
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const =0
Name: CIccProcessElement::Validate.

References CIccInfo::GetSigPathName(), icGetSigPath(), icMsgValidateCriticalError, icValidateCriticalError, and CIccMultiProcessElement::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccMpeMatrix::Write ( CIccIO * pIO)
virtual

Name: CIccMpeMatrix::Write.

Purpose:

Args:

Return:

Implements CIccMultiProcessElement.

Definition at line 5122 of file IccMpeBasic.cpp.

5123{
5125
5126 if (!pIO)
5127 return false;
5128
5129 if (!pIO->Write32(&sig))
5130 return false;
5131
5132 if (!pIO->Write32(&m_nReserved))
5133 return false;
5134
5135 if (!pIO->Write16(&m_nInputChannels))
5136 return false;
5137
5138 if (!pIO->Write16(&m_nOutputChannels))
5139 return false;
5140
5141 if (m_pMatrix) {
5143 return false;
5144 }
5145
5146 //Write Constant data
5147 if (m_pConstants) {
5149 return false;
5150 }
5151 else {
5152 //Write zero constants because spec says it they have to be there
5153 icFloat32Number zero = 0;
5154 int i;
5155 for (i = 0; i < m_nOutputChannels; i++) {
5156 if (!pIO->WriteFloat32Float(&zero, 1))
5157 return false;
5158 }
5159 }
5160
5161 return true;
5162}
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

References sig, CIccIO::Write16(), CIccIO::Write32(), and CIccIO::WriteFloat32Float().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_bApplyConstants

bool CIccMpeMatrix::m_bApplyConstants
protected

Definition at line 632 of file IccMpeBasic.h.

Referenced by operator=().

◆ m_pConstants

icFloatNumber* CIccMpeMatrix::m_pConstants
protected

Definition at line 629 of file IccMpeBasic.h.

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

◆ m_pMatrix

icFloatNumber* CIccMpeMatrix::m_pMatrix
protected

Definition at line 628 of file IccMpeBasic.h.

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

◆ m_size

icUInt32Number CIccMpeMatrix::m_size
protected

Definition at line 630 of file IccMpeBasic.h.

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

◆ m_type

icMatrixElemType CIccMpeMatrix::m_type
protected

Definition at line 631 of file IccMpeBasic.h.


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