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

#include <IccTagBasic.h>

+ Inheritance diagram for CIccTagTextDescription:
+ Collaboration diagram for CIccTagTextDescription:

Public Member Functions

 CIccTagTextDescription ()
 
 CIccTagTextDescription (const CIccTagTextDescription &ITTD)
 
virtual ~CIccTagTextDescription ()
 
icUInt32Number Capacity () const
 
virtual void Describe (std::string &sDescription, int nVerboseness)
 
virtual void DetachIO ()
 
icCharGetBuffer (icUInt32Number nSize)
 
virtual const icCharGetClassName () const
 
virtual IIccExtensionTagGetExtension ()
 
virtual icArraySignature GetTagArrayType () const
 
virtual icStructSignature GetTagStructType () const
 
const icCharGetText () const
 
virtual icTagTypeSignature GetType () const
 
icUInt16NumberGetUnicodeBuffer (icUInt32Number nSize)
 
virtual bool IsArrayType ()
 
virtual bool IsMBBType ()
 
virtual bool IsNumArrayType () const
 
virtual bool IsSupported ()
 
virtual CIccTagNewCopy () const
 
CIccTagTextDescriptionoperator= (const CIccTagTextDescription &TextDescTag)
 
const icCharoperator= (const icChar *szText)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO, CIccProfile *pProfile)
 
virtual bool ReadAll ()
 
void Release ()
 
void ReleaseUnicode ()
 
void SetText (const icChar *szText)
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 
virtual bool Write (CIccIO *pIO)
 

Static Public Member Functions

static CIccTagCreate (icTagTypeSignature sig)
 

Data Fields

icUInt32Number m_nReserved
 

Protected Attributes

bool m_bInvalidScript
 
icUInt32Number m_nASCIISize
 
icUInt16Number m_nScriptCode
 
icUInt8Number m_nScriptSize
 
icUInt32Number m_nUnicodeLanguageCode
 
icUInt32Number m_nUnicodeSize
 
icUInt8Number m_szScriptText [67]
 
icCharm_szText
 
icUInt16Numberm_uzUnicodeText
 

Detailed Description

Class: CIccTagTextDescription()

Purpose: The textType ICC tag

Constructor & Destructor Documentation

◆ CIccTagTextDescription() [1/2]

CIccTagTextDescription::CIccTagTextDescription ( )

Name: CIccTagTextDescription::CIccTagTextDescription

Purpose: Constructor

1914{
1915 m_szText = (icChar*)malloc(1);
1916 m_szText[0] = '\0';
1917 m_nASCIISize = 1;
1918
1919 m_uzUnicodeText = (icUInt16Number*)malloc(sizeof(icUInt16Number));
1920 m_uzUnicodeText[0] = 0;
1921 m_nUnicodeSize = 1;
1923
1924 m_nScriptSize = 0;
1925 m_nScriptCode = 0;
1926 memset(m_szScriptText, 0, sizeof(m_szScriptText));
1927
1928 m_bInvalidScript = false;
1929}
unsigned short icUInt16Number
Definition icProfileHeader.h:256
char icChar
Definition IccDefs.h:110
icChar * m_szText
Definition IccTagBasic.h:511
icUInt32Number m_nUnicodeLanguageCode
Definition IccTagBasic.h:516
icUInt16Number m_nScriptCode
Definition IccTagBasic.h:520
icUInt16Number * m_uzUnicodeText
Definition IccTagBasic.h:514
icUInt8Number m_szScriptText[67]
Definition IccTagBasic.h:518
icUInt32Number m_nUnicodeSize
Definition IccTagBasic.h:515
bool m_bInvalidScript
Definition IccTagBasic.h:522
icUInt32Number m_nASCIISize
Definition IccTagBasic.h:512
icUInt8Number m_nScriptSize
Definition IccTagBasic.h:519

References m_bInvalidScript, m_nASCIISize, m_nScriptCode, m_nScriptSize, m_nUnicodeLanguageCode, m_nUnicodeSize, m_szScriptText, m_szText, and m_uzUnicodeText.

Referenced by CIccTagXmlTextDescription::CIccTagXmlTextDescription().

+ Here is the caller graph for this function:

◆ CIccTagTextDescription() [2/2]

CIccTagTextDescription::CIccTagTextDescription ( const CIccTagTextDescription ITTD)

Name: CIccTagTextDescription::CIccTagTextDescription

Purpose: Copy Constructor

Args: ITTD = The CIccTagTextDescription object to be copied

1942{
1948
1949 if (m_nASCIISize) {
1950 m_szText = (icChar*)malloc(m_nASCIISize * sizeof(icChar));
1951 memcpy(m_szText, ITTD.m_szText, m_nASCIISize*sizeof(icChar));
1952 }
1953 else {
1954 m_nASCIISize = 1;
1955 m_szText = (icChar*)calloc(m_nASCIISize, sizeof(icChar));
1956 m_szText[0] = '\0';
1957 }
1958
1959 if (m_nUnicodeSize) {
1962 }
1963 else {
1964 m_nUnicodeSize = 1;
1966 m_uzUnicodeText[0] = 0;
1967 }
1968
1969 memcpy(m_szScriptText, ITTD.m_szScriptText, sizeof(m_szScriptText));
1970
1972}

References m_bInvalidScript, m_nASCIISize, m_nScriptCode, m_nScriptSize, m_nUnicodeLanguageCode, m_nUnicodeSize, m_szScriptText, m_szText, and m_uzUnicodeText.

Referenced by CIccTagXmlTextDescription::CIccTagXmlTextDescription(), and NewCopy().

+ Here is the caller graph for this function:

◆ ~CIccTagTextDescription()

CIccTagTextDescription::~CIccTagTextDescription ( )
virtual

Name: CIccTagTextDescription::~CIccTagTextDescription

Purpose: Destructor

2036{
2037 free(m_szText);
2038 free(m_uzUnicodeText);
2039}

References m_szText, and m_uzUnicodeText.

Member Function Documentation

◆ Capacity()

icUInt32Number CIccTagTextDescription::Capacity ( ) const
inline
503{ return m_nASCIISize; }

References m_nASCIISize.

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

Name: CIccTagTextDescription::Describe

Purpose: Dump data associated with the tag to a string

Args: sDescription - string to concatenate tag dump to

Reimplemented from CIccTag.

2200{
2201 sDescription += "TextDescription Length = ";
2202 if (m_szText && *m_szText) {
2203 char buf[40];
2204 sprintf(buf, "%zu bytes\n", strlen(m_szText));
2205 sDescription += buf;
2206 }
2207 else
2208 sDescription += "0 (NULL)";
2209
2210 if (nVerboseness > 25) {
2211 sDescription += "\"";
2212 if (m_szText && *m_szText) {
2213 if ((nVerboseness > 50) || (strlen(m_szText) < BRIEF_STRING_SIZE)) {
2214 // output entire string if short or doing verbose
2215 sDescription += m_szText;
2216 }
2217 else {
2218 // copy just first part of string to keep nVerboseness under control
2219 char buf[BRIEF_STRING_SIZE+1];
2220 strncpy(buf, m_szText, BRIEF_STRING_SIZE);
2221 buf[BRIEF_STRING_SIZE] = '\0'; // ensure NULL termination
2222 sDescription += buf;
2223 sDescription += "\n... <!truncated!>";
2224 }
2225 }
2226 sDescription += "\"\n";
2227 }
2228}
#define BRIEF_STRING_SIZE
Definition IccTagBasic.cpp:103

References m_szText.

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

◆ GetBuffer()

icChar * CIccTagTextDescription::GetBuffer ( icUInt32Number  nSize)

Name: CIccTagTextDescription::GetBuffer

Purpose: This function allocates room and returns pointer to data buffer to put string into

Args: nSize = Requested size of data buffer.

Return:

2289{
2290 if (m_nASCIISize < nSize) {
2291 m_szText = (icChar*)icRealloc(m_szText, nSize+1);
2292
2293 m_szText[nSize] = '\0';
2294
2295 m_nASCIISize = nSize;
2296 }
2297
2298 return m_szText;
2299}
ICCPROFLIB_API void * icRealloc(void *ptr, size_t size)
Definition IccUtil.cpp:111

References icRealloc(), m_nASCIISize, and m_szText.

Referenced by CIccTagXmlTextDescription::ParseXml(), Read(), and SetText().

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

◆ GetClassName()

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

Reimplemented from CIccTag.

Reimplemented in CIccTagXmlTextDescription.

490{ return "CIccTagTextDescription"; }

◆ GetExtension()

virtual IIccExtensionTag * CIccTag::GetExtension ( )
inlinevirtualinherited

Reimplemented in CIccTagXmlUnknown, CIccTagXmlText, CIccTagXmlUtf8Text, CIccTagXmlZipUtf8Text, CIccTagXmlZipXml, CIccTagXmlUtf16Text, CIccTagXmlTextDescription, CIccTagXmlSignature, CIccTagXmlNamedColor2, CIccTagXmlXYZ, CIccTagXmlChromaticity, CIccTagXmlCicp, CIccTagXmlSparseMatrixArray, CIccTagXmlFixedNum< T, Tsig >, CIccTagXmlNum< T, A, Tsig >, CIccTagXmlFloatNum< T, A, Tsig >, CIccTagXmlMeasurement, CIccTagXmlMultiLocalizedUnicode, CIccTagXmlTagData, CIccTagXmlDateTime, CIccTagXmlColorantOrder, CIccTagXmlColorantTable, CIccTagXmlViewingConditions, CIccTagXmlSpectralDataInfo, CIccTagXmlSpectralViewingConditions, CIccTagXmlProfileSeqDesc, CIccTagXmlResponseCurveSet16, CIccTagXmlCurve, CIccTagXmlParametricCurve, CIccTagXmlSegmentedCurve, CIccTagXmlLutAtoB, CIccTagXmlLutBtoA, CIccTagXmlLut8, CIccTagXmlLut16, CIccTagXmlMultiProcessElement, CIccTagXmlProfileSequenceId, CIccTagXmlDict, CIccTagXmlStruct, CIccTagXmlArray, CIccTagXmlGamutBoundaryDesc, CIccTagXmlEmbeddedHeightImage, CIccTagXmlEmbeddedNormalImage, and CIccTagXmlEmbeddedProfile.

143{return NULL;}

Referenced by icCurvesFromXml(), icCurvesToXml(), icProfDescToXml(), icXmlParseProfDesc(), CIccProfileXml::ParseTag(), CIccTagXmlStruct::ParseTag(), CIccMpeXmlTintArray::ParseXml(), CIccTagXmlArray::ParseXml(), CIccMpeXmlTintArray::ToXml(), CIccTagXmlStruct::ToXml(), CIccTagXmlArray::ToXml(), and CIccProfileXml::ToXmlWithBlanks().

+ Here is the caller graph for this function:

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

◆ GetText()

const icChar * CIccTagTextDescription::GetText ( ) const
inline
497{ return m_szText; }

References m_szText.

Referenced by CIccProfileIdDesc::CIccProfileIdDesc(), icGetTagText(), and main().

+ Here is the caller graph for this function:

◆ GetType()

virtual icTagTypeSignature CIccTagTextDescription::GetType ( ) const
inlinevirtual

Function: GetType()

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

Reimplemented from CIccTag.

489{ return icSigTextDescriptionType; }
@ icSigTextDescriptionType
Definition icProfileHeader.h:566

References icSigTextDescriptionType.

Referenced by Write().

+ Here is the caller graph for this function:

◆ GetUnicodeBuffer()

icUInt16Number * CIccTagTextDescription::GetUnicodeBuffer ( icUInt32Number  nSize)

Name: CIccTagTextDescription::GetUnicodeBuffer

Purpose: This function allocates room and returns pointer to data buffer to put string into

Args: nSize = Requested size of data buffer.

Return:

2333{
2334 if (m_nUnicodeSize < nSize) {
2336
2337 m_uzUnicodeText[nSize] = 0;
2338
2339 m_nUnicodeSize = nSize;
2340 }
2341
2342 return m_uzUnicodeText;
2343}

References icRealloc(), m_nUnicodeSize, and m_uzUnicodeText.

Referenced by CIccTagXmlTextDescription::ParseXml(), and Read().

+ Here is the call graph for this function:
+ 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:

◆ IsMBBType()

virtual bool CIccTag::IsMBBType ( )
inlinevirtualinherited

Reimplemented in CIccMBB.

136{ return false; } //If true then CIccTag can be cast as an CIccMBB

Referenced by CIccProfileXml::ParseTag().

+ Here is the caller graph for this function:

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

◆ NewCopy()

virtual CIccTag * CIccTagTextDescription::NewCopy ( ) const
inlinevirtual

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 CIccTag.

Reimplemented in CIccTagXmlTextDescription.

486{return new CIccTagTextDescription(*this);}
CIccTagTextDescription()
Definition IccTagBasic.cpp:1913

References CIccTagTextDescription().

+ Here is the call graph for this function:

◆ operator=() [1/2]

CIccTagTextDescription & CIccTagTextDescription::operator= ( const CIccTagTextDescription TextDescTag)

Name: CIccTagTextDescription::operator=

Purpose: Copy Operator

Args: TextDescTag = The CIccTagTextDescription object to be copied

1986{
1987 if (&TextDescTag == this)
1988 return *this;
1989
1990 m_nASCIISize = TextDescTag.m_nASCIISize;
1991 m_nUnicodeSize = TextDescTag.m_nUnicodeSize;
1993 m_nScriptSize = TextDescTag.m_nScriptSize;
1994 m_nScriptCode = TextDescTag.m_nScriptCode;
1995
1996 if (m_szText)
1997 free(m_szText);
1998 if (m_nASCIISize) {
1999 m_szText = (icChar*)calloc(m_nASCIISize, sizeof(icChar));
2000 memcpy(m_szText, TextDescTag.m_szText, m_nASCIISize*sizeof(icChar));
2001 }
2002 else {
2003 m_nASCIISize = 1;
2004 m_szText = (icChar*)calloc(m_nASCIISize, sizeof(icChar));
2005 m_szText[0] = '\0';
2006 }
2007
2008 if (m_uzUnicodeText)
2009 free(m_uzUnicodeText);
2010 if (m_nUnicodeSize) {
2012 memcpy(m_uzUnicodeText, TextDescTag.m_uzUnicodeText, m_nUnicodeSize*sizeof(icUInt16Number));
2013 }
2014 else {
2015 m_nUnicodeSize = 1;
2017 m_uzUnicodeText[0] = 0;
2018 }
2019
2020 memcpy(m_szScriptText, TextDescTag.m_szScriptText, sizeof(m_szScriptText));
2021
2022 m_bInvalidScript = TextDescTag.m_bInvalidScript;
2023
2024 return *this;
2025}

References m_bInvalidScript, m_nASCIISize, m_nScriptCode, m_nScriptSize, m_nUnicodeLanguageCode, m_nUnicodeSize, m_szScriptText, m_szText, and m_uzUnicodeText.

Referenced by CDevLinkWriter::iterate().

+ Here is the caller graph for this function:

◆ operator=() [2/2]

const icChar * CIccTagTextDescription::operator= ( const icChar szText)

Name: CIccTagTextDescription::operator=

Purpose: Define assignment operator to associate text with tag.

Args: szText - zero terminated string to put in the tag

Return: A pointer to the string assigned to the tag.

2270{
2271 SetText(szText);
2272 return m_szText;
2273}
void SetText(const icChar *szText)
Definition IccTagBasic.cpp:2241

References m_szText, and SetText().

+ Here is the call graph for this function:

◆ Read() [1/2]

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

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

2056{
2058 icUInt32Number nEnd;
2059
2060 m_szText[0] = '\0';
2061 nEnd = pIO->Tell() + size;
2062
2063 if (size<3*sizeof(icUInt32Number) || !pIO)
2064 return false;
2065
2066 icUInt32Number nSize;
2067
2068 if (!pIO->Read32(&sig) ||
2069 !pIO->Read32(&m_nReserved) ||
2070 !pIO->Read32(&nSize))
2071 return false;
2072
2073 if (3*sizeof(icUInt32Number) + nSize > size)
2074 return false;
2075
2076 icChar *pBuf = GetBuffer(nSize);
2077
2078 if (nSize) {
2079 if (pIO->Read8(pBuf, nSize) != (icInt32Number)nSize) {
2080 return false;
2081 }
2082 }
2083 else
2084 m_szText[0] = '\0';
2085
2086 Release();
2087
2088 if (pIO->Tell() + 2 * sizeof(icUInt32Number) > nEnd)
2089 return false;
2090
2091 if (!pIO->Read32(&m_nUnicodeLanguageCode) ||
2092 !pIO->Read32(&nSize))
2093 return false;
2094
2095 // Calculations in GetUnicodeBuffer() can cause wrap-around error
2096 if (nSize == 0xFFFFFFFF)
2097 return false;
2098
2099 icUInt16Number *pBuf16 = GetUnicodeBuffer(nSize);
2100
2101 if (nSize) {
2102 if (pIO->Read16(pBuf16, nSize) != (icInt32Number)nSize) {
2103 return false;
2104 }
2105 }
2106 else
2107 pBuf16[0] = 0;
2108
2110
2111 if (pIO->Tell()+3 > (icInt32Number)nEnd)
2112 return false;
2113
2114 if (!pIO->Read16(&m_nScriptCode) ||
2115 !pIO->Read8(&m_nScriptSize))
2116 return false;
2117
2118 if (pIO->Tell() + m_nScriptSize> (icInt32Number)nEnd ||
2119 m_nScriptSize > sizeof(m_szScriptText))
2120 return false;
2121
2122 int nScriptLen = pIO->Read8(m_szScriptText, 67);
2123
2124 if (!nScriptLen)
2125 return false;
2126
2127 if (nScriptLen<67) {
2128 memset(&m_szScriptText[0], 0, 67-nScriptLen);
2129 m_bInvalidScript = true;
2130 }
2131
2132 return true;
2133}
long icInt32Number
Definition icProfileHeader.h:291
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icTagTypeSignature
Definition icProfileHeader.h:526
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104
icInt32Number Read16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:114
virtual icInt32Number Tell()
Definition IccIO.h:133
icInt32Number Read32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:143
icUInt32Number m_nReserved
Definition IccTagBasic.h:235
void ReleaseUnicode()
Definition IccTagBasic.cpp:2353
icChar * GetBuffer(icUInt32Number nSize)
Definition IccTagBasic.cpp:2288
icUInt16Number * GetUnicodeBuffer(icUInt32Number nSize)
Definition IccTagBasic.cpp:2332
void Release()
Definition IccTagBasic.cpp:2309

References GetBuffer(), GetUnicodeBuffer(), m_bInvalidScript, CIccTag::m_nReserved, m_nScriptCode, m_nScriptSize, m_nUnicodeLanguageCode, m_szScriptText, m_szText, CIccIO::Read16(), CIccIO::Read32(), CIccIO::Read8(), Release(), ReleaseUnicode(), 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; }

◆ Release()

void CIccTagTextDescription::Release ( )

Name: CIccTagTextDescription::Release

Purpose: This will resize the buffer to fit the zero terminated string in the buffer.

2310{
2311 icUInt32Number nSize = (icUInt32Number)strlen(m_szText);
2312
2313 if (nSize < m_nASCIISize-1) {
2314 m_szText=(icChar*)icRealloc(m_szText, nSize+1);
2315 m_nASCIISize = nSize+1;
2316 }
2317}

References icRealloc(), m_nASCIISize, and m_szText.

Referenced by CIccTagXmlTextDescription::ParseXml(), Read(), and SetText().

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

◆ ReleaseUnicode()

void CIccTagTextDescription::ReleaseUnicode ( )

Name: CIccTagTextDescription::ReleaseUnicode

Purpose: This will resize the buffer to fit the zero terminated string in the buffer.

2354{
2355 int i;
2356 for (i=0; m_uzUnicodeText[i]; i++);
2357
2358 icUInt32Number nSize = i+1;
2359
2360 if (nSize < m_nUnicodeSize-1) {
2362 m_nUnicodeSize = nSize+1;
2363 }
2364}

References icRealloc(), m_nUnicodeSize, and m_uzUnicodeText.

Referenced by Read().

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

◆ SetText()

void CIccTagTextDescription::SetText ( const icChar szText)

Name: CIccTagTextDescription::SetText

Purpose: Allows text data associated with the tag to be set.

Args: szText - zero terminated string to put in tag

2242{
2243 m_bInvalidScript = false;
2244
2245 if (!szText) {
2246 SetText("");
2247 return;
2248 }
2249
2250 icUInt32Number len=(icUInt32Number)strlen(szText) + 1;
2251 icChar *szBuf = GetBuffer(len);
2252
2253 strcpy(szBuf, szText);
2254 Release();
2255}

References GetBuffer(), m_bInvalidScript, Release(), and SetText().

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

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

◆ Validate()

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

Name: CIccTagTextDescription::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 CIccTag.

2382{
2383 icValidateStatus rv = CIccTag::Validate(sigPath, sReport, pProfile);
2384
2385 CIccInfo Info;
2386 std::string sSigPathName = Info.GetSigPathName(sigPath);
2387
2388 if (m_nScriptSize>67) {
2389 sReport += icMsgValidateNonCompliant;
2390 sReport += sSigPathName;
2391 sReport += " - ScriptCode count must not be greater than 67.\n";
2392
2394 }
2395
2396 if (m_bInvalidScript) {
2397 sReport += icMsgValidateNonCompliant;
2398 sReport += sSigPathName;
2399 sReport += " - ScriptCode must contain 67 bytes.\n";
2400
2402 }
2403
2404 return rv;
2405}
icValidateStatus
Definition IccDefs.h:119
@ icValidateNonCompliant
Definition IccDefs.h:122
ICCPROFLIB_API icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Definition IccUtil.cpp:244
ICCPROFLIB_API const char * icMsgValidateNonCompliant
Definition IccUtil.cpp:91
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
Definition IccTagBasic.cpp:164

References CIccInfo::GetSigPathName(), icMaxStatus(), icMsgValidateNonCompliant, icValidateNonCompliant, m_bInvalidScript, m_nScriptSize, and CIccTag::Validate().

+ Here is the call graph for this function:

◆ Write()

bool CIccTagTextDescription::Write ( CIccIO pIO)
virtual

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

2149{
2151 icUInt32Number zero = 0;
2152
2153 if (!pIO)
2154 return false;
2155
2156 if (!pIO->Write32(&sig) ||
2157 !pIO->Write32(&m_nReserved) ||
2158 !pIO->Write32(&m_nASCIISize))
2159 return false;
2160
2161 if (m_nASCIISize) {
2163 return false;
2164 }
2165
2166 if (!pIO->Write32(&m_nUnicodeLanguageCode))
2167 return false;
2168
2169 if (m_nUnicodeSize > 1) {
2170 if (!pIO->Write32(&m_nUnicodeSize) ||
2172 return false;
2173 }
2174 else {
2175 if (!pIO->Write32(&zero))
2176 return false;
2177 }
2178
2179 if (!pIO->Write16(&m_nScriptCode) ||
2180 !pIO->Write8(&m_nScriptSize) ||
2181 pIO->Write8(m_szScriptText, 67)!= 67)
2182 return false;
2183
2184 m_bInvalidScript = false;
2185
2186 return true;
2187}
virtual icInt32Number Write8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:105
icInt32Number Write16(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:122
icInt32Number Write32(void *pBuf32, icInt32Number nNum=1)
Definition IccIO.cpp:152
virtual icTagTypeSignature GetType() const
Definition IccTagBasic.h:489

References GetType(), m_bInvalidScript, m_nASCIISize, CIccTag::m_nReserved, m_nScriptCode, m_nScriptSize, m_nUnicodeLanguageCode, m_nUnicodeSize, m_szScriptText, m_szText, m_uzUnicodeText, CIccIO::Write16(), CIccIO::Write32(), and CIccIO::Write8().

+ Here is the call graph for this function:

Field Documentation

◆ m_bInvalidScript

bool CIccTagTextDescription::m_bInvalidScript
protected

◆ m_nASCIISize

◆ 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(), 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(), 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_nScriptCode

◆ m_nScriptSize

◆ m_nUnicodeLanguageCode

icUInt32Number CIccTagTextDescription::m_nUnicodeLanguageCode
protected

◆ m_nUnicodeSize

◆ m_szScriptText

◆ m_szText

◆ m_uzUnicodeText


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