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

#include <IccTagBasic.h>

+ Collaboration diagram for CIccProfileDescText:

Public Member Functions

 CIccProfileDescText ()
 
 CIccProfileDescText (const CIccProfileDescText &IPDC)
 
virtual ~CIccProfileDescText ()
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
CIccTagGetTag () const
 
virtual icTagTypeSignature GetType () const
 
CIccProfileDescTextoperator= (const CIccProfileDescText &ProfDescText)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
bool SetType (icTagTypeSignature nType)
 
virtual bool Write (CIccIO *pIO)
 

Data Fields

bool m_bNeedsPading
 

Protected Attributes

CIccTagm_pTag
 

Detailed Description

Data Class: CIccProfileDescText

Purpose: Private text class for CIccProfileDescStruct. Text can be either a CIccTagTextDescription or a CIccTagMultiLocalizedUnicode so this class provides a single interface to both.

Constructor & Destructor Documentation

◆ CIccProfileDescText() [1/2]

CIccProfileDescText::CIccProfileDescText ( )

Name: CIccProfileDescText::CIccProfileDescText

Purpose: Constructor

9174{
9175 m_pTag = NULL;
9176 m_bNeedsPading = false;
9177}
bool m_bNeedsPading
Definition IccTagBasic.h:1475
CIccTag * m_pTag
Definition IccTagBasic.h:1478

References m_bNeedsPading, and m_pTag.

◆ CIccProfileDescText() [2/2]

CIccProfileDescText::CIccProfileDescText ( const CIccProfileDescText IPDC)

Name: CIccProfileDescText::CIccProfileDescText

Purpose: Copy Constructor

Args: IPDC = The CIccTagUnknown object to be copied

9191{
9192 if (IPDC.m_pTag) {
9193 m_pTag = IPDC.m_pTag->NewCopy();
9195 }
9196 else {
9197 m_pTag = NULL;
9198 m_bNeedsPading = false;
9199 }
9200}
virtual CIccTag * NewCopy() const
Definition IccTagBasic.h:121

References m_bNeedsPading, m_pTag, and CIccTag::NewCopy().

+ Here is the call graph for this function:

◆ ~CIccProfileDescText()

CIccProfileDescText::~CIccProfileDescText ( )
virtual

Name: CIccProfileDescText::~CIccProfileDescText

Purpose: Destructor

9243{
9244 if (m_pTag)
9245 delete m_pTag;
9246}

References m_pTag.

Member Function Documentation

◆ Describe()

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

Name: CIccProfileDescText::Describe

Purpose: Dump data associated with the tag to a string

Args: sDescription - string to concatenate tag dump to

9311{
9312 if (m_pTag)
9313 m_pTag->Describe(sDescription, nVerboseness);
9314}
virtual void Describe(std::string &sDescription, int nVerboseness=0)
Definition IccTagBasic.h:221

References CIccTag::Describe(), and m_pTag.

Referenced by CIccTagProfileSeqDesc::Describe().

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

◆ GetTag()

CIccTag * CIccProfileDescText::GetTag ( ) const
inline
1468{ return m_pTag; }

References m_pTag.

Referenced by icProfDescToXml(), icXmlParseProfDesc(), CDevLinkWriter::iterate(), and CIccTagProfileSeqDesc::Validate().

+ Here is the caller graph for this function:

◆ GetType()

icTagTypeSignature CIccProfileDescText::GetType ( ) const
virtual

Name: CIccProfileDescText::SetType

Purpose: Gets the type of the profile description text. Could be either a MultiLocalizedUnicodeType or a TextDescriptionType.

9292{
9293 if (m_pTag)
9294 return m_pTag->GetType();
9295
9296 return icSigUnknownType;
9297}
#define icSigUnknownType
Definition icProfileHeader.h:591
virtual icTagTypeSignature GetType() const
Definition IccTagBasic.h:131

References CIccTag::GetType(), and m_pTag.

+ Here is the call graph for this function:

◆ operator=()

CIccProfileDescText & CIccProfileDescText::operator= ( const CIccProfileDescText ProfDescText)

Name: CIccProfileDescText::operator=

Purpose: Copy Operator

Args: ProfDescText = The CIccProfileDescText object to be copied

9214{
9215 if (&ProfDescText == this)
9216 return *this;
9217
9218 if (m_pTag)
9219 delete m_pTag;
9220
9221 if (ProfDescText.m_pTag) {
9222 m_pTag = ProfDescText.m_pTag->NewCopy();
9223 m_bNeedsPading = ProfDescText.m_bNeedsPading;
9224 }
9225 else {
9226 m_pTag = NULL;
9227 m_bNeedsPading = false;
9228 }
9229
9230 return *this;
9231}

References m_bNeedsPading, m_pTag, and CIccTag::NewCopy().

Referenced by CIccProfileDescStruct::CIccProfileDescStruct(), and CIccProfileDescStruct::operator=().

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

◆ Read()

bool CIccProfileDescText::Read ( icUInt32Number  size,
CIccIO pIO 
)
virtual

Name: CIccProfileDescText::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

9332{
9334 icUInt32Number nPos;
9335
9336 //Check for description tag type signature
9337 nPos = pIO->Tell();
9338
9339 if ((nPos&0x03) != 0)
9340 m_bNeedsPading = true;
9341
9342 if (!pIO->Read32(&sig))
9343 return false;
9344 pIO->Seek(nPos, icSeekSet);
9345
9346 if (sig==icSigTextDescriptionType)
9347 m_bNeedsPading = false;
9348
9349 if (!SetType(sig)) {
9350 //We couldn't find it, but we may be looking in the wrong place
9351 //Re-Sync to a 4 byte boundary
9352 pIO->Sync32();
9353
9354 nPos = pIO->Tell();
9355 if (!pIO->Read32(&sig))
9356 return false;
9357 pIO->Seek(nPos, icSeekSet);
9358
9359 if (!SetType(sig)) {
9360 return false;
9361 }
9362 }
9363
9364 if (m_pTag) {
9365 return m_pTag->Read(size, pIO);
9366 }
9367
9368 return false;
9369}
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icTagTypeSignature
Definition icProfileHeader.h:526
@ icSigTextDescriptionType
Definition icProfileHeader.h:566
@ icSeekSet
Definition IccIO.h:83
virtual icInt32Number Tell()
Definition IccIO.h:133
virtual icInt32Number Seek(icInt32Number nOffset, icSeekVal pos)
Definition IccIO.h:132
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
bool Sync32(icUInt32Number nOffset=0)
Operation to make sure read position is evenly divisible by 4.
Definition IccIO.cpp:357
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Definition IccTagBasic.h:167
bool SetType(icTagTypeSignature nType)
Definition IccTagBasic.cpp:9263

References icSeekSet, icSigTextDescriptionType, m_bNeedsPading, m_pTag, CIccTag::Read(), CIccIO::Read32(), CIccIO::Seek(), SetType(), CIccIO::Sync32(), and CIccIO::Tell().

Referenced by CIccTagProfileSeqDesc::Read().

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

◆ SetType()

bool CIccProfileDescText::SetType ( icTagTypeSignature  nType)

Name: CIccProfileDescText::SetType

Purpose: Sets the type of the profile description text. Could be either a MultiLocalizedUnicodeType or a TextDescriptionType.

Args: nType = the tag type signature

Return: true = successful, false = failure

9264{
9265 if (m_pTag) {
9266 if (m_pTag->GetType() == nType)
9267 return true;
9268
9269 delete m_pTag;
9270 }
9271
9272 if (nType == icSigMultiLocalizedUnicodeType ||
9273 nType == icSigTextDescriptionType)
9274 m_pTag = CIccTag::Create(nType);
9275 else
9276 m_pTag = NULL;
9277
9278 return(m_pTag != NULL);
9279}
@ icSigMultiLocalizedUnicodeType
Definition icProfileHeader.h:549
static CIccTag * Create(icTagTypeSignature sig)
Definition IccTagBasic.cpp:143

References CIccTag::Create(), CIccTag::GetType(), icSigMultiLocalizedUnicodeType, icSigTextDescriptionType, and m_pTag.

Referenced by icXmlParseProfDesc(), CDevLinkWriter::iterate(), and Read().

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

◆ Write()

bool CIccProfileDescText::Write ( CIccIO pIO)
virtual

Name: CIccProfileDescText::Write

Purpose: Write the tag to a file

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

Return: true = succesful, false = failure

9386{
9387 if (!m_pTag)
9388 return false;
9389
9390 if (m_pTag->Write(pIO)) {
9392 return pIO->Align32();
9393 else
9394 return true;
9395 }
9396
9397 return false;
9398}
bool Align32()
Write operation to make sure that filelength is evenly divisible by 4.
Definition IccIO.cpp:341
virtual bool Write(CIccIO *pIO)
Definition IccTagBasic.h:211

References CIccIO::Align32(), CIccTag::GetType(), icSigTextDescriptionType, m_pTag, and CIccTag::Write().

Referenced by CIccTagProfileSeqDesc::Write().

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

Field Documentation

◆ m_bNeedsPading

bool CIccProfileDescText::m_bNeedsPading

◆ m_pTag


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