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

#include <IccMpeBasic.h>

+ Inheritance diagram for CIccSampledCalculatorCurve:
+ Collaboration diagram for CIccSampledCalculatorCurve:

Public Member Functions

 CIccSampledCalculatorCurve (const CIccSampledCalculatorCurve &ITPC)
 
 CIccSampledCalculatorCurve (icFloatNumber first=0.0, icFloatNumber last=1.0)
 
virtual ~CIccSampledCalculatorCurve ()
 
virtual icFloatNumber Apply (icFloatNumber v) const
 
virtual bool Begin (icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
 
virtual void Describe (std::string &sDescription, int nVerboseness=100)
 
virtual const icCharGetClassName () const
 
icUInt16Number GetExtensionType ()
 
virtual icUInt32Number GetRecommendedSize ()
 
virtual icUInt32Number GetSize ()
 
virtual icCurveElemSignature GetType () const
 
virtual CIccCurveSetCurveNewCopy () const
 
CIccSampledCalculatorCurveoperator= (const CIccSampledCalculatorCurve &SampledCurve)
 
virtual bool Read (icUInt32Number size, CIccIO *pIO)
 
bool SetCalculator (CIccMpeCalculator *pCalc)
 
bool SetExtensionType (icUInt16Number nExtensionType)
 
void SetRange (icFloatNumber first=0.0f, icFloatNumber last=1.0f)
 
virtual bool SetRecommendedSize (icUInt32Number nSize)
 
virtual bool SetSize (icUInt32Number nSize, bool bZeroAlloc=true)
 
virtual icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
 
virtual bool Write (CIccIO *pIO)
 

Static Public Member Functions

static CIccCurveSetCurveCreate (icCurveElemSignature sig)
 

Protected Member Functions

icUInt16Number GetStorageType ()
 
bool SetStorageType (icUInt16Number nStorateType)
 

Protected Attributes

icUInt16Number m_extensionType
 
icFloatNumber m_firstEntry
 
icFloatNumber m_hiIntercept
 
icFloatNumber m_hiSlope
 
icFloatNumber m_last
 
icFloatNumber m_lastEntry
 
icFloatNumber m_loIntercept
 
icFloatNumber m_loSlope
 
icUInt32Number m_nCount
 
icUInt32Number m_nDesiredSize
 
icUInt32Number m_nReserved
 
icUInt16Number m_nReserved2
 
CIccMpeCalculatorm_pCalc
 
icFloatNumberm_pSamples
 
icFloatNumber m_range
 
icUInt16Number m_storageType
 

Detailed Description

Class: CIccSampledCalculatorCurve

Purpose: The sampled calculator curve class

Constructor & Destructor Documentation

◆ CIccSampledCalculatorCurve() [1/2]

CIccSampledCalculatorCurve::CIccSampledCalculatorCurve ( icFloatNumber  first = 0.0,
icFloatNumber  last = 1.0 
)

Name: CIccSampledCalculatorCurve::CIccSampledCalculatorCurve

Purpose:

Args:

Return:

1896{
1897 m_nReserved = 0;
1898 m_nReserved2 = 0;
1899
1900 m_pCalc = 0;
1901
1902 m_nCount = 0;
1903 m_pSamples = 0;
1904
1906
1907 if (first < last) {
1908 m_firstEntry = first;
1909 m_lastEntry = last;
1910 }
1911 else {
1912 m_firstEntry = last;
1913 m_lastEntry = first;
1914 }
1915
1916 m_loIntercept = 0;
1917 m_loSlope = 0;
1918 m_hiIntercept = 1.0;
1919 m_hiSlope = 0;
1920}
@ icClipSingleSampledCurve
Definition icProfileHeader.h:1067
icUInt32Number m_nReserved
Definition IccMpeBasic.h:391
icUInt16Number m_extensionType
Definition IccMpeBasic.h:398
icUInt16Number m_nReserved2
Definition IccMpeBasic.h:392
icFloatNumber m_hiIntercept
Definition IccMpeBasic.h:409
icFloatNumber m_hiSlope
Definition IccMpeBasic.h:408
icFloatNumber m_firstEntry
Definition IccMpeBasic.h:400
icFloatNumber m_lastEntry
Definition IccMpeBasic.h:401
CIccMpeCalculator * m_pCalc
Definition IccMpeBasic.h:411
icUInt32Number m_nCount
Definition IccMpeBasic.h:394
icFloatNumber m_loIntercept
Definition IccMpeBasic.h:407
icFloatNumber * m_pSamples
Definition IccMpeBasic.h:395
icFloatNumber m_loSlope
Definition IccMpeBasic.h:406

References icClipSingleSampledCurve, m_extensionType, m_firstEntry, m_hiIntercept, m_hiSlope, m_lastEntry, m_loIntercept, m_loSlope, m_nCount, m_nReserved, m_nReserved2, m_pCalc, and m_pSamples.

Referenced by CIccSampledCalculatorCurveXml::CIccSampledCalculatorCurveXml(), and CIccCurveSetCurve::Create().

+ Here is the caller graph for this function:

◆ CIccSampledCalculatorCurve() [2/2]

CIccSampledCalculatorCurve::CIccSampledCalculatorCurve ( const CIccSampledCalculatorCurve curve)

Name: CIccSampledCalculatorCurve::CIccSampledCalculatorCurve

Purpose:

Args:

Return:

1933{
1934 m_nReserved = curve.m_nReserved;
1935 m_nReserved2 = curve.m_nReserved2;
1936
1937 m_nCount = curve.m_nCount;
1938
1940
1942
1943 if (curve.m_pCalc)
1944 m_pCalc = curve.m_pCalc->NewCopy();
1945
1946 if (m_nCount) {
1947 m_pSamples = (icFloatNumber*)malloc(m_nCount * sizeof(icFloatNumber));
1948 if (m_pSamples)
1949 memcpy(m_pSamples, curve.m_pSamples, m_nCount * sizeof(icFloatNumber));
1950 else
1951 m_nCount = 0;
1952 }
1953 else {
1954 m_pSamples = NULL;
1955 }
1956
1957 m_firstEntry = curve.m_firstEntry;
1958 m_lastEntry = curve.m_lastEntry;
1959
1961 m_loSlope = curve.m_loSlope;
1963 m_hiSlope = curve.m_hiSlope;
1964}
float icFloatNumber
Definition IccDefs.h:101
icUInt32Number m_nDesiredSize
Definition IccMpeBasic.h:413
virtual CIccMpeCalculator * NewCopy() const
Definition IccMpeCalc.h:452

References m_extensionType, m_firstEntry, m_hiIntercept, m_hiSlope, m_lastEntry, m_loIntercept, m_loSlope, m_nCount, m_nDesiredSize, m_nReserved, m_nReserved2, m_pCalc, m_pSamples, and CIccMpeCalculator::NewCopy().

Referenced by NewCopy().

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

◆ ~CIccSampledCalculatorCurve()

CIccSampledCalculatorCurve::~CIccSampledCalculatorCurve ( )
virtual

Name: CIccSampledCalculatorCurve::~CIccSampledCalculatorCurve

Purpose:

Args:

Return:

2032{
2033 if (m_pSamples)
2034 free(m_pSamples);
2035
2036 if (m_pCalc)
2037 delete m_pCalc;
2038}

References m_pCalc, and m_pSamples.

Member Function Documentation

◆ Apply()

icFloatNumber CIccSampledCalculatorCurve::Apply ( icFloatNumber  v) const
virtual

Name: CIccSampledCalculatorCurve::Apply

Purpose:

Args:

Return:

Implements CIccCurveSetCurve.

2422{
2423 if (v < m_firstEntry) {
2424 return m_loSlope * v + m_loIntercept;;
2425 }
2426 else if (v > m_lastEntry) {
2427 return m_hiSlope * v + m_hiIntercept;
2428 }
2429
2430 icFloatNumber pos = (v - m_firstEntry) / m_range * m_last;
2431 icUInt32Number index = (icUInt32Number)pos;
2432 icFloatNumber remainder = pos - (icFloatNumber)index;
2433
2434 if (remainder == 0.0)
2435 return m_pSamples[index];
2436
2437 return (icFloatNumber)((1.0 - remainder)*m_pSamples[index] + remainder*m_pSamples[index + 1]);
2438}
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icFloatNumber m_last
Definition IccMpeBasic.h:404
icFloatNumber m_range
Definition IccMpeBasic.h:403

References m_firstEntry, m_hiIntercept, m_hiSlope, m_last, m_lastEntry, m_loIntercept, m_loSlope, m_pSamples, and m_range.

◆ Begin()

bool CIccSampledCalculatorCurve::Begin ( icElemInterp  nInterp,
CIccTagMultiProcessElement pMPE 
)
virtual

Name: CIccSampledCalculatorCurve::Begin

Purpose:

Args:

Return:

Implements CIccCurveSetCurve.

2354{
2355 if (m_nDesiredSize < 2 || !m_pCalc || !m_pCalc->Begin(nInterp, pMPE))
2356 return false;
2357
2359 if (nSize < 2)
2360 nSize = 2;
2361 if (nSize > ICC_MAXCALCCURVESIZE)
2362 nSize = ICC_MAXCALCCURVESIZE;
2363
2364 SetSize(nSize);
2365
2367
2368 if (m_range == 0.0)
2369 return false;
2370
2371 m_last = (icFloatNumber)(m_nCount - 1);
2372 icFloatNumber stepSize = m_range / m_last;
2373
2374 //Use calculator element to populate lookup table
2375 CIccApplyMpe *pApply = m_pCalc->GetNewApply(NULL);
2376 for (icUInt32Number i = 0; i < m_nCount; i++) {
2377 icFloatNumber src, dst;
2379
2380 m_pCalc->Apply(pApply, &dst, &src);
2381 m_pSamples[i] = dst;
2382 }
2383
2384 if (pApply)
2385 delete pApply;
2386
2387 switch (m_extensionType) {
2389 m_loSlope = 0.0;
2391
2392 m_hiSlope = 0.0;
2394 break;
2395
2397 m_loSlope = (m_pSamples[1] - m_pSamples[0]) / stepSize;
2399
2400 m_hiSlope = (m_pSamples[m_nCount - 1] - m_pSamples[m_nCount - 2]) / stepSize;
2402 break;
2403
2404 default:
2405 return false;
2406 }
2407
2408 return true;
2409}
@ icExtendSingleSampledCurve
Definition icProfileHeader.h:1068
#define ICC_MAXCALCCURVESIZE
Definition IccMpeBasic.h:344
virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
Definition IccMpeBasic.cpp:2353
virtual bool SetSize(icUInt32Number nSize, bool bZeroAlloc=true)
Definition IccMpeBasic.cpp:2153
Definition IccTagMPE.h:203
virtual CIccApplyMpe * GetNewApply(CIccApplyTagMpe *pApplyTag)
Definition IccMpeCalc.cpp:4734
virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *pDestPixel, const icFloatNumber *pSrcPixel) const
Definition IccMpeCalc.cpp:4782

References CIccMpeCalculator::Apply(), CIccMpeCalculator::Begin(), CIccMpeCalculator::GetNewApply(), icClipSingleSampledCurve, icExtendSingleSampledCurve, m_extensionType, m_firstEntry, m_hiIntercept, m_hiSlope, m_last, m_lastEntry, m_loIntercept, m_loSlope, m_nCount, m_nDesiredSize, m_pCalc, m_pSamples, m_range, and SetSize().

+ Here is the call graph for this function:

◆ Create()

CIccCurveSetCurve * CIccCurveSetCurve::Create ( icCurveElemSignature  sig)
staticinherited

Name: CIccCurveSetCurve::Create

Purpose:

Args:

Return:

2961{
2962 switch (sig) {
2964 return new CIccSegmentedCurve();
2966 return new CIccSingleSampledCurve();
2968 return new CIccSampledCalculatorCurve();
2969 default:
2970 return NULL;
2971 }
2972}
@ icSigSegmentedCurve
Definition icProfileHeader.h:1057
@ icSigSampledCalculatorCurve
Definition icProfileHeader.h:1059
@ icSigSingleSampledCurve
Definition icProfileHeader.h:1058
Definition IccMpeBasic.h:249
Definition IccMpeBasic.h:287
Definition IccMpeBasic.h:354

References CIccSampledCalculatorCurve(), CIccSegmentedCurve::CIccSegmentedCurve(), CIccSingleSampledCurve::CIccSingleSampledCurve(), icSigSampledCalculatorCurve, icSigSegmentedCurve, and icSigSingleSampledCurve.

Referenced by CIccMpeCurveSet::Read(), and CIccMpeToneMap::Read().

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

◆ Describe()

void CIccSampledCalculatorCurve::Describe ( std::string &  sDescription,
int  nVerboseness = 100 
)
virtual

Name: CIccSampledCalculatorCurve::Describe

Purpose:

Args:

Return:

Implements CIccCurveSetCurve.

2191{
2192 icChar buf[128];
2193
2194 if (!m_pCalc) {
2195 sDescription += "Empty Sampled Calculator Curve [";
2196 sprintf(buf, "%.8f, ", m_firstEntry);
2197 sDescription += buf;
2198
2199 sprintf(buf, "%.8f,", m_lastEntry);
2200 sDescription += buf;
2201
2202 sprintf(buf, "%d", m_nDesiredSize);
2203 sDescription += buf;
2204
2205 sprintf(buf, "]\r\n");
2206 sDescription += buf;
2207 }
2208 else {
2209 sDescription += "Sampled Calculator Curve [";
2210
2211 sprintf(buf, "%.8f, ", m_firstEntry);
2212 sDescription += buf;
2213
2214 sprintf(buf, "%.8f,", m_lastEntry);
2215 sDescription += buf;
2216
2217 sprintf(buf, "%d", m_nDesiredSize);
2218 sDescription += buf;
2219
2220 sprintf(buf, "]\r\n");
2221 sDescription += buf;
2222
2223 switch (m_extensionType) {
2225 sDescription += "Clip End Points\n";
2226 break;
2228 sDescription += "Extend End Points\n";
2229 break;
2230 default:
2231 sDescription += "Unknown extension handling\n";
2232 break;
2233 }
2234 m_pCalc->Describe(sDescription, nVerboseness);
2235 }
2236 sDescription += "\r\n";
2237}
char icChar
Definition IccDefs.h:110
virtual void Describe(std::string &sDescription, int nVerboseness)
Definition IccMpeCalc.cpp:4430

References CIccMpeCalculator::Describe(), icClipSingleSampledCurve, icExtendSingleSampledCurve, m_extensionType, m_firstEntry, m_lastEntry, m_nDesiredSize, and m_pCalc.

+ Here is the call graph for this function:

◆ GetClassName()

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

Implements CIccCurveSetCurve.

363{ return "CIccSampledCalculatorCurve"; }

◆ GetExtensionType()

icUInt16Number CIccSampledCalculatorCurve::GetExtensionType ( )
inline
376{ return m_extensionType; }

References m_extensionType.

◆ GetRecommendedSize()

virtual icUInt32Number CIccSampledCalculatorCurve::GetRecommendedSize ( )
inlinevirtual
370{ return m_nDesiredSize; }

References m_nDesiredSize.

◆ GetSize()

virtual icUInt32Number CIccSampledCalculatorCurve::GetSize ( )
inlinevirtual
373{ return m_nCount; }

References m_nCount.

◆ GetStorageType()

icUInt16Number CIccSampledCalculatorCurve::GetStorageType ( )
inlineprotected
389{ return 0; }

◆ GetType()

virtual icCurveElemSignature CIccSampledCalculatorCurve::GetType ( ) const
inlinevirtual

Implements CIccCurveSetCurve.

References icSigSampledCalculatorCurve.

Referenced by Read(), and Write().

+ Here is the caller graph for this function:

◆ NewCopy()

virtual CIccCurveSetCurve * CIccSampledCalculatorCurve::NewCopy ( ) const
inlinevirtual

Implements CIccCurveSetCurve.

359{ return new CIccSampledCalculatorCurve(*this); }

References CIccSampledCalculatorCurve().

+ Here is the call graph for this function:

◆ operator=()

CIccSampledCalculatorCurve & CIccSampledCalculatorCurve::operator= ( const CIccSampledCalculatorCurve curve)

Name: &CIccSampledCalculatorCurve::operator=

Purpose:

Args:

Return:

1977{
1978 if (this == &curve)
1979 return *this;
1980
1981 if (m_pCalc) {
1982 delete m_pCalc;
1983 m_pCalc = nullptr;
1984 }
1985
1986 if (m_pSamples) {
1987 free(m_pSamples);
1988 m_pSamples = nullptr;
1989 }
1990
1991 m_nReserved = curve.m_nReserved;
1992 m_nReserved2 = curve.m_nReserved2;
1993 m_nCount = curve.m_nCount;
1996
1997 m_pCalc = curve.m_pCalc ? curve.m_pCalc->NewCopy() : nullptr;
1998
1999 if (m_nCount && curve.m_pSamples) {
2000 m_pSamples = (icFloatNumber*)malloc(m_nCount * sizeof(icFloatNumber));
2001 if (m_pSamples)
2002 memcpy(m_pSamples, curve.m_pSamples, m_nCount * sizeof(icFloatNumber));
2003 else
2004 m_nCount = 0;
2005 }
2006 else {
2007 m_pSamples = nullptr;
2008 }
2009
2010 m_firstEntry = curve.m_firstEntry;
2011 m_lastEntry = curve.m_lastEntry;
2012
2014 m_loSlope = curve.m_loSlope;
2016 m_hiSlope = curve.m_hiSlope;
2017
2018 return *this;
2019}

References m_extensionType, m_firstEntry, m_hiIntercept, m_hiSlope, m_lastEntry, m_loIntercept, m_loSlope, m_nCount, m_nDesiredSize, m_nReserved, m_nReserved2, m_pCalc, m_pSamples, and CIccMpeCalculator::NewCopy().

+ Here is the call graph for this function:

◆ Read()

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

Name: CIccSampledCalculatorCurve::Read

Purpose:

Args:

Return:

Implements CIccCurveSetCurve.

2250{
2252
2253 icUInt32Number headerSize = sizeof(icTagTypeSignature) +
2254 sizeof(icUInt32Number) +
2255 sizeof(icUInt32Number) +
2256 sizeof(icFloat32Number) +
2257 sizeof(icFloat32Number) +
2258 sizeof(icUInt16Number) +
2259 sizeof(icUInt16Number);
2260
2261 if (headerSize >= size)
2262 return false;
2263
2264 if (!pIO) {
2265 return false;
2266 }
2267
2268 if (!pIO->Read32(&sig) || sig != GetType())
2269 return false;
2270
2271 if (!pIO->Read32(&m_nReserved))
2272 return false;
2273
2274 if (!pIO->Read32(&m_nDesiredSize))
2275 return false;
2276
2277 if (!pIO->ReadFloat32Float(&m_firstEntry))
2278 return false;
2279
2280 if (!pIO->ReadFloat32Float(&m_lastEntry))
2281 return false;
2282
2283 if (!pIO->Read16(&m_extensionType))
2284 return false;
2285
2286 if (!pIO->Read16(&m_nReserved2))
2287 return false;
2288
2290 return false;
2291
2292 if (!m_pCalc->Read(size - headerSize, pIO))
2293 return false;
2294
2295 return true;
2296}
float icFloat32Number
Definition icProfileHeader.h:313
unsigned short icUInt16Number
Definition icProfileHeader.h:256
icCurveSegSignature
Definition icProfileHeader.h:1045
@ icSigCalculatorElemType
Definition icProfileHeader.h:649
icTagTypeSignature
Definition icProfileHeader.h:526
bool SetCalculator(CIccMpeCalculator *pCalc)
Definition IccMpeBasic.cpp:2103
virtual icCurveElemSignature GetType() const
Definition IccMpeBasic.h:362
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
static CIccMultiProcessElement * Create(icElemTypeSignature sig)
Definition IccTagMPE.cpp:131
Definition IccMpeCalc.h:447
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Definition IccMpeCalc.cpp:4474

References CIccMultiProcessElement::Create(), GetType(), icSigCalculatorElemType, m_extensionType, m_firstEntry, m_lastEntry, m_nDesiredSize, m_nReserved, m_nReserved2, m_pCalc, CIccMpeCalculator::Read(), CIccIO::Read16(), CIccIO::Read32(), CIccIO::ReadFloat32Float(), and SetCalculator().

+ Here is the call graph for this function:

◆ SetCalculator()

bool CIccSampledCalculatorCurve::SetCalculator ( CIccMpeCalculator pCalc)

Name: CIccSampledCalculatorCurve::SetCalculator Purpose: Sets calculator associated with the curve

Args: nSize = desired number of elements in lut (must be >= 2).

Return: true if calculator element is valid for curve, false otherwise

2104{
2105 if (m_pCalc)
2106 delete m_pCalc;
2107
2108 m_pCalc = pCalc;
2109
2110 return true;
2111}

References m_pCalc.

Referenced by Read().

+ Here is the caller graph for this function:

◆ SetExtensionType()

bool CIccSampledCalculatorCurve::SetExtensionType ( icUInt16Number  nExtensionType)

Name: CIccSampledCalculatorCurve::SetExtensionType

Purpose: Sets extension type of the single sampled curve

Args: nExtensionType is type of extension to use

Return: true if valid extension type, false otherwise

2078{
2079 m_extensionType = nExtensionType;
2080
2081 switch (nExtensionType) {
2084 return true;
2085 }
2086 return false;
2087}

References icClipSingleSampledCurve, icExtendSingleSampledCurve, and m_extensionType.

◆ SetRange()

void CIccSampledCalculatorCurve::SetRange ( icFloatNumber  first = 0.0f,
icFloatNumber  last = 1.0f 
)

Name: CIccSampledCalculatorCurve::SetRange

Purpose: Sets range of sampled lookup table.

Args: first = first entry input position last = last entry input position

2052{
2053 if (first < last) {
2054 m_firstEntry = first;
2055 m_lastEntry = last;
2056 }
2057 else {
2058 m_firstEntry = last;
2059 m_lastEntry = first;
2060 }
2061}

References m_firstEntry, and m_lastEntry.

◆ SetRecommendedSize()

bool CIccSampledCalculatorCurve::SetRecommendedSize ( icUInt32Number  nSize)
virtual

Name: CIccSampledCalculatorCurve::SetRecommendedSize

Purpose: Sets size of sampled lookup table. Previous data (if exists) is lost.

Args: nSize = desired number of elements in lut (must be >= 2).

Return: true if amount is valid.

2128{
2129 if (nSize < 2) {
2130 return false;
2131 }
2132
2133 m_nDesiredSize = nSize;
2134
2135 return true;
2136}

References m_nDesiredSize.

◆ SetSize()

bool CIccSampledCalculatorCurve::SetSize ( icUInt32Number  nCount,
bool  bZeroAlloc = true 
)
virtual

Name: CIccSampledCalculatorCurve::SetSize

Purpose: Sets size of sampled lookup table. Previous data (if exists) is lost.

Args: nCount = number of elements in lut (must be >= 2). bZeroAlloc = flag to decide if memory should be set to zero.

Return: true if allocation successful.

2154{
2155 if (nCount<2) {
2156 if (m_pSamples)
2157 free(m_pSamples);
2158 m_pSamples = NULL;
2159 m_nCount = nCount;
2160 return nCount == 0;
2161 }
2162
2163 if (m_pSamples) {
2164 free(m_pSamples);
2165 }
2166
2167 if (bZeroAlloc)
2168 m_pSamples = (icFloatNumber*)calloc(nCount, sizeof(icFloatNumber));
2169 else
2170 m_pSamples = (icFloatNumber*)malloc(nCount * sizeof(icFloatNumber));
2171
2172 if (m_pSamples)
2173 m_nCount = nCount;
2174 else
2175 m_nCount = 0;
2176
2177 return (m_pSamples != NULL);
2178}

References m_nCount, and m_pSamples.

Referenced by Begin().

+ Here is the caller graph for this function:

◆ SetStorageType()

bool CIccSampledCalculatorCurve::SetStorageType ( icUInt16Number  nStorateType)
inlineprotected
388{ return false; }

◆ Validate()

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

Name: CIccSampledCalculatorCurve::Validate

Purpose:

Args:

Return:

Implements CIccCurveSetCurve.

2451{
2452 CIccInfo Info;
2453 std::string sSigPathName = Info.GetSigPathName(sigPath);
2454
2456 if (m_nReserved || m_nReserved2) {
2457 sReport += icMsgValidateWarning;
2458 sReport += sSigPathName;
2459 sReport += " sampled calculator curve has non zero reserved data.\r\n";
2460 rv = icValidateWarning;
2461 }
2462
2464 sReport += icMsgValidateCriticalError;
2465 sReport += sSigPathName;
2466 sReport += " sampled calculator curve has unknown extension type\r\n";
2468 }
2469
2470 if (m_nDesiredSize < 2) {
2471 sReport += icMsgValidateWarning;
2472 sReport += sSigPathName;
2473 sReport += " sampled calculator curve has too few desired sample points.\r\n";
2475 }
2476
2477 if (m_lastEntry - m_firstEntry <= 0.0) {
2478 sReport += icMsgValidateWarning;
2479 sReport += sSigPathName;
2480 sReport += " sampled calculator curve has an invalid sample range.\n";
2482 }
2483
2484 if (pProfile && pProfile->m_Header.version < icVersionNumberV5_1) {
2485 sReport += icMsgValidateWarning;
2486 sReport += sSigPathName;
2487 sReport += " sampled calculator curve is not supported by version of profile.\n";
2489 }
2490
2491 if (!m_pCalc) {
2492 sReport += icMsgValidateCriticalError;
2493 sReport += sSigPathName;
2494 sReport += " sampled calculator curve has no calculator element\r\n";
2496 }
2497 else {
2498 icValidateStatus stat = m_pCalc->Validate(sSigPathName, sReport, pMPE, pProfile);
2499
2500 rv = icMaxStatus(rv, stat);
2501 }
2502
2503 return rv;
2504}
#define icMaxSingleSampledCurveType
Definition icProfileHeader.h:1071
#define icVersionNumberV5_1
Definition icProfileHeader.h:194
icValidateStatus
Definition IccDefs.h:119
@ icValidateOK
Definition IccDefs.h:120
@ icValidateWarning
Definition IccDefs.h:121
@ icValidateCriticalError
Definition IccDefs.h:123
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
virtual icValidateStatus Validate(std::string sigPath, std::string &sReport, const CIccTagMultiProcessElement *pMPE=NULL, const CIccProfile *pProfile=NULL) const
Definition IccMpeCalc.cpp:4819

References CIccInfo::GetSigPathName(), icMaxStatus(), icMsgValidateCriticalError, icMsgValidateWarning, icValidateCriticalError, icValidateOK, icValidateWarning, m_extensionType, m_firstEntry, m_lastEntry, m_nDesiredSize, m_nReserved, m_nReserved2, m_pCalc, CIccMpeCalculator::Validate(), and icHeader::version.

+ Here is the call graph for this function:

◆ Write()

bool CIccSampledCalculatorCurve::Write ( CIccIO pIO)
virtual

Name: CIccSampledCalculatorCurve::Write

Purpose:

Args:

Return:

Implements CIccCurveSetCurve.

2309{
2311
2312 if (!pIO)
2313 return false;
2314
2315 if (!pIO->Write32(&sig))
2316 return false;
2317
2318 if (!pIO->Write32(&m_nReserved))
2319 return false;
2320
2321 if (!pIO->Write32(&m_nDesiredSize))
2322 return false;
2323
2324 if (!pIO->WriteFloat32Float(&m_firstEntry))
2325 return false;
2326
2327 if (!pIO->WriteFloat32Float(&m_lastEntry))
2328 return false;
2329
2330 if (!pIO->Write16(&m_extensionType))
2331 return false;
2332
2333 if (!pIO->Write16(&m_nReserved2))
2334 return false;
2335
2336 if (m_pCalc && m_pCalc->Write(pIO)) {
2337 return true;
2338 }
2339
2340 return false;
2341}
icCurveElemSignature
Definition icProfileHeader.h:1056
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
virtual bool Write(CIccIO *pIO)
Definition IccMpeCalc.cpp:4598

References GetType(), m_extensionType, m_firstEntry, m_lastEntry, m_nDesiredSize, m_nReserved, m_nReserved2, m_pCalc, CIccMpeCalculator::Write(), CIccIO::Write16(), CIccIO::Write32(), and CIccIO::WriteFloat32Float().

+ Here is the call graph for this function:

Field Documentation

◆ m_extensionType

◆ m_firstEntry

◆ m_hiIntercept

icFloatNumber CIccSampledCalculatorCurve::m_hiIntercept
protected

◆ m_hiSlope

icFloatNumber CIccSampledCalculatorCurve::m_hiSlope
protected

◆ m_last

icFloatNumber CIccSampledCalculatorCurve::m_last
protected

Referenced by Apply(), and Begin().

◆ m_lastEntry

◆ m_loIntercept

icFloatNumber CIccSampledCalculatorCurve::m_loIntercept
protected

◆ m_loSlope

icFloatNumber CIccSampledCalculatorCurve::m_loSlope
protected

◆ m_nCount

icUInt32Number CIccSampledCalculatorCurve::m_nCount
protected

◆ m_nDesiredSize

◆ m_nReserved

icUInt32Number CIccSampledCalculatorCurve::m_nReserved
protected

◆ m_nReserved2

◆ m_pCalc

◆ m_pSamples

◆ m_range

icFloatNumber CIccSampledCalculatorCurve::m_range
protected

Referenced by Apply(), and Begin().

◆ m_storageType

icUInt16Number CIccSampledCalculatorCurve::m_storageType
protected

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