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

Class: CIccMatrix. More...

#include <IccTagLut.h>

+ Collaboration diagram for CIccMatrix:

Public Member Functions

virtual void Apply (icFloatNumber *Pixel) const
 Name: CIccMatrix::Apply.
 
 CIccMatrix (bool bUseConstants=true)
 Name: CIccMatrix::CIccMatrix.
 
 CIccMatrix (const CIccMatrix &MatrixClass)
 Name: CIccMatrix::CIccMatrix.
 
void DumpLut (std::string &sDescription, const icChar *szName, int nVerboseness)
 Name: CIccTagParametricCurve::DumpLut.
 
virtual bool IsIdentity ()
 Name: CIccMatrix::IsIdentity.
 
CIccMatrixoperator= (const CIccMatrix &MatrixClass)
 Name: CIccMatrix::operator=.
 
icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 Name: CIccMatrix::Validate.
 
virtual ~CIccMatrix ()
 

Public Attributes

bool m_bUseConstants
 
icFloatNumber m_e [12]
 

Detailed Description

Class: CIccMatrix.

Purpose: The base matrix class

Definition at line 259 of file IccTagLut.h.

Constructor & Destructor Documentation

◆ CIccMatrix() [1/2]

CIccMatrix::CIccMatrix ( bool bUseConstants = true)

Name: CIccMatrix::CIccMatrix.

Purpose: Constructor

Args: bUseConstants = true if the matrix contains additional row for constants

Definition at line 1403 of file IccTagLut.cpp.

1404{
1405 m_bUseConstants = bUseConstants;
1406 m_e[0] = m_e[4] = m_e[8] = 1.0;
1407 m_e[1] = m_e[2] = m_e[3] =
1408 m_e[5] = m_e[6] = m_e[7] = 0.0;
1409
1410 if (!m_bUseConstants) {
1411 m_e[9] = m_e[10] = m_e[11] = 0.0;
1412 }
1413}
icFloatNumber m_e[12]
Definition IccTagLut.h:269
bool m_bUseConstants
Definition IccTagLut.h:270

◆ CIccMatrix() [2/2]

CIccMatrix::CIccMatrix ( const CIccMatrix & MatrixClass)

Name: CIccMatrix::CIccMatrix.

Purpose: Copy Constructor

Args: MatrixClass = The CIccMatrix object to be copied

Definition at line 1426 of file IccTagLut.cpp.

1427{
1428 m_bUseConstants = MatrixClass.m_bUseConstants;
1429 memcpy(m_e, MatrixClass.m_e, sizeof(m_e));
1430}

References m_bUseConstants, and m_e.

◆ ~CIccMatrix()

virtual CIccMatrix::~CIccMatrix ( )
inlinevirtual

Definition at line 265 of file IccTagLut.h.

265{}

Member Function Documentation

◆ Apply()

void CIccMatrix::Apply ( icFloatNumber * Pixel) const
virtual

Name: CIccMatrix::Apply.

Purpose: Multiplies the pixel by the matrix.

Args: Pixel = Pixel to be multiplied by the matrix

Definition at line 1540 of file IccTagLut.cpp.

1541{
1542 icFloatNumber a=Pixel[0];
1543 icFloatNumber b=Pixel[1];
1544 icFloatNumber c=Pixel[2];
1545
1546 icFloatNumber x = m_e[0]*a + m_e[1]*b + m_e[2]*c;
1547 icFloatNumber y = m_e[3]*a + m_e[4]*b + m_e[5]*c;
1548 icFloatNumber z = m_e[6]*a + m_e[7]*b + m_e[8]*c;
1549
1550 if (m_bUseConstants) {
1551 x += m_e[9];
1552 y += m_e[10];
1553 z += m_e[11];
1554 }
1555
1556 Pixel[0] = x;
1557 Pixel[1] = y;
1558 Pixel[2] = z;
1559}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100

◆ DumpLut()

void CIccMatrix::DumpLut ( std::string & sDescription,
const icChar * szName,
int nVerboseness )

Name: CIccTagParametricCurve::DumpLut.

Purpose: Dump the matrix data to a string.

Args: sDescription = string to concatenate tag dump to, szName = name of the curve to be printed

Definition at line 1466 of file IccTagLut.cpp.

1467{
1468 icChar buf[128];
1469
1470 sprintf(buf, "BEGIN_MATRIX %s\n", szName);
1471 sDescription += buf;
1472
1473 if (!m_bUseConstants) {
1474 sprintf(buf, "%8.4lf %8.4lf %8.4lf\n",
1475 m_e[0], m_e[1], m_e[2]);
1476 sDescription += buf;
1477 sprintf(buf, "%8.4lf %8.4lf %8.4lf\n",
1478 m_e[3], m_e[4], m_e[5]);
1479 sDescription += buf;
1480 sprintf(buf, "%8.4lf %8.4lf %8.4lf\n",
1481 m_e[6], m_e[7], m_e[8]);
1482 sDescription += buf;
1483 }
1484 else {
1485 sprintf(buf, "%8.4lf %8.4lf %8.4lf + %8.4lf\n",
1486 m_e[0], m_e[1], m_e[2], m_e[9]);
1487 sDescription += buf;
1488 sprintf(buf, "%8.4lf %8.4lf %8.4lf + %8.4lf\n",
1489 m_e[3], m_e[4], m_e[5], m_e[10]);
1490 sDescription += buf;
1491 sprintf(buf, "%8.4lf %8.4lf %8.4lf + %8.4lf\n",
1492 m_e[6], m_e[7], m_e[8], m_e[11]);
1493 sDescription += buf;
1494 }
1495}
char icChar
Definition IccDefs.h:109
const icChar * szName

References szName.

◆ IsIdentity()

bool CIccMatrix::IsIdentity ( )
virtual

Name: CIccMatrix::IsIdentity.

Purpose: Checks if the matrix is identity

Return: true if matrix is identity and uses no constants, else false

Definition at line 1508 of file IccTagLut.cpp.

1509{
1510 if (m_bUseConstants) {
1511 if (fabs(m_e[9])>0.0 || fabs(m_e[10])>0.0 || fabs(m_e[11])>0.0) {
1512 return false;
1513 }
1514 }
1515
1516 if (!IsUnity(m_e[0]) || !IsUnity(m_e[4]) || !IsUnity(m_e[8])) {
1517 return false;
1518 }
1519
1520 if (fabs(m_e[1])>0.0 || fabs(m_e[2])>0.0 || fabs(m_e[3])>0.0 ||
1521 fabs(m_e[5])>0.0 || fabs(m_e[6])>0.0 || fabs(m_e[7])>0.0)
1522 {
1523 return false;
1524 }
1525
1526 return true;
1527}
static bool IsUnity(const icFloatNumber &num)

References IsUnity().

+ Here is the call graph for this function:

◆ operator=()

CIccMatrix & CIccMatrix::operator= ( const CIccMatrix & MatrixClass)

Name: CIccMatrix::operator=.

Purpose: Copy Operator

Args: MatrixClass = The CIccMatrix object to be copied

Definition at line 1443 of file IccTagLut.cpp.

1444{
1445 if (&MatrixClass == this)
1446 return *this;
1447
1448 m_bUseConstants = MatrixClass.m_bUseConstants;
1449 memcpy(m_e, MatrixClass.m_e, sizeof(m_e));
1450
1451 return *this;
1452}

References m_bUseConstants, and m_e.

◆ Validate()

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

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

Definition at line 1576 of file IccTagLut.cpp.

1577{
1580
1582 if (pProfile->m_Header.pcs!=icSigXYZData) {
1583 CIccInfo Info;
1584 std::string sSigPathName = Info.GetSigPathName(sigPath);
1585 icFloatNumber sum=0.0;
1586 for (int i=0; i<9; i++) {
1587 sum += m_e[i];
1588 }
1589 if (m_e[0]!=1.0 || m_e[4]!=1.0 || m_e[9]!=1.0 || sum!=3.0) {
1590 sReport += icMsgValidateNonCompliant;
1591 sReport += sSigPathName;
1592 sReport += " - Matrix must be identity.\n";
1594 }
1595 }
1596 }
1597
1598 return rv;
1599}
icArraySignature sig
icValidateStatus
Definition IccDefs.h:118
@ icValidateOK
Definition IccDefs.h:119
@ icValidateNonCompliant
Definition IccDefs.h:121
const char * icMsgValidateNonCompliant
Definition IccUtil.cpp:91
icSignature icGetFirstSigPathSig(std::string sigPath)
Definition IccUtil.cpp:1201
Type: Class.
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614
@ icSigXYZData
icUInt32Number icSignature
@ icSigLut8Type
@ icSigLut16Type

References CIccInfo::GetSigPathName(), icGetFirstSigPathSig(), icMsgValidateNonCompliant, icSigLut16Type, icSigLut8Type, icSigXYZData, icValidateNonCompliant, icValidateOK, and sig.

Referenced by CIccTagLut16::Validate(), and CIccTagLut8::Validate().

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

Member Data Documentation

◆ m_bUseConstants

bool CIccMatrix::m_bUseConstants

◆ m_e


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