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

#include <IccTagXml.h>

+ Inheritance diagram for CIccTagXmlLut8:
+ Collaboration diagram for CIccTagXmlLut8:

Public Member Functions

virtual ~CIccTagXmlLut8 ()
 
void Cleanup ()
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
virtual void DetachIO ()
 
virtual const char * GetClassName () const
 
CIccCLUTGetCLUT () const
 
icColorSpaceSignature GetCsInput ()
 
icColorSpaceSignature GetCsOutput ()
 
LPIccCurveGetCurvesA () const
 
LPIccCurveGetCurvesB () const
 
LPIccCurveGetCurvesM () const
 
virtual const char * GetExtClassName () const
 
virtual const char * GetExtDerivedClassName () const
 
virtual IIccExtensionTagGetExtension ()
 
CIccMatrixGetMatrix () const
 
virtual icUInt8Number GetPrecision ()
 
virtual icArraySignature GetTagArrayType () const
 
virtual icStructSignature GetTagStructType () const
 
virtual icTagTypeSignature GetType () const
 
void Init (icUInt8Number nInputChannels, icUInt8Number nOutputChannels)
 
icUInt8Number InputChannels () const
 
virtual bool IsArrayType ()
 
bool IsInputB ()
 
virtual bool IsInputMatrix ()
 
virtual bool IsMBBType ()
 
virtual bool IsNumArrayType () const
 
virtual bool IsSupported ()
 
CIccCLUTNewCLUT (icUInt8Number *pGridPoints, icUInt8Number nPrecision=2)
 
CIccCLUTNewCLUT (icUInt8Number nGridPoints, icUInt8Number nPrecision=2)
 
virtual CIccTagNewCopy () const
 
LPIccCurveNewCurvesA ()
 
LPIccCurveNewCurvesB ()
 
LPIccCurveNewCurvesM ()
 
CIccMatrixNewMatrix ()
 
icUInt8Number OutputChannels () const
 
virtual bool ParseXml (xmlNode *pNode, std::string &parseStr)
 
bool Read (icUInt32Number size, CIccIO *pIO)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO, CIccProfile *pProfile)
 
virtual bool ReadAll ()
 
CIccCLUTSetCLUT (CIccCLUT *clut)
 
virtual void SetColorSpaces (icColorSpaceSignature csInput, icColorSpaceSignature csOutput)
 
bool SwapMBCurves ()
 
virtual bool ToXml (std::string &xml, std::string blanks="")
 
virtual bool UseLegacyPCS () const
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL)
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 
bool Write (CIccIO *pIO)
 

Static Public Member Functions

static CIccTagCreate (icTagTypeSignature sig)
 

Data Fields

icUInt32Number m_nReserved
 

Protected Attributes

bool m_bInputMatrix
 
bool m_bUseMCurvesAsBCurves
 
CIccCLUTm_CLUT
 
icColorSpaceSignature m_csInput
 
icColorSpaceSignature m_csOutput
 
LPIccCurvem_CurvesA
 
LPIccCurvem_CurvesB
 
LPIccCurvem_CurvesM
 
CIccMatrixm_Matrix
 
icUInt8Number m_nInput
 
icUInt8Number m_nOutput
 
icUInt8Number m_nReservedByte
 
icS15Fixed16Number m_XYZMatrix [9]
 

Detailed Description

Constructor & Destructor Documentation

◆ ~CIccTagXmlLut8()

virtual CIccTagXmlLut8::~CIccTagXmlLut8 ( )
inlinevirtual
572{}

Member Function Documentation

◆ Cleanup()

void CIccMBB::Cleanup ( )
inherited

Name: CIccMBB::Cleanup

Purpose: Frees the memory allocated to the object

3326{
3327 int i;
3328
3329 if (IsInputMatrix()) {
3330 if (m_CurvesB) {
3331 for (i=0; i<m_nInput; i++)
3332 if (m_CurvesB[i])
3333 delete m_CurvesB[i];
3334
3335 delete [] m_CurvesB;
3336 m_CurvesB = NULL;
3337 }
3338
3339 if (m_CurvesM) {
3340 for (i=0; i<m_nInput; i++)
3341 if (m_CurvesM[i])
3342 delete m_CurvesM[i];
3343
3344 delete [] m_CurvesM;
3345 m_CurvesM = NULL;
3346 }
3347
3348
3349 if (m_CurvesA) {
3350 for (i=0; i<m_nOutput; i++)
3351 if (m_CurvesA[i])
3352 delete m_CurvesA[i];
3353
3354 delete [] m_CurvesA;
3355 m_CurvesA = NULL;
3356 }
3357
3358 }
3359 else {
3360 if (m_CurvesA) {
3361 for (i=0; i<m_nInput; i++)
3362 if (m_CurvesA[i])
3363 delete m_CurvesA[i];
3364
3365 delete [] m_CurvesA;
3366 m_CurvesA = NULL;
3367 }
3368
3369 if (m_CurvesM) {
3370 for (i=0; i<m_nOutput; i++)
3371 if (m_CurvesM[i])
3372 delete m_CurvesM[i];
3373
3374 delete [] m_CurvesM;
3375 m_CurvesM = NULL;
3376 }
3377
3378 if (m_CurvesB) {
3379 for (i=0; i<m_nOutput; i++)
3380 if (m_CurvesB[i])
3381 delete m_CurvesB[i];
3382
3383 delete [] m_CurvesB;
3384 m_CurvesB = NULL;
3385 }
3386 }
3387
3388 if (m_Matrix) {
3389 delete m_Matrix;
3390 m_Matrix = NULL;
3391 }
3392
3393 if (m_CLUT) {
3394 delete m_CLUT;
3395 m_CLUT = NULL;
3396 }
3397}
LPIccCurve * m_CurvesB
Definition IccTagLut.h:490
virtual bool IsInputMatrix()
Definition IccTagLut.h:442
CIccCLUT * m_CLUT
Definition IccTagLut.h:487
LPIccCurve * m_CurvesM
Definition IccTagLut.h:489
icUInt8Number m_nOutput
Definition IccTagLut.h:481
LPIccCurve * m_CurvesA
Definition IccTagLut.h:486
icUInt8Number m_nInput
Definition IccTagLut.h:480
CIccMatrix * m_Matrix
Definition IccTagLut.h:488

References CIccMBB::IsInputMatrix(), CIccMBB::m_CLUT, CIccMBB::m_CurvesA, CIccMBB::m_CurvesB, CIccMBB::m_CurvesM, CIccMBB::m_Matrix, CIccMBB::m_nInput, and CIccMBB::m_nOutput.

Referenced by CIccMBB::~CIccMBB(), CIccMBB::Init(), and CIccMBB::operator=().

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

◆ 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 CIccMBB::Describe ( std::string &  sDescription,
int  nVerboseness 
)
virtualinherited

Name: CIccMBB::Describe

Purpose: Dump data associated with the tag to a string

Args: sDescription - string to concatenate tag dump to

Reimplemented from CIccTag.

3445{
3446 int i;
3447 icChar buf[128], color[40];
3448
3449
3450 if (IsInputMatrix()) {
3452 for (i=0; i<m_nInput; i++) {
3453 icColorIndexName(color, m_csInput, i, m_nInput, "");
3454 sprintf(buf, "B_Curve_%s", color);
3455 m_CurvesB[i]->DumpLut(sDescription, buf, m_csInput, i, nVerboseness);
3456 }
3457 }
3458
3459 if (m_Matrix)
3460 m_Matrix->DumpLut(sDescription, "Matrix", nVerboseness);
3461
3462 if (m_CurvesM) {
3463 for (i=0; i<m_nInput; i++) {
3464 icColorIndexName(color, m_csInput, i, m_nInput, "");
3466 sprintf(buf, "M_Curve_%s", color);
3467 else
3468 sprintf(buf, "B_Curve_%s", color);
3469 m_CurvesM[i]->DumpLut(sDescription, buf, m_csInput, i, nVerboseness);
3470 }
3471 }
3472
3473 if (m_CLUT)
3474 m_CLUT->DumpLut(sDescription, "CLUT", m_csInput, m_csOutput, nVerboseness, GetType()==icSigLut16Type);
3475
3476 if (m_CurvesA) {
3477 for (i=0; i<m_nOutput; i++) {
3478 icColorIndexName(color, m_csOutput, i, m_nOutput, "");
3479 sprintf(buf, "A_Curve_%s", color);
3480 m_CurvesA[i]->DumpLut(sDescription, buf, m_csOutput, i, nVerboseness);
3481 }
3482 }
3483 }
3484 else {
3485 if (m_CurvesA) {
3486 for (i=0; i<m_nInput; i++) {
3487 icColorIndexName(color, m_csInput, i, m_nInput, "");
3488 sprintf(buf, "A_Curve_%s", color);
3489 m_CurvesA[i]->DumpLut(sDescription, buf, m_csInput, i, nVerboseness);
3490 }
3491 }
3492
3493 if (m_CLUT)
3494 m_CLUT->DumpLut(sDescription, "CLUT", m_csInput, m_csOutput, nVerboseness);
3495
3496 if (m_CurvesM && this->GetType()!=icSigLut8Type) {
3497 for (i=0; i<m_nOutput; i++) {
3498 icColorIndexName(color, m_csOutput, i, m_nOutput, "");
3499 sprintf(buf, "M_Curve_%s", color);
3500 m_CurvesM[i]->DumpLut(sDescription, buf, m_csOutput, i, nVerboseness);
3501 }
3502 }
3503
3504 if (m_Matrix)
3505 m_Matrix->DumpLut(sDescription, "Matrix", nVerboseness);
3506
3507 if (m_CurvesB) {
3508 for (i=0; i<m_nOutput; i++) {
3509 icColorIndexName(color, m_csOutput, i, m_nOutput, "");
3510 sprintf(buf, "B_Curve_%s", color);
3511 m_CurvesB[i]->DumpLut(sDescription, buf, m_csOutput, i, nVerboseness);
3512 }
3513 }
3514 }
3515}
@ icSigLut8Type
Definition icProfileHeader.h:545
@ icSigLut16Type
Definition icProfileHeader.h:544
char icChar
Definition IccDefs.h:110
ICCPROFLIB_API void icColorIndexName(icChar *szName, icColorSpaceSignature csSig, int nIndex, int nColors, const icChar *szUnknown)
Definition IccUtil.cpp:295
virtual icTagTypeSignature GetType() const
Definition IccTagBasic.h:131
virtual void DumpLut(std::string &sDescription, const icChar *szName, icColorSpaceSignature csSig, int nIndex, int nVerboseness)
Definition IccTagLut.h:97
void DumpLut(std::string &sDescription, const icChar *szName, int nVerboseness)
Definition IccTagLut.cpp:1469
void DumpLut(std::string &sDescription, const icChar *szName, icColorSpaceSignature csInput, icColorSpaceSignature csOutput, int nVerboseness, bool bUseLegacy=false)
Definition IccTagLut.cpp:2157
icColorSpaceSignature m_csOutput
Definition IccTagLut.h:484
bool m_bUseMCurvesAsBCurves
Definition IccTagLut.h:478
icColorSpaceSignature m_csInput
Definition IccTagLut.h:483

References CIccCLUT::DumpLut(), CIccCurve::DumpLut(), CIccMatrix::DumpLut(), CIccTag::GetType(), icColorIndexName(), icSigLut16Type, icSigLut8Type, CIccMBB::IsInputMatrix(), CIccMBB::m_bUseMCurvesAsBCurves, CIccMBB::m_CLUT, CIccMBB::m_csInput, CIccMBB::m_csOutput, CIccMBB::m_CurvesA, CIccMBB::m_CurvesB, CIccMBB::m_CurvesM, CIccMBB::m_Matrix, CIccMBB::m_nInput, and CIccMBB::m_nOutput.

+ Here is the call graph for this function:

◆ 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 char * CIccTagXmlLut8::GetClassName ( ) const
inlinevirtual

Reimplemented from CIccTag.

574{return "CIccTagXmlLut8"; }

◆ GetCLUT()

CIccCLUT * CIccMBB::GetCLUT ( ) const
inlineinherited
469{return m_CLUT;}

References CIccMBB::m_CLUT.

Referenced by CIccEvalCompare::EvaluateProfile(), icMBBFromXml(), and icMBBToXml().

+ Here is the caller graph for this function:

◆ GetCsInput()

icColorSpaceSignature CIccMBB::GetCsInput ( )
inlineinherited
458{ return m_csInput; }

References CIccMBB::m_csInput.

◆ GetCsOutput()

icColorSpaceSignature CIccMBB::GetCsOutput ( )
inlineinherited
459{ return m_csOutput; }

References CIccMBB::m_csOutput.

◆ GetCurvesA()

LPIccCurve * CIccMBB::GetCurvesA ( ) const
inlineinherited
470{return m_CurvesA;}

References CIccMBB::m_CurvesA.

Referenced by icMBBFromXml(), and icMBBToXml().

+ Here is the caller graph for this function:

◆ GetCurvesB()

LPIccCurve * CIccMBB::GetCurvesB ( ) const
inlineinherited
471{return m_CurvesB;}

References CIccMBB::m_CurvesB.

Referenced by icMBBFromXml(), and icMBBToXml().

+ Here is the caller graph for this function:

◆ GetCurvesM()

LPIccCurve * CIccMBB::GetCurvesM ( ) const
inlineinherited
472{return m_CurvesM;}

References CIccMBB::m_CurvesM.

Referenced by icMBBFromXml(), and icMBBToXml().

+ Here is the caller graph for this function:

◆ 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 * CIccTagXmlLut8::GetExtension ( )
inlinevirtual

Reimplemented from CIccTag.

576{return this; }

◆ GetMatrix()

CIccMatrix * CIccMBB::GetMatrix ( ) const
inlineinherited
468{return m_Matrix; }

References CIccMBB::m_Matrix.

Referenced by icMBBFromXml(), and icMBBToXml().

+ Here is the caller graph for this function:

◆ GetPrecision()

virtual icUInt8Number CIccTagLut8::GetPrecision ( )
inlinevirtualinherited

Reimplemented from CIccMBB.

557{ return 1; }

◆ 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:

◆ GetType()

virtual icTagTypeSignature CIccTagLut8::GetType ( ) const
inlinevirtualinherited

Function: GetType()

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

Reimplemented from CIccTag.

556{ return icSigLut8Type; }

References icSigLut8Type.

Referenced by CIccTagLut8::Read(), CIccTagLut8::Validate(), and CIccTagLut8::Write().

+ Here is the caller graph for this function:

◆ Init()

void CIccMBB::Init ( icUInt8Number  nInputChannels,
icUInt8Number  nOutputChannels 
)
inherited

Name: CIccMBB::Init

Purpose: Cleans up any prior memory and Initializes the object.

Args: nInputChannels = number of input channels, nOutputChannels = number of output channels

3411{
3412 Cleanup();
3413 m_nInput = nInputChannels;
3414 m_nOutput = nOutputChannels;
3415}
void Cleanup()
Definition IccTagLut.cpp:3325

References CIccMBB::Cleanup(), CIccMBB::m_nInput, and CIccMBB::m_nOutput.

Referenced by CDevLinkWriter::begin(), and icMBBFromXml().

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

◆ InputChannels()

icUInt8Number CIccMBB::InputChannels ( ) const
inlineinherited
451{ return m_nInput; }

References CIccMBB::m_nInput.

Referenced by icMBBToXml().

+ Here is the caller graph for this function:

◆ 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:

◆ IsInputB()

bool CIccMBB::IsInputB ( )
inlineinherited
445{ return IsInputMatrix(); }

References CIccMBB::IsInputMatrix().

Referenced by CIccMBB::CIccMBB(), icMBBFromXml(), CIccMBB::NewCurvesA(), CIccMBB::NewCurvesB(), CIccMBB::operator=(), CIccTagLutAtoB::Read(), and CIccTagLutAtoB::Write().

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

◆ IsInputMatrix()

virtual bool CIccMBB::IsInputMatrix ( )
inlinevirtualinherited
442{ return m_bInputMatrix; } //Is matrix on input side of CLUT?
bool m_bInputMatrix
Definition IccTagLut.h:477

References CIccMBB::m_bInputMatrix.

Referenced by CIccMBB::CIccMBB(), CIccMBB::Cleanup(), CIccMBB::Describe(), icMBBFromXml(), icMBBToXml(), CIccMBB::IsInputB(), CIccMBB::NewCurvesM(), CIccMBB::operator=(), CIccTagLutAtoB::Read(), CIccTagLut8::SetColorSpaces(), CIccTagLut16::SetColorSpaces(), and CIccTagLutAtoB::Write().

+ Here is the caller graph for this function:

◆ IsMBBType()

virtual bool CIccMBB::IsMBBType ( )
inlinevirtualinherited

Reimplemented from CIccTag.

439{ return true;}

◆ 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; }

◆ NewCLUT() [1/2]

CIccCLUT * CIccMBB::NewCLUT ( icUInt8Number pGridPoints,
icUInt8Number  nPrecision = 2 
)
inherited

Name: CIccMBB::NewCLUT

Purpose: Allocates memory for a new CLUT and initializes it

Args: pGridPoints = number of grid points in the CLUT

Return: Pointer to the CIccCLUT object

3763{
3764 if (m_CLUT)
3765 return m_CLUT;
3766
3767 m_CLUT = new CIccCLUT(m_nInput, m_nOutput, nPrecision);
3768
3769 m_CLUT->Init(pGridPoints);
3770
3771 return m_CLUT;
3772}
Definition IccTagLut.h:326
bool Init(icUInt8Number nGridPoints, icUInt32Number nMaxSize=0, icUInt8Number nBytesPerPoint=4)
Definition IccTagLut.cpp:1806

References CIccCLUT::CIccCLUT(), CIccCLUT::Init(), CIccMBB::m_CLUT, CIccMBB::m_nInput, and CIccMBB::m_nOutput.

+ Here is the call graph for this function:

◆ NewCLUT() [2/2]

CIccCLUT * CIccMBB::NewCLUT ( icUInt8Number  nGridPoints,
icUInt8Number  nPrecision = 2 
)
inherited

Name: CIccMBB::NewCLUT

Purpose: Allocates memory for a new CLUT and initializes it

Args: nGridPoints = number of grid points in the CLUT

Return: Pointer to the CIccCLUT object

3816{
3817 if (m_CLUT)
3818 return m_CLUT;
3819
3820 m_CLUT = new CIccCLUT(m_nInput, m_nOutput, nPrecision);
3821
3822 m_CLUT->Init(nGridPoints);
3823
3824 return m_CLUT;
3825}

References CIccCLUT::CIccCLUT(), CIccCLUT::Init(), CIccMBB::m_CLUT, CIccMBB::m_nInput, and CIccMBB::m_nOutput.

Referenced by CDevLinkWriter::begin().

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

◆ NewCopy()

virtual CIccTag * CIccTagLut8::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 CIccMBB.

553{return new CIccTagLut8(*this);}
CIccTagLut8()
Definition IccTagLut.cpp:4453

References CIccTagLut8::CIccTagLut8().

+ Here is the call graph for this function:

◆ NewCurvesA()

LPIccCurve * CIccMBB::NewCurvesA ( )
inherited

Name: CIccMBB::NewCurvesA

Purpose: Allocates memory for a new set of A-curves

Return: Pointer to the LPIccCurve object

3674{
3675 if (m_CurvesA)
3676 return m_CurvesA;
3677
3678 icUInt8Number nCurves = !IsInputB() ? m_nInput : m_nOutput;
3679
3680 m_CurvesA = new LPIccCurve[nCurves];
3681 memset(m_CurvesA, 0, nCurves * sizeof(LPIccCurve));
3682
3683 return m_CurvesA;
3684}
unsigned char icUInt8Number
Definition icProfileHeader.h:250
Definition IccTagLut.h:91
bool IsInputB()
Definition IccTagLut.h:445

References CIccMBB::IsInputB(), CIccMBB::m_CurvesA, CIccMBB::m_nInput, and CIccMBB::m_nOutput.

Referenced by CDevLinkWriter::begin(), icMBBFromXml(), CIccTagLutAtoB::Read(), CIccTagLut8::Read(), and CIccTagLut16::Read().

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

◆ NewCurvesB()

LPIccCurve * CIccMBB::NewCurvesB ( )
inherited

Name: CIccMBB::NewCurvesB

Purpose: Allocates memory for a new set of B-curves

Return: Pointer to the LPIccCurve object

3719{
3720 if (m_CurvesB)
3721 return m_CurvesB;
3722
3723 icUInt8Number nCurves = IsInputB() ? m_nInput : m_nOutput;
3724
3725 m_CurvesB = new LPIccCurve[nCurves];
3726 memset(m_CurvesB, 0, nCurves * sizeof(LPIccCurve));
3727
3728 return m_CurvesB;
3729}

References CIccMBB::IsInputB(), CIccMBB::m_CurvesB, CIccMBB::m_nInput, and CIccMBB::m_nOutput.

Referenced by CDevLinkWriter::begin(), icMBBFromXml(), CIccTagLutAtoB::Read(), CIccTagLut8::Read(), CIccTagLut16::Read(), CIccTagLut8::SetColorSpaces(), and CIccTagLut16::SetColorSpaces().

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

◆ NewCurvesM()

LPIccCurve * CIccMBB::NewCurvesM ( )
inherited

Name: CIccMBB::NewCurvesM

Purpose: Allocates memory for a new set of M-curves

Return: Pointer to the LPIccCurve object

3697{
3698 if (m_CurvesM)
3699 return m_CurvesM;
3700
3702
3703 m_CurvesM = new LPIccCurve[nCurves];
3704 memset(m_CurvesM, 0, nCurves * sizeof(LPIccCurve));
3705
3706 return m_CurvesM;
3707}

References CIccMBB::IsInputMatrix(), CIccMBB::m_CurvesM, CIccMBB::m_nInput, and CIccMBB::m_nOutput.

Referenced by icMBBFromXml(), and CIccTagLutAtoB::Read().

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

◆ NewMatrix()

CIccMatrix * CIccMBB::NewMatrix ( )
inherited

Name: CIccMBB::NewMatrix

Purpose: Allocates memory for a new matrix

Return: Pointer to the CIccMatrix object

3741{
3742 if (m_Matrix)
3743 return m_Matrix;
3744
3745 m_Matrix = new CIccMatrix;
3746
3747 return m_Matrix;
3748}
Definition IccTagLut.h:260

References CIccMBB::m_Matrix.

Referenced by icMBBFromXml(), CIccTagLut8::SetColorSpaces(), and CIccTagLut16::SetColorSpaces().

+ Here is the caller graph for this function:

◆ OutputChannels()

icUInt8Number CIccMBB::OutputChannels ( ) const
inlineinherited
452{ return m_nOutput; }

References CIccMBB::m_nOutput.

Referenced by icMBBToXml().

+ Here is the caller graph for this function:

◆ ParseXml()

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

Implements CIccTagXml.

3912{
3913
3914 if (pNode) {
3915 return icMBBFromXml(this, pNode, icConvert8Bit, parseStr);
3916 }
3917 return false;
3918}
bool icMBBFromXml(CIccMBB *pMBB, xmlNode *pNode, icConvertType nType, std::string &parseStr)
Definition IccTagXml.cpp:3793
@ icConvert8Bit
Definition IccXmlConfig.h:68

References icConvert8Bit, and icMBBFromXml().

+ Here is the call graph for this function:

◆ Read() [1/2]

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

Name: CIccTagLut8::Read

Purpose: Read in the tag contents 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.

4528{
4530 icUInt32Number nStart, nEnd;
4531 icUInt8Number i, nGrid;
4532 LPIccCurve *pCurves;
4533 CIccTagCurve *pCurve;
4534
4535 if (size<13*sizeof(icUInt32Number) || !pIO) {
4536 return false;
4537 }
4538
4539 nStart = pIO->Tell();
4540 nEnd = nStart + size;
4541
4542 if (!pIO->Read32(&sig) ||
4543 !pIO->Read32(&m_nReserved) ||
4544 !pIO->Read8(&m_nInput) ||
4545 !pIO->Read8(&m_nOutput) ||
4546 !pIO->Read8(&nGrid) ||
4547 !pIO->Read8(&m_nReservedByte) ||
4548 pIO->Read32(m_XYZMatrix, 9) != 9)
4549 return false;
4550
4551 if (sig!=GetType())
4552 return false;
4553
4554 //B Curves
4555 pCurves = NewCurvesB();
4556
4557 for (i=0; i<m_nInput; i++) {
4558 if (256 > nEnd - pIO->Tell())
4559 return false;
4560
4561 pCurves[i] = pCurve = (CIccTagCurve*)CIccTag::Create(icSigCurveType);
4562
4563 if (!pCurve->SetSize(256))
4564 return false;
4565
4566 if (pIO->ReadUInt8Float(&(*pCurve)[0], 256) != 256)
4567 return false;
4568 }
4569
4570 //CLUT
4572 if (m_CLUT == NULL)
4573 return false;
4574
4575 if (!m_CLUT->Init(nGrid, nEnd - pIO->Tell(), 1))
4576 return false;
4577
4578 if (!m_CLUT->ReadData(nEnd - pIO->Tell(), pIO, 1))
4579 return false;
4580
4581 //A Curves
4582 pCurves = NewCurvesA();
4583 if (pCurves == NULL)
4584 return false;
4585
4586 for (i=0; i<m_nOutput; i++) {
4587 if (256 > nEnd - pIO->Tell())
4588 return false;
4589
4590 pCurves[i] = pCurve = (CIccTagCurve*)CIccTag::Create(icSigCurveType);
4591
4592 if (!pCurve->SetSize(256))
4593 return false;
4594
4595 if (pIO->ReadUInt8Float(&(*pCurve)[0], 256) != 256)
4596 return false;
4597 }
4598 return true;
4599}
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icTagTypeSignature
Definition icProfileHeader.h:526
@ icSigCurveType
Definition icProfileHeader.h:533
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104
virtual icInt32Number Tell()
Definition IccIO.h:133
icInt32Number ReadUInt8Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:203
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
icUInt32Number m_nReserved
Definition IccTagBasic.h:235
static CIccTag * Create(icTagTypeSignature sig)
Definition IccTagBasic.cpp:143
Definition IccTagLut.h:128
bool SetSize(icUInt32Number nSize, icTagCurveSizeInit nSizeOpt=icInitZero)
Definition IccTagLut.cpp:439
bool ReadData(icUInt32Number size, CIccIO *pIO, icUInt8Number nPrecision)
Definition IccTagLut.cpp:1896
LPIccCurve * NewCurvesB()
Definition IccTagLut.cpp:3718
LPIccCurve * NewCurvesA()
Definition IccTagLut.cpp:3673
virtual icTagTypeSignature GetType() const
Definition IccTagLut.h:556
icUInt8Number m_nReservedByte
Definition IccTagLut.h:566
icS15Fixed16Number m_XYZMatrix[9]
Definition IccTagLut.h:567

References CIccCLUT::CIccCLUT(), CIccTag::Create(), CIccTagLut8::GetType(), icSigCurveType, CIccCLUT::Init(), CIccMBB::m_CLUT, CIccMBB::m_nInput, CIccMBB::m_nOutput, CIccTag::m_nReserved, CIccTagLut8::m_nReservedByte, CIccTagLut8::m_XYZMatrix, CIccMBB::NewCurvesA(), CIccMBB::NewCurvesB(), CIccTagCurve::operator[](), CIccIO::Read32(), CIccIO::Read8(), CIccCLUT::ReadData(), CIccIO::ReadUInt8Float(), CIccTagCurve::SetSize(), and CIccIO::Tell().

+ 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; }

◆ SetCLUT()

CIccCLUT * CIccMBB::SetCLUT ( CIccCLUT clut)
inherited

Name: CIccMBB::SetCLUT

Purpose: Assignes CLUT connection to an initialized new CLUT

Args: clut = pointer to a previously allocated CLUT (Onwership is transfered to CIccMBB object).

Return: Pointer to the CIccCLUT object or NULL if clut is incompatible with CIccMBB object. If the clut is incompatible it is deleted.

3789{
3790 if (clut->GetInputDim() != m_nInput || clut->GetOutputChannels() != m_nOutput) {
3791 delete clut;
3792 return NULL;
3793 }
3794
3795 if (m_CLUT) {
3796 delete m_CLUT;
3797 }
3798
3799 m_CLUT = clut;
3800 return clut;
3801}
icUInt8Number GetInputDim() const
Definition IccTagLut.h:356
icUInt16Number GetOutputChannels() const
Definition IccTagLut.h:357

References CIccCLUT::GetInputDim(), CIccCLUT::GetOutputChannels(), CIccMBB::m_CLUT, CIccMBB::m_nInput, and CIccMBB::m_nOutput.

Referenced by icMBBFromXml().

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

◆ SetColorSpaces()

void CIccTagLut8::SetColorSpaces ( icColorSpaceSignature  csInput,
icColorSpaceSignature  csOutput 
)
virtualinherited

Name: CIccTagLut8::SetColorSpaces

Purpose: Sets the input and output color spaces

Args: csInput = input color space signature, csOutput = output color space signature

Reimplemented from CIccMBB.

4615{
4616 if (csInput==icSigXYZData) {
4617 int i;
4618
4619 if (!m_CurvesM && IsInputMatrix()) { //Transfer ownership of curves
4621 m_CurvesB = NULL;
4622
4623 LPIccCurve *pCurves = NewCurvesB();
4624 CIccTagCurve *pCurve;
4625 for (i=0; i<m_nInput; i++) {
4626 pCurves[i] = pCurve = (CIccTagCurve*)CIccTag::Create(icSigCurveType);
4627 pCurve->SetSize(0);
4628 }
4629
4631 }
4632
4633 if (!m_Matrix) {
4634 CIccMatrix *pMatrix = NewMatrix();
4635 for (i=0; i<9; i++) {
4636 pMatrix->m_e[i] = icFtoD(m_XYZMatrix[i]);
4637 }
4638
4639 pMatrix->m_bUseConstants=false;
4640 }
4641 }
4642 else {
4643 m_XYZMatrix[0] = m_XYZMatrix[4] = m_XYZMatrix[8] = icDtoF(1.0);
4644 m_XYZMatrix[1] = m_XYZMatrix[2] = m_XYZMatrix[3] =
4645 m_XYZMatrix[5] = m_XYZMatrix[6] = m_XYZMatrix[7] = 0;
4646 }
4647
4648 CIccMBB::SetColorSpaces(csInput, csOutput);
4649}
@ icSigXYZData
Definition icProfileHeader.h:846
ICCPROFLIB_API icS15Fixed16Number icDtoF(icFloatNumber num)
Definition IccUtil.cpp:545
ICCPROFLIB_API icFloatNumber icFtoD(icS15Fixed16Number num)
Definition IccUtil.cpp:559
icFloatNumber m_e[12]
Definition IccTagLut.h:269
bool m_bUseConstants
Definition IccTagLut.h:270
CIccMatrix * NewMatrix()
Definition IccTagLut.cpp:3740
virtual void SetColorSpaces(icColorSpaceSignature csInput, icColorSpaceSignature csOutput)
Definition IccTagLut.cpp:3428

References CIccTag::Create(), icDtoF(), icFtoD(), icSigCurveType, icSigXYZData, CIccMBB::IsInputMatrix(), CIccMatrix::m_bUseConstants, CIccMBB::m_bUseMCurvesAsBCurves, CIccMBB::m_CurvesB, CIccMBB::m_CurvesM, CIccMatrix::m_e, CIccMBB::m_Matrix, CIccMBB::m_nInput, CIccTagLut8::m_XYZMatrix, CIccMBB::NewCurvesB(), CIccMBB::NewMatrix(), CIccMBB::SetColorSpaces(), and CIccTagCurve::SetSize().

+ Here is the call graph for this function:

◆ SwapMBCurves()

bool CIccMBB::SwapMBCurves ( )
inlineinherited
446{ return m_bUseMCurvesAsBCurves; }

References CIccMBB::m_bUseMCurvesAsBCurves.

Referenced by icMBBToXml().

+ Here is the caller graph for this function:

◆ ToXml()

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

Implements CIccTagXml.

3902{
3903 std::string info;
3904
3905 bool rv = icMBBToXml(xml, this, icConvert8Bit, blanks, false);
3906
3907 return rv;
3908}
bool icMBBToXml(std::string &xml, CIccMBB *pMBB, icConvertType nType, std::string blanks="", bool bSaveGridPoints=false)
Definition IccTagXml.cpp:3131

References icConvert8Bit, and icMBBToXml().

+ Here is the call graph for this function:

◆ UseLegacyPCS()

virtual bool CIccMBB::UseLegacyPCS ( ) const
inlinevirtualinherited

Reimplemented in CIccTagLut16.

443{ return false; } //Treat Lab Encoding differently?

◆ Validate() [1/2]

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

Name: CIccTagLut8::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 CIccMBB.

4781{
4782 icValidateStatus rv = CIccMBB::Validate(sigPath, sReport, pProfile);
4783
4784 CIccInfo Info;
4785 std::string sSigPathName = Info.GetSigPathName(sigPath);
4786 icSignature sig = icGetFirstSigPathSig(sigPath);
4787
4788 if (!pProfile) {
4789 return rv;
4790 }
4791
4792 switch(sig) {
4793 case icSigAToB0Tag:
4794 case icSigAToB1Tag:
4795 case icSigAToB2Tag:
4796 case icSigBToA0Tag:
4797 case icSigBToA1Tag:
4798 case icSigBToA2Tag:
4799 case icSigGamutTag:
4800 {
4801 icUInt32Number nInput, nOutput;
4802 if (sig==icSigAToB0Tag || sig==icSigAToB1Tag || sig==icSigAToB2Tag || sig==icSigGamutTag) {
4803 nInput = icGetSpaceSamples(pProfile->m_Header.pcs);
4804 nOutput = icGetSpaceSamples(pProfile->m_Header.colorSpace);
4805 }
4806 else {
4807 nInput = icGetSpaceSamples(pProfile->m_Header.colorSpace);
4808 nOutput = icGetSpaceSamples(pProfile->m_Header.pcs);
4809 }
4810
4811 if (sig==icSigGamutTag) {
4812 nOutput = 1;
4813 }
4814
4815 icUInt8Number i;
4816 if (m_CurvesB) {
4817 for (i=0; i<nInput; i++) {
4818 if (m_CurvesB[i]) {
4819 rv = icMaxStatus(rv, m_CurvesB[i]->Validate(sigPath+icGetSigPath(GetType()), sReport, pProfile));
4820 if (m_CurvesB[i]->GetType()==icSigCurveType) {
4821 CIccTagCurve *pTagCurve = (CIccTagCurve*)m_CurvesB[i];
4822 if (pTagCurve->GetSize()==1) {
4823 sReport += icMsgValidateCriticalError;
4824 sReport += sSigPathName;
4825 sReport += " - lut8Tags do not support single entry gamma curves.\n";
4827 }
4828 }
4829 }
4830 else {
4831 sReport += icMsgValidateCriticalError;
4832 sReport += sSigPathName;
4833 sReport += " - Incorrect number of B-curves.\n";
4835 }
4836 }
4837 }
4838
4839 if (m_Matrix) {
4840 rv = icMaxStatus(rv, m_Matrix->Validate(sigPath + icGetSigPath(GetType()), sReport, pProfile));
4841 }
4842 else {
4843 int sum=0;
4844 for (int i=0; i<9; i++) {
4845 sum += m_XYZMatrix[i];
4846 }
4847 if (m_XYZMatrix[0]!=1.0 || m_XYZMatrix[4]!=1.0 || m_XYZMatrix[8]!=1.0 || sum!=3.0) {
4848 sReport += icMsgValidateWarning;
4849 sReport += sSigPathName;
4850 sReport += " - Matrix must be identity.\n";
4852 }
4853 }
4854
4855 if (m_CurvesA) {
4856
4857 for (i=0; i<nOutput; i++) {
4858 if (m_CurvesA[i]) {
4859 rv = icMaxStatus(rv, m_CurvesA[i]->Validate(sigPath+icGetSigPath(GetType()), sReport, pProfile));
4860 if (m_CurvesA[i]->GetType()==icSigCurveType) {
4861 CIccTagCurve *pTagCurve = (CIccTagCurve*)m_CurvesA[i];
4862 if (pTagCurve->GetSize()==1) {
4863 sReport += icMsgValidateCriticalError;
4864 sReport += sSigPathName;
4865 sReport += " - lut8Tags do not support single entry gamma curves.\n";
4867 }
4868 }
4869 }
4870 else {
4871 sReport += icMsgValidateCriticalError;
4872 sReport += sSigPathName;
4873 sReport += " - Incorrect number of A-curves.\n";
4875 }
4876 }
4877
4878 }
4879
4880 break;
4881 }
4882 default:
4883 {
4884 }
4885 }
4886
4887
4888 return rv;
4889}
icUInt32Number icSignature
Definition icProfileHeader.h:271
@ icSigBToA2Tag
Definition icProfileHeader.h:376
@ icSigAToB0Tag
Definition icProfileHeader.h:342
@ icSigBToA1Tag
Definition icProfileHeader.h:375
@ icSigAToB2Tag
Definition icProfileHeader.h:344
@ icSigBToA0Tag
Definition icProfileHeader.h:374
@ icSigAToB1Tag
Definition icProfileHeader.h:343
@ icSigGamutTag
Definition icProfileHeader.h:412
icValidateStatus
Definition IccDefs.h:119
@ icValidateWarning
Definition IccDefs.h:121
@ icValidateCriticalError
Definition IccDefs.h:123
ICCPROFLIB_API icSignature icGetFirstSigPathSig(std::string sigPath)
Definition IccUtil.cpp:1201
ICCPROFLIB_API icUInt32Number icGetSpaceSamples(icColorSpaceSignature sig)
Definition IccUtil.cpp:1303
ICCPROFLIB_API std::string icGetSigPath(icUInt32Number sig)
Definition IccUtil.cpp:1191
ICCPROFLIB_API const char * icMsgValidateWarning
Definition IccUtil.cpp:90
ICCPROFLIB_API const char * icMsgValidateCriticalError
Definition IccUtil.cpp:92
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
icUInt32Number GetSize() const
Definition IccTagLut.h:148
icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
Definition IccTagLut.cpp:1579
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL)
Definition IccTagLut.cpp:3532
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL)
Definition IccTagLut.cpp:4780

References icHeader::colorSpace, CIccInfo::GetSigPathName(), CIccTagCurve::GetSize(), CIccTag::GetType(), CIccTagLut8::GetType(), icGetFirstSigPathSig(), icGetSigPath(), icGetSpaceSamples(), icMaxStatus(), icMsgValidateCriticalError, icMsgValidateWarning, icSigAToB0Tag, icSigAToB1Tag, icSigAToB2Tag, icSigBToA0Tag, icSigBToA1Tag, icSigBToA2Tag, icSigCurveType, icSigGamutTag, icValidateCriticalError, icValidateWarning, CIccMBB::m_CurvesA, CIccMBB::m_CurvesB, CIccMBB::m_Matrix, CIccTagLut8::m_XYZMatrix, icHeader::pcs, CIccMBB::Validate(), CIccTag::Validate(), and CIccMatrix::Validate().

+ Here is the call graph for this function:

◆ Validate() [2/2]

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

Function: Validate Each derived tag will implement it's own IsValid() function

Parameter(s): sig - signature of tag being validated, sDescription - A string to put tag validation report.

Name: CIccTag::Validate

Purpose: Check tag data validity. In base class we only look at the tag's reserved data value

Args: sig = signature of tag being validated, sReport = String to add report information to

Return: icValidateStatusOK if valid, or other error status.

Reimplemented in CIccTagGamutBoundaryDesc, CIccTagText, CIccTagUtf8Text, CIccTagZipUtf8Text, CIccTagUtf16Text, CIccTagTextDescription, CIccTagSignature, CIccTagNamedColor2, CIccTagXYZ, CIccTagChromaticity, CIccTagCicp, CIccTagSparseMatrixArray, CIccTagNum< T, Tsig >, CIccTagFloatNum< T, Tsig >, CIccTagMeasurement, CIccTagMultiLocalizedUnicode, CIccTagData, CIccTagDateTime, CIccTagColorantOrder, CIccTagColorantTable, CIccTagViewingConditions, CIccTagProfileSeqDesc, CIccTagResponseCurveSet16, CIccTagSpectralDataInfo, CIccTagSpectralViewingConditions, CIccTagEmbeddedHeightImage, CIccTagEmbeddedNormalImage, CIccTagStruct, CIccTagArray, CIccTagDict, CIccTagEmbeddedProfile, CIccTagCurve, CIccTagParametricCurve, CIccTagSegmentedCurve, CIccTagMultiProcessElement, and CIccTagProfileSequenceId.

165{
167
168 if (m_nReserved != 0) {
169 CIccInfo Info;
170 sReport += icMsgValidateNonCompliant;
171 sReport += Info.GetSigPathName(sigPath);
172 sReport += " - Reserved Value must be zero.\n";
173
175 }
176
177 return rv;
178}
@ icValidateOK
Definition IccDefs.h:120
@ icValidateNonCompliant
Definition IccDefs.h:122
ICCPROFLIB_API const char * icMsgValidateNonCompliant
Definition IccUtil.cpp:91

References CIccInfo::GetSigPathName(), icMsgValidateNonCompliant, icValidateNonCompliant, icValidateOK, and CIccTag::m_nReserved.

Referenced by CIccTagGamutBoundaryDesc::Validate(), CIccMBB::Validate(), CIccTagLutAtoB::Validate(), CIccTagLutBtoA::Validate(), CIccTagLut8::Validate(), CIccTagLut16::Validate(), CIccArrayUnknown::Validate(), CIccArrayColorantInfo::Validate(), CIccArrayNamedColor::Validate(), CIccStructUnknown::Validate(), CIccTagText::Validate(), CIccTagUtf8Text::Validate(), CIccTagZipUtf8Text::Validate(), CIccTagUtf16Text::Validate(), CIccTagTextDescription::Validate(), CIccTagSignature::Validate(), CIccTagNamedColor2::Validate(), CIccTagXYZ::Validate(), CIccTagChromaticity::Validate(), CIccTagCicp::Validate(), CIccTagNum< T, Tsig >::Validate(), CIccTagFloatNum< T, Tsig >::Validate(), CIccTagMeasurement::Validate(), CIccTagMultiLocalizedUnicode::Validate(), CIccTagData::Validate(), CIccTagDateTime::Validate(), CIccTagColorantOrder::Validate(), CIccTagColorantTable::Validate(), CIccTagViewingConditions::Validate(), CIccTagProfileSeqDesc::Validate(), CIccTagResponseCurveSet16::Validate(), CIccTagSpectralDataInfo::Validate(), CIccTagSpectralViewingConditions::Validate(), CIccTagEmbeddedHeightImage::Validate(), CIccTagEmbeddedNormalImage::Validate(), CIccTagStruct::Validate(), CIccTagArray::Validate(), CIccTagDict::Validate(), CIccTagEmbeddedProfile::Validate(), CIccTagCurve::Validate(), CIccTagParametricCurve::Validate(), and CIccTagProfileSequenceId::Validate().

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

◆ Write()

bool CIccTagLut8::Write ( CIccIO pIO)
virtualinherited

Name: CIccTagLut8::Write

Purpose: Write the tag to a file

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

Return: true = succesful, false = failure

Reimplemented from CIccTag.

4666{
4668 icUInt8Number i, nGrid;
4669 icS15Fixed16Number XYZMatrix[9];
4670 icUInt16Number nInputEntries, nOutputEntries;
4671 LPIccCurve *pCurves;
4672 CIccTagCurve *pCurve;
4674
4675 if (m_Matrix) {
4676 for (i=0; i<9; i++)
4677 XYZMatrix[i] = icDtoF(m_Matrix->m_e[i]);
4678 }
4679 else {
4680 memset(XYZMatrix, 0, 9*sizeof(icS15Fixed16Number));
4681 XYZMatrix[0] = XYZMatrix[4] = XYZMatrix[8] = icDtoF(1.0);
4682 }
4683
4685 pCurves = m_CurvesM;
4686 }
4687 else {
4688 pCurves = m_CurvesB;
4689 }
4690
4691 if (!pCurves || !m_CurvesA || !m_CLUT)
4692 return false;
4693
4694 nGrid = m_CLUT->GridPoints();
4695
4696 nInputEntries = (icUInt16Number)(((CIccTagCurve*)pCurves[0])->GetSize());
4697 nOutputEntries = (icUInt16Number)(((CIccTagCurve*)m_CurvesA[0])->GetSize());
4698
4699 if (!pIO->Write32(&sig) ||
4700 !pIO->Write32(&m_nReserved) ||
4701 !pIO->Write8(&m_nInput) ||
4702 !pIO->Write8(&m_nOutput) ||
4703 !pIO->Write8(&nGrid) ||
4704 !pIO->Write8(&m_nReservedByte) ||
4705 pIO->Write32(XYZMatrix, 9) != 9)
4706 return false;
4707
4708 //B Curves
4709 for (i=0; i<m_nInput; i++) {
4710 if (pCurves[i]->GetType()!=icSigCurveType)
4711 return false;
4712
4713 pCurve = (CIccTagCurve*)pCurves[i];
4714 if (!pCurve)
4715 return false;
4716
4717 if (pCurve->GetSize()!=256) {
4719
4720 for (j=0; j<256; j++) {
4721 v = pCurve->Apply((icFloat32Number)j / 255.0F);
4722 if (!pIO->WriteUInt8Float(&v, 1))
4723 return false;
4724 }
4725 }
4726 else {
4727 if (pIO->WriteUInt8Float(&(*pCurve)[0], 256)!=256)
4728 return false;
4729 }
4730 }
4731
4732 //CLUT
4733 if (!m_CLUT->WriteData(pIO, 1))
4734 return false;
4735
4736 //A Curves
4737 pCurves = m_CurvesA;
4738
4739 for (i=0; i<m_nOutput; i++) {
4740 if (pCurves[i]->GetType()!=icSigCurveType)
4741 return false;
4742
4743 pCurve = (CIccTagCurve*)pCurves[i];
4744
4745 if (!pCurve)
4746 return false;
4747
4748 if (pCurve->GetSize()!=256) {
4750
4751 for (j=0; j<256; j++) {
4752 v = pCurve->Apply((icFloat32Number)j / 255.0F);
4753 if (!pIO->WriteUInt8Float(&v, 1))
4754 return false;
4755 }
4756 }
4757 else {
4758 if (pIO->WriteUInt8Float(&(*pCurve)[0], 256)!=256)
4759 return false;
4760 }
4761 }
4762 return true;
4763}
float icFloat32Number
Definition icProfileHeader.h:313
unsigned short icUInt16Number
Definition icProfileHeader.h:256
icInt32Number icS15Fixed16Number
Definition icProfileHeader.h:302
virtual icInt32Number Write8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:105
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
icInt32Number WriteUInt8Float(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:219
virtual icFloatNumber Apply(icFloatNumber v) const
Definition IccTagLut.cpp:568
bool WriteData(CIccIO *pIO, icUInt8Number nPrecision)
Definition IccTagLut.cpp:1936
icUInt8Number GridPoints() const
Definition IccTagLut.h:349

References CIccTagCurve::Apply(), CIccTagCurve::GetSize(), CIccTag::GetType(), CIccTagLut8::GetType(), CIccCLUT::GridPoints(), icDtoF(), icSigCurveType, CIccMBB::m_bUseMCurvesAsBCurves, CIccMBB::m_CLUT, CIccMBB::m_CurvesA, CIccMBB::m_CurvesB, CIccMBB::m_CurvesM, CIccMatrix::m_e, CIccMBB::m_Matrix, CIccMBB::m_nInput, CIccMBB::m_nOutput, CIccTag::m_nReserved, CIccTagLut8::m_nReservedByte, CIccTagCurve::operator[](), CIccIO::Write32(), CIccIO::Write8(), CIccCLUT::WriteData(), and CIccIO::WriteUInt8Float().

+ Here is the call graph for this function:

Field Documentation

◆ m_bInputMatrix

◆ m_bUseMCurvesAsBCurves

◆ m_CLUT

◆ m_csInput

◆ m_csOutput

◆ m_CurvesA

◆ m_CurvesB

◆ m_CurvesM

◆ m_Matrix

◆ m_nInput

◆ m_nOutput

◆ 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_nReservedByte

icUInt8Number CIccTagLut8::m_nReservedByte
protectedinherited

◆ m_XYZMatrix


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