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

Class: CIccSampledCalculatorCurve. More...

#include <IccMpeBasic.h>

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

Public Member Functions

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

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
 

Additional Inherited Members

- Static Public Member Functions inherited from CIccCurveSetCurve
static CIccCurveSetCurveCreate (icCurveElemSignature sig)
 Name: CIccCurveSetCurve::Create.
 

Detailed Description

Class: CIccSampledCalculatorCurve.

Purpose: The sampled calculator curve class

Definition at line 353 of file IccMpeBasic.h.

Constructor & Destructor Documentation

◆ CIccSampledCalculatorCurve() [1/2]

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

Name: CIccSampledCalculatorCurve::CIccSampledCalculatorCurve.

Purpose:

Args:

Return:

Definition at line 1882 of file IccMpeBasic.cpp.

1883{
1884 m_nReserved = 0;
1885 m_nReserved2 = 0;
1886
1887 m_pCalc = 0;
1888
1889 m_nCount = 0;
1890 m_pSamples = 0;
1891
1893
1894 if (first < last) {
1895 m_firstEntry = first;
1896 m_lastEntry = last;
1897 }
1898 else {
1899 m_firstEntry = last;
1900 m_lastEntry = first;
1901 }
1902
1903 m_loIntercept = 0;
1904 m_loSlope = 0;
1905 m_hiIntercept = 1.0;
1906 m_hiSlope = 0;
1907}
icUInt16Number m_extensionType
icUInt16Number m_nReserved2
CIccMpeCalculator * m_pCalc
icFloatNumber * m_pSamples
@ icClipSingleSampledCurve

References icClipSingleSampledCurve.

◆ CIccSampledCalculatorCurve() [2/2]

CIccSampledCalculatorCurve::CIccSampledCalculatorCurve ( const CIccSampledCalculatorCurve & curve)

Name: CIccSampledCalculatorCurve::CIccSampledCalculatorCurve.

Purpose:

Args:

Return:

Definition at line 1919 of file IccMpeBasic.cpp.

1920{
1921 m_nReserved = curve.m_nReserved;
1922 m_nReserved2 = curve.m_nReserved2;
1923
1924 m_nCount = curve.m_nCount;
1925
1927
1929
1930 if (curve.m_pCalc)
1931 m_pCalc = curve.m_pCalc->NewCopy();
1932
1933 if (m_nCount) {
1934 m_pSamples = (icFloatNumber*)malloc(m_nCount * sizeof(icFloatNumber));
1935 if (m_pSamples)
1936 memcpy(m_pSamples, curve.m_pSamples, m_nCount * sizeof(icFloatNumber));
1937 else
1938 m_nCount = 0;
1939 }
1940 else {
1941 m_pSamples = NULL;
1942 }
1943
1944 m_firstEntry = curve.m_firstEntry;
1945 m_lastEntry = curve.m_lastEntry;
1946
1948 m_loSlope = curve.m_loSlope;
1950 m_hiSlope = curve.m_hiSlope;
1951}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
virtual CIccMpeCalculator * NewCopy() const
Definition IccMpeCalc.h:452
icUInt32Number m_nDesiredSize

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:

◆ ~CIccSampledCalculatorCurve()

CIccSampledCalculatorCurve::~CIccSampledCalculatorCurve ( )
virtual

Name: CIccSampledCalculatorCurve::~CIccSampledCalculatorCurve.

Purpose:

Args:

Return:

Definition at line 2014 of file IccMpeBasic.cpp.

2015{
2016 if (m_pSamples)
2017 free(m_pSamples);
2018
2019 if (m_pCalc)
2020 delete m_pCalc;
2021}

Member Function Documentation

◆ Apply()

icFloatNumber CIccSampledCalculatorCurve::Apply ( icFloatNumber v) const
virtual

Name: CIccSampledCalculatorCurve::Apply.

Purpose:

Args:

Return:

Implements CIccCurveSetCurve.

Definition at line 2404 of file IccMpeBasic.cpp.

2405{
2406 if (v < m_firstEntry) {
2407 return m_loSlope * v + m_loIntercept;;
2408 }
2409 else if (v > m_lastEntry) {
2410 return m_hiSlope * v + m_hiIntercept;
2411 }
2412
2413 icFloatNumber pos = (v - m_firstEntry) / m_range * m_last;
2414 icUInt32Number index = (icUInt32Number)pos;
2415 icFloatNumber remainder = pos - (icFloatNumber)index;
2416
2417 if (remainder == 0.0)
2418 return m_pSamples[index];
2419
2420 return (icFloatNumber)((1.0 - remainder)*m_pSamples[index] + remainder*m_pSamples[index + 1]);
2421}
unsigned int icUInt32Number

◆ Begin()

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

Name: CIccSampledCalculatorCurve::Begin.

Purpose:

Args:

Return:

Implements CIccCurveSetCurve.

Definition at line 2336 of file IccMpeBasic.cpp.

2337{
2339 return false;
2340
2342 if (nSize < 2)
2343 nSize = 2;
2344 if (nSize > ICC_MAXCALCCURVESIZE)
2345 nSize = ICC_MAXCALCCURVESIZE;
2346
2347 SetSize(nSize);
2348
2350
2351 if (m_range == 0.0)
2352 return false;
2353
2354 m_last = (icFloatNumber)(m_nCount - 1);
2355 icFloatNumber stepSize = m_range / m_last;
2356
2357 //Use calculator element to populate lookup table
2358 CIccApplyMpe *pApply = m_pCalc->GetNewApply(NULL);
2359 for (icUInt32Number i = 0; i < m_nCount; i++) {
2360 icFloatNumber src, dst;
2362
2363 m_pCalc->Apply(pApply, &dst, &src);
2364 m_pSamples[i] = dst;
2365 }
2366
2367 if (pApply)
2368 delete pApply;
2369
2370 switch (m_extensionType) {
2372 m_loSlope = 0.0;
2374
2375 m_hiSlope = 0.0;
2377 break;
2378
2380 m_loSlope = (m_pSamples[1] - m_pSamples[0]) / stepSize;
2382
2383 m_hiSlope = (m_pSamples[m_nCount - 1] - m_pSamples[m_nCount - 2]) / stepSize;
2385 break;
2386
2387 default:
2388 return false;
2389 }
2390
2391 return true;
2392}
#define ICC_MAXCALCCURVESIZE
Class: CIccApplyMpe.
Definition IccTagMPE.h:203
virtual CIccApplyMpe * GetNewApply(CIccApplyTagMpe *pApplyTag)
Name: CIccMpeCalculator::Begin.
virtual void Apply(CIccApplyMpe *pApply, icFloatNumber *pDestPixel, const icFloatNumber *pSrcPixel) const
Name: CIccMpeCalculator::Apply.
virtual bool Begin(icElemInterp nInterp, CIccTagMultiProcessElement *pMPE)
Name: CIccSampledCalculatorCurve::Begin.
virtual bool SetSize(icUInt32Number nSize, bool bZeroAlloc=true)
Name: CIccSampledCalculatorCurve::SetSize.
@ icExtendSingleSampledCurve

References CIccApplyMpe::Apply(), ICC_MAXCALCCURVESIZE, icClipSingleSampledCurve, and icExtendSingleSampledCurve.

+ Here is the call graph for this function:

◆ Describe()

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

Name: CIccSampledCalculatorCurve::Describe.

Purpose:

Args:

Return:

Implements CIccCurveSetCurve.

Definition at line 2173 of file IccMpeBasic.cpp.

2174{
2175 icChar buf[128];
2176
2177 if (!m_pCalc) {
2178 sDescription += "Empty Sampled Calculator Curve [";
2179 sprintf(buf, "%.8f, ", m_firstEntry);
2180 sDescription += buf;
2181
2182 sprintf(buf, "%.8f,", m_lastEntry);
2183 sDescription += buf;
2184
2185 sprintf(buf, "%d", m_nDesiredSize);
2186 sDescription += buf;
2187
2188 sprintf(buf, "]\r\n");
2189 sDescription += buf;
2190 }
2191 else {
2192 sDescription += "Sampled Calculator Curve [";
2193
2194 sprintf(buf, "%.8f, ", m_firstEntry);
2195 sDescription += buf;
2196
2197 sprintf(buf, "%.8f,", m_lastEntry);
2198 sDescription += buf;
2199
2200 sprintf(buf, "%d", m_nDesiredSize);
2201 sDescription += buf;
2202
2203 sprintf(buf, "]\r\n");
2204 sDescription += buf;
2205
2206 switch (m_extensionType) {
2208 sDescription += "Clip End Points\n";
2209 break;
2211 sDescription += "Extend End Points\n";
2212 break;
2213 default:
2214 sDescription += "Unknown extension handling\n";
2215 break;
2216 }
2217 m_pCalc->Describe(sDescription, nVerboseness);
2218 }
2219 sDescription += "\r\n";
2220}
char icChar
Definition IccDefs.h:109
virtual void Describe(std::string &sDescription, int nVerboseness)
Name: CIccMpeCalculator::Describe.

References icClipSingleSampledCurve, and icExtendSingleSampledCurve.

◆ GetClassName()

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

Implements CIccCurveSetCurve.

Definition at line 363 of file IccMpeBasic.h.

363{ return "CIccSampledCalculatorCurve"; }

◆ GetExtensionType()

icUInt16Number CIccSampledCalculatorCurve::GetExtensionType ( )
inline

Definition at line 376 of file IccMpeBasic.h.

376{ return m_extensionType; }

◆ GetRecommendedSize()

virtual icUInt32Number CIccSampledCalculatorCurve::GetRecommendedSize ( )
inlinevirtual

Definition at line 370 of file IccMpeBasic.h.

370{ return m_nDesiredSize; }

◆ GetSize()

virtual icUInt32Number CIccSampledCalculatorCurve::GetSize ( )
inlinevirtual

Definition at line 373 of file IccMpeBasic.h.

373{ return m_nCount; }

◆ GetStorageType()

icUInt16Number CIccSampledCalculatorCurve::GetStorageType ( )
inlineprotected

Definition at line 389 of file IccMpeBasic.h.

389{ return 0; }

◆ GetType()

virtual icCurveElemSignature CIccSampledCalculatorCurve::GetType ( ) const
inlinevirtual

Implements CIccCurveSetCurve.

Definition at line 362 of file IccMpeBasic.h.

@ icSigSampledCalculatorCurve

References icSigSampledCalculatorCurve.

◆ NewCopy()

virtual CIccCurveSetCurve * CIccSampledCalculatorCurve::NewCopy ( ) const
inlinevirtual

Implements CIccCurveSetCurve.

Definition at line 359 of file IccMpeBasic.h.

359{ return new CIccSampledCalculatorCurve(*this); }
CIccSampledCalculatorCurve(icFloatNumber first=0.0, icFloatNumber last=1.0)
Name: CIccSampledCalculatorCurve::CIccSampledCalculatorCurve.

◆ operator=()

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

Name: &CIccSampledCalculatorCurve::operator=.

Purpose:

Args:

Return:

Definition at line 1963 of file IccMpeBasic.cpp.

1964{
1965 if (m_pCalc)
1966 delete m_pCalc;
1967
1968 if (m_pSamples)
1969 free(m_pSamples);
1970
1971 m_nReserved = curve.m_nReserved;
1972 m_nReserved2 = curve.m_nReserved2;
1973
1974 m_nCount = curve.m_nCount;
1975
1977
1979
1980 if (curve.m_pCalc)
1981 m_pCalc = curve.m_pCalc->NewCopy();
1982
1983 if (m_nCount) {
1984 m_pSamples = (icFloatNumber*)malloc(m_nCount * sizeof(icFloatNumber));
1985 if (m_pSamples)
1986 memcpy(m_pSamples, curve.m_pSamples, m_nCount * sizeof(icFloatNumber));
1987 else
1988 m_nCount = 0;
1989 }
1990 else {
1991 m_pSamples = NULL;
1992 }
1993
1994 m_firstEntry = curve.m_firstEntry;
1995 m_lastEntry = curve.m_lastEntry;
1996
1998 m_loSlope = curve.m_loSlope;
2000 m_hiSlope = curve.m_hiSlope;
2001 return (*this);
2002}

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.

Definition at line 2232 of file IccMpeBasic.cpp.

2233{
2235
2236 icUInt32Number headerSize = sizeof(icTagTypeSignature) +
2237 sizeof(icUInt32Number) +
2238 sizeof(icUInt32Number) +
2239 sizeof(icFloat32Number) +
2240 sizeof(icFloat32Number) +
2241 sizeof(icUInt16Number) +
2242 sizeof(icUInt16Number);
2243
2244 if (headerSize >= size)
2245 return false;
2246
2247 if (!pIO) {
2248 return false;
2249 }
2250
2251 if (!pIO->Read32(&sig) || sig != GetType())
2252 return false;
2253
2254 if (!pIO->Read32(&m_nReserved))
2255 return false;
2256
2257 if (!pIO->Read32(&m_nDesiredSize))
2258 return false;
2259
2260 if (!pIO->ReadFloat32Float(&m_firstEntry))
2261 return false;
2262
2263 if (!pIO->ReadFloat32Float(&m_lastEntry))
2264 return false;
2265
2266 if (!pIO->Read16(&m_extensionType))
2267 return false;
2268
2269 if (!pIO->Read16(&m_nReserved2))
2270 return false;
2271
2273 return false;
2274
2275 if (!m_pCalc->Read(size - headerSize, pIO))
2276 return false;
2277
2278 return true;
2279}
icArraySignature sig
icTagTypeSignature
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
Class: CIccMpeCalculator.
Definition IccMpeCalc.h:447
virtual bool Read(icUInt32Number size, CIccIO *pIO)
Name: CIccMpeCalculator::Read.
static CIccMultiProcessElement * Create(icElemTypeSignature sig)
Name: CIccMultiProcessElement::Create.
bool SetCalculator(CIccMpeCalculator *pCalc)
Name: CIccSampledCalculatorCurve::SetCalculator Purpose: Sets calculator associated with the curve.
virtual icCurveElemSignature GetType() const
float icFloat32Number
unsigned short icUInt16Number
icCurveSegSignature
MPE Curve segment Signatures.
@ icSigCalculatorElemType

References CIccMultiProcessElement::Create(), icSigCalculatorElemType, CIccIO::Read16(), CIccIO::Read32(), CIccIO::ReadFloat32Float(), and sig.

+ 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

Definition at line 2086 of file IccMpeBasic.cpp.

2087{
2088 if (m_pCalc)
2089 delete m_pCalc;
2090
2091 m_pCalc = pCalc;
2092
2093 return true;
2094}

◆ 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

Definition at line 2060 of file IccMpeBasic.cpp.

2061{
2062 m_extensionType = nExtensionType;
2063
2064 switch (nExtensionType) {
2067 return true;
2068 }
2069 return false;
2070}

References icClipSingleSampledCurve, and icExtendSingleSampledCurve.

◆ 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

Definition at line 2034 of file IccMpeBasic.cpp.

2035{
2036 if (first < last) {
2037 m_firstEntry = first;
2038 m_lastEntry = last;
2039 }
2040 else {
2041 m_firstEntry = last;
2042 m_lastEntry = first;
2043 }
2044}

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

Definition at line 2110 of file IccMpeBasic.cpp.

2111{
2112 if (nSize < 2) {
2113 return false;
2114 }
2115
2116 m_nDesiredSize = nSize;
2117
2118 return true;
2119}

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

Definition at line 2136 of file IccMpeBasic.cpp.

2137{
2138 if (nCount<2) {
2139 if (m_pSamples)
2140 free(m_pSamples);
2141 m_pSamples = NULL;
2142 m_nCount = nCount;
2143 return nCount == 0;
2144 }
2145
2146 if (m_pSamples) {
2147 free(m_pSamples);
2148 }
2149
2150 if (bZeroAlloc)
2151 m_pSamples = (icFloatNumber*)calloc(nCount, sizeof(icFloatNumber));
2152 else
2153 m_pSamples = (icFloatNumber*)malloc(nCount * sizeof(icFloatNumber));
2154
2155 if (m_pSamples)
2156 m_nCount = nCount;
2157 else
2158 m_nCount = 0;
2159
2160 return (m_pSamples != NULL);
2161}

◆ SetStorageType()

bool CIccSampledCalculatorCurve::SetStorageType ( icUInt16Number nStorateType)
inlineprotected

Definition at line 388 of file IccMpeBasic.h.

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.

Definition at line 2433 of file IccMpeBasic.cpp.

2434{
2435 CIccInfo Info;
2436 std::string sSigPathName = Info.GetSigPathName(sigPath);
2437
2439 if (m_nReserved || m_nReserved2) {
2440 sReport += icMsgValidateWarning;
2441 sReport += sSigPathName;
2442 sReport += " sampled calculator curve has non zero reserved data.\r\n";
2443 rv = icValidateWarning;
2444 }
2445
2447 sReport += icMsgValidateCriticalError;
2448 sReport += sSigPathName;
2449 sReport += " sampled calculator curve has unknown extension type\r\n";
2451 }
2452
2453 if (m_nDesiredSize < 2) {
2454 sReport += icMsgValidateWarning;
2455 sReport += sSigPathName;
2456 sReport += " sampled calculator curve has too few desired sample points.\r\n";
2458 }
2459
2460 if (m_lastEntry - m_firstEntry <= 0.0) {
2461 sReport += icMsgValidateWarning;
2462 sReport += sSigPathName;
2463 sReport += " sampled calculator curve has an invalid sample range.\n";
2465 }
2466
2467 if (pProfile && pProfile->m_Header.version < icVersionNumberV5_1) {
2468 sReport += icMsgValidateWarning;
2469 sReport += sSigPathName;
2470 sReport += " sampled calculator curve is not supported by version of profile.\n";
2472 }
2473
2474 if (!m_pCalc) {
2475 sReport += icMsgValidateCriticalError;
2476 sReport += sSigPathName;
2477 sReport += " sampled calculator curve has no calculator element\r\n";
2479 }
2480 else {
2481 icValidateStatus stat = m_pCalc->Validate(sSigPathName, sReport, pMPE, pProfile);
2482
2483 rv = icMaxStatus(rv, stat);
2484 }
2485
2486 return rv;
2487}
icValidateStatus
Definition IccDefs.h:118
@ icValidateOK
Definition IccDefs.h:119
@ icValidateWarning
Definition IccDefs.h:120
@ icValidateCriticalError
Definition IccDefs.h:122
icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Name: icMaxStatus.
Definition IccUtil.cpp:244
const char * icMsgValidateWarning
Definition IccUtil.cpp:90
const char * icMsgValidateCriticalError
Definition IccUtil.cpp:92
Type: Class.
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
Name: CIccMpeCalculator::Validate.
#define icMaxSingleSampledCurveType
#define icVersionNumberV5_1

References CIccInfo::GetSigPathName(), icMaxSingleSampledCurveType, icMaxStatus(), icMsgValidateCriticalError, icMsgValidateWarning, icValidateCriticalError, icValidateOK, icValidateWarning, and icVersionNumberV5_1.

+ Here is the call graph for this function:

◆ Write()

bool CIccSampledCalculatorCurve::Write ( CIccIO * pIO)
virtual

Name: CIccSampledCalculatorCurve::Write.

Purpose:

Args:

Return:

Implements CIccCurveSetCurve.

Definition at line 2291 of file IccMpeBasic.cpp.

2292{
2294
2295 if (!pIO)
2296 return false;
2297
2298 if (!pIO->Write32(&sig))
2299 return false;
2300
2301 if (!pIO->Write32(&m_nReserved))
2302 return false;
2303
2304 if (!pIO->Write32(&m_nDesiredSize))
2305 return false;
2306
2307 if (!pIO->WriteFloat32Float(&m_firstEntry))
2308 return false;
2309
2310 if (!pIO->WriteFloat32Float(&m_lastEntry))
2311 return false;
2312
2313 if (!pIO->Write16(&m_extensionType))
2314 return false;
2315
2316 if (!pIO->Write16(&m_nReserved2))
2317 return false;
2318
2319 if (m_pCalc && m_pCalc->Write(pIO)) {
2320 return true;
2321 }
2322
2323 return false;
2324}
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)
Name: CIccMpeCalculator::Write.
icCurveElemSignature
MPE Curve Set Curve signature.

References sig, CIccIO::Write16(), CIccIO::Write32(), and CIccIO::WriteFloat32Float().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_extensionType

icUInt16Number CIccSampledCalculatorCurve::m_extensionType
protected

Definition at line 398 of file IccMpeBasic.h.

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

◆ m_firstEntry

icFloatNumber CIccSampledCalculatorCurve::m_firstEntry
protected

Definition at line 400 of file IccMpeBasic.h.

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

◆ m_hiIntercept

icFloatNumber CIccSampledCalculatorCurve::m_hiIntercept
protected

Definition at line 409 of file IccMpeBasic.h.

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

◆ m_hiSlope

icFloatNumber CIccSampledCalculatorCurve::m_hiSlope
protected

Definition at line 408 of file IccMpeBasic.h.

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

◆ m_last

icFloatNumber CIccSampledCalculatorCurve::m_last
protected

Definition at line 404 of file IccMpeBasic.h.

◆ m_lastEntry

icFloatNumber CIccSampledCalculatorCurve::m_lastEntry
protected

Definition at line 401 of file IccMpeBasic.h.

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

◆ m_loIntercept

icFloatNumber CIccSampledCalculatorCurve::m_loIntercept
protected

Definition at line 407 of file IccMpeBasic.h.

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

◆ m_loSlope

icFloatNumber CIccSampledCalculatorCurve::m_loSlope
protected

Definition at line 406 of file IccMpeBasic.h.

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

◆ m_nCount

icUInt32Number CIccSampledCalculatorCurve::m_nCount
protected

Definition at line 394 of file IccMpeBasic.h.

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

◆ m_nDesiredSize

icUInt32Number CIccSampledCalculatorCurve::m_nDesiredSize
protected

Definition at line 413 of file IccMpeBasic.h.

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

◆ m_nReserved

icUInt32Number CIccSampledCalculatorCurve::m_nReserved
protected

Definition at line 391 of file IccMpeBasic.h.

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

◆ m_nReserved2

icUInt16Number CIccSampledCalculatorCurve::m_nReserved2
protected

Definition at line 392 of file IccMpeBasic.h.

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

◆ m_pCalc

CIccMpeCalculator* CIccSampledCalculatorCurve::m_pCalc
protected

Definition at line 411 of file IccMpeBasic.h.

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

◆ m_pSamples

icFloatNumber* CIccSampledCalculatorCurve::m_pSamples
protected

Definition at line 395 of file IccMpeBasic.h.

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

◆ m_range

icFloatNumber CIccSampledCalculatorCurve::m_range
protected

Definition at line 403 of file IccMpeBasic.h.

◆ m_storageType

icUInt16Number CIccSampledCalculatorCurve::m_storageType
protected

Definition at line 397 of file IccMpeBasic.h.


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