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

#include <IccTagLut.h>

Public Member Functions

 CIccCLUT (const CIccCLUT &ICLUT)
 
 CIccCLUT (icUInt8Number nInputChannels, icUInt16Number nOutputChannels, icUInt8Number nPrecision=2)
 
virtual ~CIccCLUT ()
 
void Begin ()
 
void DumpLut (std::string &sDescription, const icChar *szName, icColorSpaceSignature csInput, icColorSpaceSignature csOutput, int nVerboseness, bool bUseLegacy=false)
 
icFloatNumberGetData (int index)
 
icUInt32Number GetDimSize (icUInt8Number nIndex) const
 
icUInt8Number GetInputDim () const
 
CIccApplyCLUTGetNewApply ()
 
icUInt32Number GetNumOffset () const
 
icUInt32Number GetOffset (int index) const
 
icUInt16Number GetOutputChannels () const
 
icUInt8Number GetPrecision ()
 
icUInt8Number GridPoint (int index) const
 
const icUInt8NumberGridPointArray () const
 
icUInt8Number GridPoints () const
 
bool Init (const icUInt8Number *pGridPoints, icUInt32Number nMaxSize=0, icUInt8Number nBytesPerPoint=4)
 
bool Init (icUInt8Number nGridPoints, icUInt32Number nMaxSize=0, icUInt8Number nBytesPerPoint=4)
 
void Interp1d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 
void Interp2d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 
void Interp3d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 
void Interp3dTetra (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 
void Interp4d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 
void Interp5d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 
void Interp6d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 
void InterpND (icFloatNumber *destPixel, const icFloatNumber *srcPixel, CIccApplyCLUT *pApply) const
 
void Iterate (IIccCLUTExec *pExec)
 
icUInt32Number MaxGridPoint (int index) const
 
icUInt32Number NumPoints () const
 
CIccCLUToperator= (const CIccCLUT &CLUTClass)
 
icFloatNumberoperator[] (int index)
 
bool Read (icUInt32Number size, CIccIO *pIO)
 
bool ReadData (icUInt32Number size, CIccIO *pIO, icUInt8Number nPrecision)
 
void SetClipFunc (icCLUTCLIPFUNC ClipFunc)
 
void SetPrecision (icUInt8Number nPrecision)
 
icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 
bool Write (CIccIO *pIO)
 
bool WriteData (CIccIO *pIO, icUInt8Number nPrecision)
 

Protected Member Functions

void Iterate (std::string &sDescription, icUInt8Number nIndex, icUInt32Number nPos, bool bUseLegacy=false)
 
void SubIterate (IIccCLUTExec *pExec, icUInt8Number nIndex, icUInt32Number nPos)
 

Protected Attributes

icColorSpaceSignature m_csInput
 
icColorSpaceSignature m_csOutput
 
icUInt32Number m_DimSize [16]
 
icFloatNumber m_fGridAdr [16]
 
icUInt8Number m_GridAdr [16]
 
icUInt8Number m_GridPoints [16]
 
icUInt8Number m_MaxGridPoint [16]
 
icUInt8Number m_nInput
 
icUInt32Number m_nNodes
 
icUInt32Number m_nNumPoints
 
icUInt32Numberm_nOffset
 
icUInt16Number m_nOutput
 
icUInt32Number m_nPower [16]
 
icUInt8Number m_nPrecision
 
icUInt8Number m_nReserved2 [3]
 
icFloatNumberm_pData
 
icCharm_pOutText
 
icCharm_pVal
 
icUInt32Number n000
 
icUInt32Number n001
 
icUInt32Number n010
 
icUInt32Number n011
 
icUInt32Number n100
 
icUInt32Number n1000
 
icUInt32Number n10000
 
icUInt32Number n100000
 
icUInt32Number n101
 
icUInt32Number n110
 
icUInt32Number n111
 
icCLUTCLIPFUNC UnitClip
 

Detailed Description

Class: CIccCLUT

Purpose: The base multidimensional color look-up table (CLUT) class

Constructor & Destructor Documentation

◆ CIccCLUT() [1/2]

CIccCLUT::CIccCLUT ( icUInt8Number  nInputChannels,
icUInt16Number  nOutputChannels,
icUInt8Number  nPrecision = 2 
)

Name: CIccCLUT::CIccCLUT

Purpose: Constructor

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

1689{
1690 m_nInput = nInputChannels;
1691 m_nOutput = nOutputChannels;
1692 m_nPrecision = nPrecision;
1693 m_pData = NULL;
1694 m_nOffset = NULL;
1695 memset(&m_nReserved2, 0 , sizeof(m_nReserved2));
1696
1698}
static icFloatNumber ClutUnitClip(icFloatNumber v)
Definition IccTagLut.cpp:1605
icCLUTCLIPFUNC UnitClip
Definition IccTagLut.h:388
icUInt8Number m_nInput
Definition IccTagLut.h:392
icUInt8Number m_nPrecision
Definition IccTagLut.h:394
icUInt16Number m_nOutput
Definition IccTagLut.h:393
icUInt32Number * m_nOffset
Definition IccTagLut.h:413
icUInt8Number m_nReserved2[3]
Definition IccTagLut.h:390
icFloatNumber * m_pData
Definition IccTagLut.h:400

References ClutUnitClip(), m_nInput, m_nOffset, m_nOutput, m_nPrecision, m_nReserved2, m_pData, and UnitClip.

Referenced by CDevLinkWriter::begin(), CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), icCLutFromXml(), main(), CIccMBB::NewCLUT(), CIccMBB::NewCLUT(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeSpectralCLUT::Read(), CIccTagLutAtoB::Read(), CIccTagLut8::Read(), and CIccTagLut16::Read().

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

◆ CIccCLUT() [2/2]

CIccCLUT::CIccCLUT ( const CIccCLUT ICLUT)

Name: CIccCLUT::CIccCLUT

Purpose: Copy Constructor

Args: ICLUT = The CIccCLUT object to be copied

1712{
1713 m_pData = NULL;
1714 m_nOffset = NULL;
1715 m_nInput = ICLUT.m_nInput;
1716 m_nOutput = ICLUT.m_nOutput;
1717 m_nPrecision = ICLUT.m_nPrecision;
1718 m_nNumPoints = ICLUT.m_nNumPoints;
1719
1720 m_csInput = ICLUT.m_csInput;
1721 m_csOutput = ICLUT.m_csOutput;
1722
1723 memcpy(m_GridPoints, ICLUT.m_GridPoints, sizeof(m_GridPoints));
1724 memcpy(m_DimSize, ICLUT.m_DimSize, sizeof(m_DimSize));
1725 memcpy(m_GridAdr, ICLUT.m_GridAdr, sizeof(m_GridAdr));
1726 memcpy(&m_nReserved2, &ICLUT.m_nReserved2, sizeof(m_nReserved2));
1727
1728 int num = NumPoints()*m_nOutput;
1729 m_pData = new icFloatNumber[num];
1730 memcpy(m_pData, ICLUT.m_pData, num*sizeof(icFloatNumber));
1731
1732 UnitClip = ICLUT.UnitClip;
1733}
float icFloatNumber
Definition IccDefs.h:101
icUInt32Number m_DimSize[16]
Definition IccTagLut.h:399
icUInt8Number m_GridAdr[16]
Definition IccTagLut.h:403
icColorSpaceSignature m_csOutput
Definition IccTagLut.h:406
icUInt32Number NumPoints() const
Definition IccTagLut.h:348
icUInt32Number m_nNumPoints
Definition IccTagLut.h:397
icColorSpaceSignature m_csInput
Definition IccTagLut.h:406
icUInt8Number m_GridPoints[16]
Definition IccTagLut.h:396

References m_csInput, m_csOutput, m_DimSize, m_GridAdr, m_GridPoints, m_nInput, m_nNumPoints, m_nOffset, m_nOutput, m_nPrecision, m_nReserved2, m_pData, NumPoints(), and UnitClip.

Referenced by CIccMBB::CIccMBB(), CIccMpeCLUT::CIccMpeCLUT(), CIccMpeSpectralCLUT::CIccMpeSpectralCLUT(), CIccMpeSpectralCLUT::copyData(), CIccMBB::operator=(), and CIccMpeCLUT::operator=().

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

◆ ~CIccCLUT()

CIccCLUT::~CIccCLUT ( )
virtual

Name: CIccCLUT::~CIccCLUT

Purpose: Destructor

1787{
1788 if (m_pData)
1789 delete [] m_pData;
1790
1791 if (m_nOffset)
1792 delete [] m_nOffset;
1793
1794}

References m_nOffset, and m_pData.

Member Function Documentation

◆ Begin()

void CIccCLUT::Begin ( )

Name: CIccCLUT::Begin

Purpose: Initializes the CLUT. Must be called before Apply().

2222{
2223 int i;
2224 for (i=0; i<m_nInput; i++) {
2225 m_MaxGridPoint[i] = m_GridPoints[i] - 1;
2226 }
2227 m_nNodes = (1<<m_nInput);
2228
2229 if (m_nOffset)
2230 delete [] m_nOffset;
2231
2233
2234 if (m_nInput==1) {
2235 m_nOffset[0] = n000 = 0;
2236 m_nOffset[1] = n001 = m_DimSize[0];
2237 }
2238 else if (m_nInput==2) {
2239 m_nOffset[0] = n000 = 0;
2240 m_nOffset[1] = n001 = m_DimSize[0];
2241 m_nOffset[2] = n010 = m_DimSize[1];
2242 m_nOffset[3] = n011 = n001 + n010;
2243 }
2244 else if (m_nInput==3) {
2245 m_nOffset[0] = n000 = 0;
2246 m_nOffset[1] = n001 = m_DimSize[0];
2247 m_nOffset[2] = n010 = m_DimSize[1];
2248 m_nOffset[3] = n011 = n001 + n010;
2249 m_nOffset[4] = n100 = m_DimSize[2];
2250 m_nOffset[5] = n101 = n100 + n001;
2251 m_nOffset[6] = n110 = n100 + n010;
2252 m_nOffset[7] = n111 = n110 + n001;
2253 }
2254 else if (m_nInput == 4) {
2255 m_nOffset[ 0] = 0;
2256 m_nOffset[ 1] = n001 = m_DimSize[ 0];
2257 m_nOffset[ 2] = n010 = m_DimSize[ 1];
2258 m_nOffset[ 3] = m_nOffset[ 2] + m_nOffset[ 1];
2259 m_nOffset[ 4] = n100 = m_DimSize[ 2];
2260 m_nOffset[ 5] = m_nOffset[ 4] + m_nOffset[ 1];
2261 m_nOffset[ 6] = m_nOffset[ 4] + m_nOffset[ 2];
2262 m_nOffset[ 7] = m_nOffset[ 4] + m_nOffset[ 3];
2263 m_nOffset[ 8] = n1000 = m_DimSize[ 3];
2264 m_nOffset[ 9] = m_nOffset[ 8] + m_nOffset[ 1];
2265 m_nOffset[10] = m_nOffset[ 8] + m_nOffset[ 2];
2266 m_nOffset[11] = m_nOffset[ 8] + m_nOffset[ 3];
2267 m_nOffset[12] = m_nOffset[ 8] + m_nOffset[ 4];
2268 m_nOffset[13] = m_nOffset[ 8] + m_nOffset[ 5];
2269 m_nOffset[14] = m_nOffset[ 8] + m_nOffset[ 6];
2270 m_nOffset[15] = m_nOffset[ 8] + m_nOffset[ 7];
2271 }
2272 else if (m_nInput == 5) {
2273 m_nOffset[ 0] = 0;
2274 m_nOffset[ 1] = n001 = m_DimSize[ 0];
2275 m_nOffset[ 2] = n010 = m_DimSize[ 1];
2276 m_nOffset[ 3] = m_nOffset[ 2] + m_nOffset[ 1];
2277 m_nOffset[ 4] = n100 = m_DimSize[ 2];
2278 m_nOffset[ 5] = m_nOffset[ 4] + m_nOffset[ 1];
2279 m_nOffset[ 6] = m_nOffset[ 4] + m_nOffset[ 2];
2280 m_nOffset[ 7] = m_nOffset[ 4] + m_nOffset[ 3];
2281 m_nOffset[ 8] = n1000 = m_DimSize[ 3];
2282 m_nOffset[ 9] = m_nOffset[ 8] + m_nOffset[ 1];
2283 m_nOffset[10] = m_nOffset[ 8] + m_nOffset[ 2];
2284 m_nOffset[11] = m_nOffset[ 8] + m_nOffset[ 3];
2285 m_nOffset[12] = m_nOffset[ 8] + m_nOffset[ 4];
2286 m_nOffset[13] = m_nOffset[ 8] + m_nOffset[ 5];
2287 m_nOffset[14] = m_nOffset[ 8] + m_nOffset[ 6];
2288 m_nOffset[15] = m_nOffset[ 8] + m_nOffset[ 7];
2289 m_nOffset[16] = n10000 = m_DimSize[ 4];
2290 m_nOffset[17] = m_nOffset[16] + m_nOffset[ 1];
2291 m_nOffset[18] = m_nOffset[16] + m_nOffset[ 2];
2292 m_nOffset[19] = m_nOffset[16] + m_nOffset[ 3];
2293 m_nOffset[20] = m_nOffset[16] + m_nOffset[ 4];
2294 m_nOffset[21] = m_nOffset[16] + m_nOffset[ 5];
2295 m_nOffset[22] = m_nOffset[16] + m_nOffset[ 6];
2296 m_nOffset[23] = m_nOffset[16] + m_nOffset[ 7];
2297 m_nOffset[24] = m_nOffset[16] + m_nOffset[ 8];
2298 m_nOffset[25] = m_nOffset[16] + m_nOffset[ 9];
2299 m_nOffset[26] = m_nOffset[16] + m_nOffset[10];
2300 m_nOffset[27] = m_nOffset[16] + m_nOffset[11];
2301 m_nOffset[28] = m_nOffset[16] + m_nOffset[12];
2302 m_nOffset[29] = m_nOffset[16] + m_nOffset[13];
2303 m_nOffset[30] = m_nOffset[16] + m_nOffset[14];
2304 m_nOffset[31] = m_nOffset[16] + m_nOffset[15];
2305 }
2306 else if (m_nInput == 6) {
2307 m_nOffset[ 0] = 0;
2308 m_nOffset[ 1] = n001 = m_DimSize[ 0];
2309 m_nOffset[ 2] = n010 = m_DimSize[ 1];
2310 m_nOffset[ 3] = m_nOffset[ 2] + m_nOffset[ 1];
2311 m_nOffset[ 4] = n100 = m_DimSize[ 2];
2312 m_nOffset[ 5] = m_nOffset[ 4] + m_nOffset[ 1];
2313 m_nOffset[ 6] = m_nOffset[ 4] + m_nOffset[ 2];
2314 m_nOffset[ 7] = m_nOffset[ 4] + m_nOffset[ 3];
2315 m_nOffset[ 8] = n1000 = m_DimSize[ 3];
2316 m_nOffset[ 9] = m_nOffset[ 8] + m_nOffset[ 1];
2317 m_nOffset[10] = m_nOffset[ 8] + m_nOffset[ 2];
2318 m_nOffset[11] = m_nOffset[ 8] + m_nOffset[ 3];
2319 m_nOffset[12] = m_nOffset[ 8] + m_nOffset[ 4];
2320 m_nOffset[13] = m_nOffset[ 8] + m_nOffset[ 5];
2321 m_nOffset[14] = m_nOffset[ 8] + m_nOffset[ 6];
2322 m_nOffset[15] = m_nOffset[ 8] + m_nOffset[ 7];
2323 m_nOffset[16] = n10000 = m_DimSize[ 4];
2324 m_nOffset[17] = m_nOffset[16] + m_nOffset[ 1];
2325 m_nOffset[18] = m_nOffset[16] + m_nOffset[ 2];
2326 m_nOffset[19] = m_nOffset[16] + m_nOffset[ 3];
2327 m_nOffset[20] = m_nOffset[16] + m_nOffset[ 4];
2328 m_nOffset[21] = m_nOffset[16] + m_nOffset[ 5];
2329 m_nOffset[22] = m_nOffset[16] + m_nOffset[ 6];
2330 m_nOffset[23] = m_nOffset[16] + m_nOffset[ 7];
2331 m_nOffset[24] = m_nOffset[16] + m_nOffset[ 8];
2332 m_nOffset[25] = m_nOffset[16] + m_nOffset[ 9];
2333 m_nOffset[26] = m_nOffset[16] + m_nOffset[10];
2334 m_nOffset[27] = m_nOffset[16] + m_nOffset[11];
2335 m_nOffset[28] = m_nOffset[16] + m_nOffset[12];
2336 m_nOffset[29] = m_nOffset[16] + m_nOffset[13];
2337 m_nOffset[30] = m_nOffset[16] + m_nOffset[14];
2338 m_nOffset[31] = m_nOffset[16] + m_nOffset[15];
2339 m_nOffset[32] = n100000 = m_DimSize[5];
2340 m_nOffset[33] = m_nOffset[32] + m_nOffset[ 1];
2341 m_nOffset[34] = m_nOffset[32] + m_nOffset[ 2];
2342 m_nOffset[35] = m_nOffset[32] + m_nOffset[ 3];
2343 m_nOffset[36] = m_nOffset[32] + m_nOffset[ 4];
2344 m_nOffset[37] = m_nOffset[32] + m_nOffset[ 5];
2345 m_nOffset[38] = m_nOffset[32] + m_nOffset[ 6];
2346 m_nOffset[39] = m_nOffset[32] + m_nOffset[ 7];
2347 m_nOffset[40] = m_nOffset[32] + m_nOffset[ 8];
2348 m_nOffset[41] = m_nOffset[32] + m_nOffset[ 9];
2349 m_nOffset[42] = m_nOffset[32] + m_nOffset[10];
2350 m_nOffset[43] = m_nOffset[32] + m_nOffset[11];
2351 m_nOffset[44] = m_nOffset[32] + m_nOffset[12];
2352 m_nOffset[45] = m_nOffset[32] + m_nOffset[13];
2353 m_nOffset[46] = m_nOffset[32] + m_nOffset[14];
2354 m_nOffset[47] = m_nOffset[32] + m_nOffset[15];
2355 m_nOffset[48] = m_nOffset[32] + m_nOffset[16];
2356 m_nOffset[49] = m_nOffset[32] + m_nOffset[17];
2357 m_nOffset[50] = m_nOffset[32] + m_nOffset[18];
2358 m_nOffset[51] = m_nOffset[32] + m_nOffset[19];
2359 m_nOffset[52] = m_nOffset[32] + m_nOffset[20];
2360 m_nOffset[53] = m_nOffset[32] + m_nOffset[21];
2361 m_nOffset[54] = m_nOffset[32] + m_nOffset[22];
2362 m_nOffset[55] = m_nOffset[32] + m_nOffset[23];
2363 m_nOffset[56] = m_nOffset[32] + m_nOffset[24];
2364 m_nOffset[57] = m_nOffset[32] + m_nOffset[25];
2365 m_nOffset[58] = m_nOffset[32] + m_nOffset[26];
2366 m_nOffset[59] = m_nOffset[32] + m_nOffset[27];
2367 m_nOffset[60] = m_nOffset[32] + m_nOffset[28];
2368 m_nOffset[61] = m_nOffset[32] + m_nOffset[29];
2369 m_nOffset[62] = m_nOffset[32] + m_nOffset[30];
2370 m_nOffset[63] = m_nOffset[32] + m_nOffset[31];
2371 }
2372 else {
2373
2374 m_nOffset[0] = 0;
2375 int count, nFlag;
2376 icUInt32Number nPower[2];
2377 nPower[0] = 0;
2378 nPower[1] = 1;
2379
2380 for (count=0; count<m_nInput; count++) {
2381 m_nPower[count] = (1<<(m_nInput-1-count));
2382 }
2383
2384 count = 0;
2385 nFlag = 1;
2386 for (icUInt32Number j=1; j<m_nNodes; j++) {
2387 if (j == nPower[1]) {
2388 m_nOffset[j] = m_DimSize[count];
2389 nPower[0] = (1<<count);
2390 count++;
2391 nPower[1] = (1<<count);
2392 nFlag = 1;
2393 }
2394 else {
2395 m_nOffset[j] = m_nOffset[nPower[0]] + m_nOffset[nFlag];
2396 nFlag++;
2397 }
2398 }
2399 }
2400}
unsigned long icUInt32Number
Definition icProfileHeader.h:262
icUInt8Number m_MaxGridPoint[16]
Definition IccTagLut.h:409
icUInt32Number n011
Definition IccTagLut.h:410
icUInt32Number n110
Definition IccTagLut.h:410
icUInt32Number m_nNodes
Definition IccTagLut.h:414
icUInt32Number n010
Definition IccTagLut.h:410
icUInt32Number n100
Definition IccTagLut.h:410
icUInt32Number n000
Definition IccTagLut.h:410
icUInt32Number n111
Definition IccTagLut.h:410
icUInt32Number n001
Definition IccTagLut.h:410
icUInt32Number n10000
Definition IccTagLut.h:410
icUInt32Number n101
Definition IccTagLut.h:410
icUInt32Number m_nPower[16]
Definition IccTagLut.h:414
icUInt32Number n100000
Definition IccTagLut.h:410
icUInt32Number n1000
Definition IccTagLut.h:410

References m_DimSize, m_GridPoints, m_MaxGridPoint, m_nInput, m_nNodes, m_nOffset, m_nPower, n000, n001, n010, n011, n100, n1000, n10000, n100000, n101, n110, and n111.

Referenced by CIccMpeCLUT::Begin(), CIccMpeEmissionCLUT::Begin(), and CIccMpeReflectanceCLUT::Begin().

+ Here is the caller graph for this function:

◆ DumpLut()

void CIccCLUT::DumpLut ( std::string &  sDescription,
const icChar szName,
icColorSpaceSignature  csInput,
icColorSpaceSignature  csOutput,
int  nVerboseness,
bool  bUseLegacy = false 
)

Name: CIccCLUT::DumpLut

Purpose: Dump data associated with the tag to a string.

Args: sDescription = string to concatenate tag dump to, szName = name of the LUT to be printed, csInput = color space signature of the input data, csOutput = color space signature of the output data nVerboseness = how verbose the output is (bigger = more verbose)

2160{
2161 icChar szOutText[200000], szColor[40];
2162 int i;
2163
2164 sprintf(szOutText, "BEGIN_LUT %s %d %d\n", szName, m_nInput, m_nOutput);
2165 sDescription += szOutText;
2166
2167 if (nVerboseness > 75) {
2168
2169 for (i=0; i<m_nInput; i++) {
2170 icColorIndexName(szColor, csInput, i, m_nInput, "In");
2171 sprintf(szOutText, " %s=%d", szColor, m_GridPoints[i]);
2172 sDescription += szOutText;
2173 }
2174
2175 sDescription += " ";
2176
2177 for (i=0; i<m_nOutput; i++) {
2178 icColorIndexName(szColor, csOutput, i, m_nOutput, "Out");
2179 sprintf(szOutText, " %s", szColor);
2180 sDescription += szOutText;
2181 }
2182
2183 sDescription += "\n";
2184
2185 if (nVerboseness > 75) {
2186 size_t len = 0;
2187 for (i=0; i<m_nInput; i++) {
2188 icColorValue(szColor, 1.0, csInput, i, bUseLegacy);
2189 len += strlen(szColor);
2190 }
2191 for (i=0; i<m_nOutput; i++) {
2192 icColorValue(szColor, 1.0, csOutput, i, bUseLegacy);
2193 len += strlen(szColor);
2194 }
2195 len += m_nInput + m_nOutput + 6;
2196
2197 sDescription.reserve(sDescription.size() + NumPoints()*len);
2198
2199 //Initialize iteration member variables
2200 m_csInput = csInput;
2201 m_csOutput = csOutput;
2202 m_pOutText = szOutText;
2203 m_pVal = szColor;
2204 memset(m_GridAdr, 0, 16);
2205
2206 Iterate(sDescription, 0, 0, bUseLegacy);
2207 }
2208 }
2209}
char icChar
Definition IccDefs.h:110
ICCPROFLIB_API void icColorValue(icChar *szValue, icFloatNumber nValue, icColorSpaceSignature csSig, int nIndex, bool bUseLegacy=false)
Definition IccUtil.cpp:330
ICCPROFLIB_API void icColorIndexName(icChar *szName, icColorSpaceSignature csSig, int nIndex, int nColors, const icChar *szUnknown)
Definition IccUtil.cpp:295
icChar * m_pVal
Definition IccTagLut.h:405
void Iterate(IIccCLUTExec *pExec)
Definition IccTagLut.cpp:2069
icChar * m_pOutText
Definition IccTagLut.h:405

References icColorIndexName(), icColorValue(), Iterate(), m_csInput, m_csOutput, m_GridAdr, m_GridPoints, m_nInput, m_nOutput, m_pOutText, m_pVal, and NumPoints().

Referenced by CIccMpeCLUT::Describe(), CIccMpeExtCLUT::Describe(), CIccMpeSpectralCLUT::Describe(), and CIccMBB::Describe().

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

◆ GetData()

icFloatNumber * CIccCLUT::GetData ( int  index)
inline
347{ return &m_pData[index]; }

References m_pData.

Referenced by CDevLinkWriter::begin(), CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), icCLutFromXml(), main(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), and CIccMpeSpectralCLUT::Write().

+ Here is the caller graph for this function:

◆ GetDimSize()

icUInt32Number CIccCLUT::GetDimSize ( icUInt8Number  nIndex) const
inline
354{ return m_DimSize[nIndex]; }

References m_DimSize.

◆ GetInputDim()

icUInt8Number CIccCLUT::GetInputDim ( ) const
inline
356{ return m_nInput; }

References m_nInput.

Referenced by icCLUTDataToXml(), CIccMBB::SetCLUT(), CIccMpeCLUT::SetCLUT(), and CIccMpeSpectralCLUT::SetData().

+ Here is the caller graph for this function:

◆ GetNewApply()

CIccApplyCLUT * CIccCLUT::GetNewApply ( )
2404{
2405 CIccApplyCLUT* rv = new CIccApplyCLUT();
2406
2407 if (!rv)
2408 return NULL;
2409
2410 if (!rv->Init(m_nInput, m_nNodes)) {
2411 delete rv;
2412 return NULL;
2413 }
2414
2415 return rv;
2416}
Definition IccTagLut.h:302
bool Init(icUInt8Number nSrcChannels, icUInt32Number nNodes)
Definition IccTagLut.cpp:1661

References CIccApplyCLUT::CIccApplyCLUT(), CIccApplyCLUT::Init(), m_nInput, and m_nNodes.

Referenced by CIccMpeCLUT::GetNewApply(), and CIccMpeSpectralCLUT::GetNewApply().

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

◆ GetNumOffset()

icUInt32Number CIccCLUT::GetNumOffset ( ) const
inline
359{ return m_nNodes; }

References m_nNodes.

◆ GetOffset()

icUInt32Number CIccCLUT::GetOffset ( int  index) const
inline
360{ return m_nOffset ? m_nOffset[index] : 0; }

References m_nOffset.

◆ GetOutputChannels()

icUInt16Number CIccCLUT::GetOutputChannels ( ) const
inline
357{ return m_nOutput; }

References m_nOutput.

Referenced by CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), icCLUTDataToXml(), icCLutFromXml(), CIccMBB::SetCLUT(), and CIccMpeCLUT::SetCLUT().

+ Here is the caller graph for this function:

◆ GetPrecision()

icUInt8Number CIccCLUT::GetPrecision ( )
inline
381{ return m_nPrecision; }

References m_nPrecision.

Referenced by icCLUTDataToXml().

+ Here is the caller graph for this function:

◆ GridPoint()

icUInt8Number CIccCLUT::GridPoint ( int  index) const
inline
350{ return m_GridPoints[index]; }

References m_GridPoints.

Referenced by icCLUTDataToXml(), icCLUTToXml(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), and CIccMpeSpectralCLUT::Write().

+ Here is the caller graph for this function:

◆ GridPointArray()

const icUInt8Number * CIccCLUT::GridPointArray ( ) const
inline
351{return &m_GridPoints[0]; }

References m_GridPoints.

Referenced by CIccMpeEmissionCLUT::Begin(), and CIccMpeReflectanceCLUT::Begin().

+ Here is the caller graph for this function:

◆ GridPoints()

icUInt8Number CIccCLUT::GridPoints ( ) const
inline
349{ return m_GridPoints[0]; }

References m_GridPoints.

Referenced by CIccEvalCompare::EvaluateProfile(), CIccTagLut8::Write(), and CIccTagLut16::Write().

+ Here is the caller graph for this function:

◆ Init() [1/2]

bool CIccCLUT::Init ( const icUInt8Number pGridPoints,
icUInt32Number  nMaxSize = 0,
icUInt8Number  nBytesPerPoint = 4 
)

Name: CIccCLUT::Init

Purpose: Initializes and sets the size of the CLUT

Args: pGridPoints = number of grid points in the CLUT

1827{
1828 if (nMaxSize && !nBytesPerPoint)
1829 return false;
1830
1831 icUInt64Number nNumPoints;
1832 memset(m_nReserved2, 0, sizeof(m_nReserved2));
1833 if (pGridPoints!=&m_GridPoints[0]) {
1834 // m_GridPoints[] is fixed size of 16
1835 if (m_nInput > 16)
1836 return false;
1837 memcpy(m_GridPoints, pGridPoints, m_nInput);
1838 if (m_nInput<16)
1839 memset(m_GridPoints+m_nInput, 0, 16-m_nInput);
1840 }
1841
1842 // There should be at least 2 grid points for each input dimension for interpolation to work
1843 for (int i = 0; i < m_nInput; i++) {
1844 if (pGridPoints[i] < 2)
1845 return false;
1846 }
1847
1848 if (m_pData) {
1849 delete [] m_pData;
1850 m_pData = NULL;
1851 }
1852
1853 int i=m_nInput-1;
1854
1855 // m_DimSize[] is a fixed size of 16
1856 if (i >= 16)
1857 return false;
1858
1859 m_DimSize[i] = m_nOutput;
1860 nNumPoints = m_GridPoints[i];
1861 for (i--; i>=0; i--) {
1862 m_DimSize[i] = m_DimSize[i+1] * m_GridPoints[i+1];
1863 nNumPoints *= m_GridPoints[i];
1864 if (nMaxSize && nNumPoints * m_nOutput * nBytesPerPoint > nMaxSize)
1865 return false;
1866 }
1867 m_nNumPoints = (icUInt32Number)nNumPoints;
1868
1870
1871 if (!nSize)
1872 return false;
1873
1874 m_pData = new icFloatNumber[nSize];
1875
1876 return (m_pData != NULL);
1877}
icUInt32Number icUInt64Number[2]
Definition icProfileHeader.h:268

References m_DimSize, m_GridPoints, m_nInput, m_nNumPoints, m_nOutput, m_nReserved2, m_pData, and NumPoints().

Referenced by CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), icCLutFromXml(), Init(), CIccMBB::NewCLUT(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeSpectralCLUT::Read(), and Read().

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

◆ Init() [2/2]

bool CIccCLUT::Init ( icUInt8Number  nGridPoints,
icUInt32Number  nMaxSize = 0,
icUInt8Number  nBytesPerPoint = 4 
)

Name: CIccCLUT::Init

Purpose: Initializes and sets the size of the CLUT

Args: nGridPoints = number of grid points in the CLUT

1807{
1808 memset(&m_GridPoints, 0, sizeof(m_GridPoints));
1809 // m_GridPoints[] is a fixed length of 16
1810 if (m_nInput > 16)
1811 return false;
1812 memset(m_GridPoints, nGridPoints, m_nInput);
1813 return Init(&m_GridPoints[0], nMaxSize, nBytesPerPoint);
1814}
bool Init(icUInt8Number nGridPoints, icUInt32Number nMaxSize=0, icUInt8Number nBytesPerPoint=4)
Definition IccTagLut.cpp:1806

References Init(), m_GridPoints, and m_nInput.

Referenced by CDevLinkWriter::begin(), icCLutFromXml(), main(), CIccMBB::NewCLUT(), CIccTagLut8::Read(), and CIccTagLut16::Read().

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

◆ Interp1d()

void CIccCLUT::Interp1d ( icFloatNumber destPixel,
const icFloatNumber srcPixel 
) const

Name: CIccCLUT::Interp1d

Purpose: One dimensional interpolation function

Args: Pixel = Pixel value to be found in the CLUT. Also used to store the result.

2429{
2431
2432 icFloatNumber x = UnitClip(srcPixel[0]) * mx;
2433
2435
2436 icFloatNumber u = x - ix;
2437
2438 if (ix==mx) {
2439 ix--;
2440 u = 1.0;
2441 }
2442
2443 icFloatNumber nu = (icFloatNumber)(1.0 - u);
2444
2445 int i;
2446 icFloatNumber *p = &m_pData[ix*n001];
2447
2448 //Normalize grid units
2449 icFloatNumber dF0, dF1, pv;
2450
2451 dF0 = nu;
2452 dF1 = u;
2453
2454 for (i=0; i<m_nOutput; i++, p++) {
2455 pv = p[n000]*dF0 + p[n001]*dF1;
2456
2457 destPixel[i] = pv;
2458 }
2459}
unsigned char icUInt8Number
Definition icProfileHeader.h:250

References m_MaxGridPoint, m_nOutput, m_pData, n000, n001, and UnitClip.

Referenced by CIccMpeCLUT::Apply(), and CIccMpeSpectralCLUT::Apply().

+ Here is the caller graph for this function:

◆ Interp2d()

void CIccCLUT::Interp2d ( icFloatNumber destPixel,
const icFloatNumber srcPixel 
) const

Name: CIccCLUT::Interp2d

Purpose: Two dimensional interpolation function

Args: Pixel = Pixel value to be found in the CLUT. Also used to store the result.

2473{
2476
2477 icFloatNumber x = UnitClip(srcPixel[0]) * mx;
2478 icFloatNumber y = UnitClip(srcPixel[1]) * my;
2479
2482
2483 icFloatNumber u = x - ix;
2484 icFloatNumber t = y - iy;
2485
2486 if (ix==mx) {
2487 ix--;
2488 u = 1.0f;
2489 }
2490 if (iy==my) {
2491 iy--;
2492 t = 1.0f;
2493 }
2494
2495 icFloatNumber nt = 1.0f - t;
2496 icFloatNumber nu = 1.0f - u;
2497
2498 int i;
2499 icFloatNumber *p = &m_pData[ix*n001 + iy*n010];
2500
2501 //Normalize grid units
2502 icFloatNumber dF0, dF1, dF2, dF3, pv;
2503
2504 dF0 = nt* nu;
2505 dF1 = nt* u;
2506 dF2 = t* nu;
2507 dF3 = t* u;
2508
2509 for (i=0; i<m_nOutput; i++, p++) {
2510 pv = p[n000]*dF0 + p[n001]*dF1 + p[n010]*dF2 + p[n011]*dF3;
2511
2512 destPixel[i] = pv;
2513 }
2514}

References m_MaxGridPoint, m_nOutput, m_pData, n000, n001, n010, n011, and UnitClip.

Referenced by CIccMpeCLUT::Apply(), and CIccMpeSpectralCLUT::Apply().

+ Here is the caller graph for this function:

◆ Interp3d()

void CIccCLUT::Interp3d ( icFloatNumber destPixel,
const icFloatNumber srcPixel 
) const

Name: CIccCLUT::Interp3d

Purpose: Three dimensional interpolation function

Args: Pixel = Pixel value to be found in the CLUT. Also used to store the result.

2614{
2618
2619 icFloatNumber x = UnitClip(srcPixel[0]) * mx;
2620 icFloatNumber y = UnitClip(srcPixel[1]) * my;
2621 icFloatNumber z = UnitClip(srcPixel[2]) * mz;
2622
2626
2627 icFloatNumber u = x - ix;
2628 icFloatNumber t = y - iy;
2629 icFloatNumber s = z - iz;
2630
2631 if (ix==mx) {
2632 ix--;
2633 u = 1.0f;
2634 }
2635 if (iy==my) {
2636 iy--;
2637 t = 1.0f;
2638 }
2639 if (iz==mz) {
2640 iz--;
2641 s = 1.0f;
2642 }
2643
2644 icFloatNumber ns = 1.0f - s;
2645 icFloatNumber nt = 1.0f - t;
2646 icFloatNumber nu = 1.0f - u;
2647
2648 int i;
2649 icFloatNumber *p = &m_pData[ix*n001 + iy*n010 + iz*n100];
2650
2651 //Normalize grid units
2652 icFloatNumber dF0, dF1, dF2, dF3, dF4, dF5, dF6, dF7, pv;
2653
2654 dF0 = ns* nt* nu;
2655 dF1 = ns* nt* u;
2656 dF2 = ns* t* nu;
2657 dF3 = ns* t* u;
2658 dF4 = s* nt* nu;
2659 dF5 = s* nt* u;
2660 dF6 = s* t* nu;
2661 dF7 = s* t* u;
2662
2663 for (i=0; i<m_nOutput; i++, p++) {
2664 pv = p[n000]*dF0 + p[n001]*dF1 + p[n010]*dF2 + p[n011]*dF3 +
2665 p[n100]*dF4 + p[n101]*dF5 + p[n110]*dF6 + p[n111]*dF7;
2666
2667 destPixel[i] = pv;
2668 }
2669}

References m_MaxGridPoint, m_nOutput, m_pData, n000, n001, n010, n011, n100, n101, n110, n111, and UnitClip.

Referenced by CIccMpeCLUT::Apply(), and CIccMpeSpectralCLUT::Apply().

+ Here is the caller graph for this function:

◆ Interp3dTetra()

void CIccCLUT::Interp3dTetra ( icFloatNumber destPixel,
const icFloatNumber srcPixel 
) const

Name: CIccCLUT::Interp3dTetra

Purpose: Tetrahedral interpolation function

Args: Pixel = Pixel value to be found in the CLUT. Also used to store the result.

2528{
2532
2533 icFloatNumber x = UnitClip(srcPixel[0]) * mx;
2534 icFloatNumber y = UnitClip(srcPixel[1]) * my;
2535 icFloatNumber z = UnitClip(srcPixel[2]) * mz;
2536
2540
2541 icFloatNumber v = x - ix;
2542 icFloatNumber u = y - iy;
2543 icFloatNumber t = z - iz;
2544
2545 if (ix==mx) {
2546 ix--;
2547 v = 1.0f;
2548 }
2549 if (iy==my) {
2550 iy--;
2551 u = 1.0f;
2552 }
2553 if (iz==mz) {
2554 iz--;
2555 t = 1.0f;
2556 }
2557
2558 int i;
2559 icFloatNumber *p = &m_pData[ix*n001 + iy*n010 + iz*n100];
2560
2561 //Normalize grid units
2562
2563 for (i=0; i<m_nOutput; i++, p++) {
2564 if (t<u) {
2565 if (t>v) {
2566 destPixel[i] = (p[n000] + t*(p[n110]-p[n010]) +
2567 u*(p[n010]-p[n000]) +
2568 v*(p[n111]-p[n110]));
2569 }
2570 else if (u<v) {
2571 destPixel[i] = (p[n000] + t*(p[n111]-p[n011]) +
2572 u*(p[n011]-p[n001]) +
2573 v*(p[n001]-p[n000]));
2574 }
2575 else {
2576 destPixel[i] = (p[n000] + t*(p[n111]-p[n011]) +
2577 u*(p[n010]-p[n000]) +
2578 v*(p[n011]-p[n010]));
2579 }
2580 }
2581 else {
2582 if (t<v) {
2583 destPixel[i] = (p[n000] + t*(p[n101]-p[n001]) +
2584 u*(p[n111]-p[n101]) +
2585 v*(p[n001]-p[n000]));
2586 }
2587 else if (u<v) {
2588 destPixel[i] = (p[n000] + t*(p[n100]-p[n000]) +
2589 u*(p[n111]-p[n101]) +
2590 v*(p[n101]-p[n100]));
2591 }
2592 else {
2593 destPixel[i] = (p[n000] + t*(p[n100]-p[n000]) +
2594 u*(p[n110]-p[n100]) +
2595 v*(p[n111]-p[n110]));
2596 }
2597 }
2598 }
2599}

References m_MaxGridPoint, m_nOutput, m_pData, n000, n001, n010, n011, n100, n101, n110, n111, and UnitClip.

Referenced by CIccMpeCLUT::Apply(), and CIccMpeSpectralCLUT::Apply().

+ Here is the caller graph for this function:

◆ Interp4d()

void CIccCLUT::Interp4d ( icFloatNumber destPixel,
const icFloatNumber srcPixel 
) const

Name: CIccCLUT::Interp4d

Purpose: Four dimensional interpolation function

Args: Pixel = Pixel value to be found in the CLUT. Also used to store the result.

2684{
2689
2690 icFloatNumber w = UnitClip(srcPixel[0]) * mw;
2691 icFloatNumber x = UnitClip(srcPixel[1]) * mx;
2692 icFloatNumber y = UnitClip(srcPixel[2]) * my;
2693 icFloatNumber z = UnitClip(srcPixel[3]) * mz;
2694
2699
2700 icFloatNumber v = w - iw;
2701 icFloatNumber u = x - ix;
2702 icFloatNumber t = y - iy;
2703 icFloatNumber s = z - iz;
2704
2705 if (iw==mw) {
2706 iw--;
2707 v = 1.0f;
2708 }
2709 if (ix==mx) {
2710 ix--;
2711 u = 1.0f;
2712 }
2713 if (iy==my) {
2714 iy--;
2715 t = 1.0f;
2716 }
2717 if (iz==mz) {
2718 iz--;
2719 s = 1.0f;
2720 }
2721
2722 icFloatNumber ns = 1.0f - s;
2723 icFloatNumber nt = 1.0f - t;
2724 icFloatNumber nu = 1.0f - u;
2725 icFloatNumber nv = 1.0f - v;
2726
2727 int i, j;
2728 icFloatNumber *p = &m_pData[iw*n001 + ix*n010 + iy*n100 + iz*n1000];
2729
2730 //Normalize grid units
2731 icFloatNumber dF[16], pv;
2732
2733 dF[ 0] = ns* nt* nu* nv;
2734 dF[ 1] = ns* nt* nu* v;
2735 dF[ 2] = ns* nt* u* nv;
2736 dF[ 3] = ns* nt* u* v;
2737 dF[ 4] = ns* t* nu* nv;
2738 dF[ 5] = ns* t* nu* v;
2739 dF[ 6] = ns* t* u* nv;
2740 dF[ 7] = ns* t* u* v;
2741 dF[ 8] = s* nt* nu* nv;
2742 dF[ 9] = s* nt* nu* v;
2743 dF[10] = s* nt* u* nv;
2744 dF[11] = s* nt* u* v;
2745 dF[12] = s* t* nu* nv;
2746 dF[13] = s* t* nu* v;
2747 dF[14] = s* t* u* nv;
2748 dF[15] = s* t* u* v;
2749
2750 for (i=0; i<m_nOutput; i++, p++) {
2751 for (pv=0, j=0; j<16; j++)
2752 pv += p[m_nOffset[j]] * dF[j];
2753
2754 destPixel[i] = pv;
2755 }
2756}

References m_MaxGridPoint, m_nOffset, m_nOutput, m_pData, n001, n010, n100, n1000, and UnitClip.

Referenced by CIccMpeCLUT::Apply(), and CIccMpeSpectralCLUT::Apply().

+ Here is the caller graph for this function:

◆ Interp5d()

void CIccCLUT::Interp5d ( icFloatNumber destPixel,
const icFloatNumber srcPixel 
) const

Name: CIccCLUT::Interp5d

Purpose: Five dimensional interpolation function

Args: Pixel = Pixel value to be found in the CLUT. Also used to store the result.

2770{
2776
2777 icFloatNumber g0 = UnitClip(srcPixel[0]) * m0;
2778 icFloatNumber g1 = UnitClip(srcPixel[1]) * m1;
2779 icFloatNumber g2 = UnitClip(srcPixel[2]) * m2;
2780 icFloatNumber g3 = UnitClip(srcPixel[3]) * m3;
2781 icFloatNumber g4 = UnitClip(srcPixel[4]) * m4;
2782
2788
2789 icFloatNumber s4 = g0 - ig0;
2790 icFloatNumber s3 = g1 - ig1;
2791 icFloatNumber s2 = g2 - ig2;
2792 icFloatNumber s1 = g3 - ig3;
2793 icFloatNumber s0 = g4 - ig4;
2794
2795 if (ig0==m0) {
2796 ig0--;
2797 s4 = 1.0f;
2798 }
2799 if (ig1==m1) {
2800 ig1--;
2801 s3 = 1.0f;
2802 }
2803 if (ig2==m2) {
2804 ig2--;
2805 s2 = 1.0f;
2806 }
2807 if (ig3==m3) {
2808 ig3--;
2809 s1 = 1.0f;
2810 }
2811 if (ig4==m4) {
2812 ig4--;
2813 s0 = 1.0f;
2814 }
2815
2816 icFloatNumber ns0 = 1.0f - s0;
2817 icFloatNumber ns1 = 1.0f - s1;
2818 icFloatNumber ns2 = 1.0f - s2;
2819 icFloatNumber ns3 = 1.0f - s3;
2820 icFloatNumber ns4 = 1.0f - s4;
2821
2822 int i, j;
2823 icFloatNumber *p = &m_pData[ig0*n001 + ig1*n010 + ig2*n100 + ig3*n1000 + ig4*n10000];
2824
2825 //Normalize grid units
2826 icFloatNumber dF[32], pv;
2827
2828 dF[ 0] = ns0 * ns1 * ns2 * ns3 * ns4;
2829 dF[ 1] = ns0 * ns1 * ns2 * ns3 * s4;
2830 dF[ 2] = ns0 * ns1 * ns2 * s3 * ns4;
2831 dF[ 3] = ns0 * ns1 * ns2 * s3 * s4;
2832 dF[ 4] = ns0 * ns1 * s2 * ns3 * ns4;
2833 dF[ 5] = ns0 * ns1 * s2 * ns3 * s4;
2834 dF[ 6] = ns0 * ns1 * s2 * s3 * ns4;
2835 dF[ 7] = ns0 * ns1 * s2 * s3 * s4;
2836 dF[ 8] = ns0 * s1 * ns2 * ns3 * ns4;
2837 dF[ 9] = ns0 * s1 * ns2 * ns3 * s4;
2838 dF[10] = ns0 * s1 * ns2 * s3 * ns4;
2839 dF[11] = ns0 * s1 * ns2 * s3 * s4;
2840 dF[12] = ns0 * s1 * s2 * ns3 * ns4;
2841 dF[13] = ns0 * s1 * s2 * ns3 * s4;
2842 dF[14] = ns0 * s1 * s2 * s3 * ns4;
2843 dF[15] = ns0 * s1 * s2 * s3 * s4;
2844 dF[16] = s0 * ns1 * ns2 * ns3 * ns4;
2845 dF[17] = s0 * ns1 * ns2 * ns3 * s4;
2846 dF[18] = s0 * ns1 * ns2 * s3 * ns4;
2847 dF[19] = s0 * ns1 * ns2 * s3 * s4;
2848 dF[20] = s0 * ns1 * s2 * ns3 * ns4;
2849 dF[21] = s0 * ns1 * s2 * ns3 * s4;
2850 dF[22] = s0 * ns1 * s2 * s3 * ns4;
2851 dF[23] = s0 * ns1 * s2 * s3 * s4;
2852 dF[24] = s0 * s1 * ns2 * ns3 * ns4;
2853 dF[25] = s0 * s1 * ns2 * ns3 * s4;
2854 dF[26] = s0 * s1 * ns2 * s3 * ns4;
2855 dF[27] = s0 * s1 * ns2 * s3 * s4;
2856 dF[28] = s0 * s1 * s2 * ns3 * ns4;
2857 dF[29] = s0 * s1 * s2 * ns3 * s4;
2858 dF[30] = s0 * s1 * s2 * s3 * ns4;
2859 dF[31] = s0 * s1 * s2 * s3 * s4;
2860
2861 for (i=0; i<m_nOutput; i++, p++) {
2862 for (pv=0.0, j=0; j<32; j++)
2863 pv += p[m_nOffset[j]] * dF[j];
2864
2865 destPixel[i] = pv;
2866 }
2867}

References m_MaxGridPoint, m_nOffset, m_nOutput, m_pData, n001, n010, n100, n1000, n10000, and UnitClip.

Referenced by CIccMpeCLUT::Apply(), and CIccMpeSpectralCLUT::Apply().

+ Here is the caller graph for this function:

◆ Interp6d()

void CIccCLUT::Interp6d ( icFloatNumber destPixel,
const icFloatNumber srcPixel 
) const

Name: CIccCLUT::Interp6d

Purpose: Six dimensional interpolation function

Args: Pixel = Pixel value to be found in the CLUT. Also used to store the result.

2882{
2889
2890 icFloatNumber g0 = UnitClip(srcPixel[0]) * m0;
2891 icFloatNumber g1 = UnitClip(srcPixel[1]) * m1;
2892 icFloatNumber g2 = UnitClip(srcPixel[2]) * m2;
2893 icFloatNumber g3 = UnitClip(srcPixel[3]) * m3;
2894 icFloatNumber g4 = UnitClip(srcPixel[4]) * m4;
2895 icFloatNumber g5 = UnitClip(srcPixel[5]) * m5;
2896
2903
2904 icFloatNumber s5 = g0 - ig0;
2905 icFloatNumber s4 = g1 - ig1;
2906 icFloatNumber s3 = g2 - ig2;
2907 icFloatNumber s2 = g3 - ig3;
2908 icFloatNumber s1 = g4 - ig4;
2909 icFloatNumber s0 = g5 - ig5;
2910
2911 if (ig0==m0) {
2912 ig0--;
2913 s5 = 1.0f;
2914 }
2915 if (ig1==m1) {
2916 ig1--;
2917 s4 = 1.0f;
2918 }
2919 if (ig2==m2) {
2920 ig2--;
2921 s3 = 1.0f;
2922 }
2923 if (ig3==m3) {
2924 ig3--;
2925 s2 = 1.0f;
2926 }
2927 if (ig4==m4) {
2928 ig4--;
2929 s1 = 1.0f;
2930 }
2931 if (ig5==m5) {
2932 ig5--;
2933 s0 = 1.0f;
2934 }
2935
2936 icFloatNumber ns0 = 1.0f - s0;
2937 icFloatNumber ns1 = 1.0f - s1;
2938 icFloatNumber ns2 = 1.0f - s2;
2939 icFloatNumber ns3 = 1.0f - s3;
2940 icFloatNumber ns4 = 1.0f - s4;
2941 icFloatNumber ns5 = 1.0f - s5;
2942
2943 int i, j;
2944 icFloatNumber *p = &m_pData[ig0*n001 + ig1*n010 + ig2*n100 + ig3*n1000 + ig4*n10000 + ig5*n100000];
2945
2946 //Normalize grid units
2947 icFloatNumber dF[64], pv;
2948
2949 dF[ 0] = ns0 * ns1 * ns2 * ns3 * ns4 * ns5;
2950 dF[ 1] = ns0 * ns1 * ns2 * ns3 * ns4 * s5;
2951 dF[ 2] = ns0 * ns1 * ns2 * ns3 * s4 * ns5;
2952 dF[ 3] = ns0 * ns1 * ns2 * ns3 * s4 * s5;
2953 dF[ 4] = ns0 * ns1 * ns2 * s3 * ns4 * ns5;
2954 dF[ 5] = ns0 * ns1 * ns2 * s3 * ns4 * s5;
2955 dF[ 6] = ns0 * ns1 * ns2 * s3 * s4 * ns5;
2956 dF[ 7] = ns0 * ns1 * ns2 * s3 * s4 * s5;
2957 dF[ 8] = ns0 * ns1 * s2 * ns3 * ns4 * ns5;
2958 dF[ 9] = ns0 * ns1 * s2 * ns3 * ns4 * s5;
2959 dF[10] = ns0 * ns1 * s2 * ns3 * s4 * ns5;
2960 dF[11] = ns0 * ns1 * s2 * ns3 * s4 * s5;
2961 dF[12] = ns0 * ns1 * s2 * s3 * ns4 * ns5;
2962 dF[13] = ns0 * ns1 * s2 * s3 * ns4 * s5;
2963 dF[14] = ns0 * ns1 * s2 * s3 * s4 * ns5;
2964 dF[15] = ns0 * ns1 * s2 * s3 * s4 * s5;
2965 dF[16] = ns0 * s1 * ns2 * ns3 * ns4 * ns5;
2966 dF[17] = ns0 * s1 * ns2 * ns3 * ns4 * s5;
2967 dF[18] = ns0 * s1 * ns2 * ns3 * s4 * ns5;
2968 dF[19] = ns0 * s1 * ns2 * ns3 * s4 * s5;
2969 dF[20] = ns0 * s1 * ns2 * s3 * ns4 * ns5;
2970 dF[21] = ns0 * s1 * ns2 * s3 * ns4 * s5;
2971 dF[22] = ns0 * s1 * ns2 * s3 * s4 * ns5;
2972 dF[23] = ns0 * s1 * ns2 * s3 * s4 * s5;
2973 dF[24] = ns0 * s1 * s2 * ns3 * ns4 * ns5;
2974 dF[25] = ns0 * s1 * s2 * ns3 * ns4 * s5;
2975 dF[26] = ns0 * s1 * s2 * ns3 * s4 * ns5;
2976 dF[27] = ns0 * s1 * s2 * ns3 * s4 * s5;
2977 dF[28] = ns0 * s1 * s2 * s3 * ns4 * ns5;
2978 dF[29] = ns0 * s1 * s2 * s3 * ns4 * s5;
2979 dF[30] = ns0 * s1 * s2 * s3 * s4 * ns5;
2980 dF[31] = ns0 * s1 * s2 * s3 * s4 * s5;
2981 dF[32] = s0 * ns1 * ns2 * ns3 * ns4 * ns5;
2982 dF[33] = s0 * ns1 * ns2 * ns3 * ns4 * s5;
2983 dF[34] = s0 * ns1 * ns2 * ns3 * s4 * ns5;
2984 dF[35] = s0 * ns1 * ns2 * ns3 * s4 * s5;
2985 dF[36] = s0 * ns1 * ns2 * s3 * ns4 * ns5;
2986 dF[37] = s0 * ns1 * ns2 * s3 * ns4 * s5;
2987 dF[38] = s0 * ns1 * ns2 * s3 * s4 * ns5;
2988 dF[39] = s0 * ns1 * ns2 * s3 * s4 * s5;
2989 dF[40] = s0 * ns1 * s2 * ns3 * ns4 * ns5;
2990 dF[41] = s0 * ns1 * s2 * ns3 * ns4 * s5;
2991 dF[42] = s0 * ns1 * s2 * ns3 * s4 * ns5;
2992 dF[43] = s0 * ns1 * s2 * ns3 * s4 * s5;
2993 dF[44] = s0 * ns1 * s2 * s3 * ns4 * ns5;
2994 dF[45] = s0 * ns1 * s2 * s3 * ns4 * s5;
2995 dF[46] = s0 * ns1 * s2 * s3 * s4 * ns5;
2996 dF[47] = s0 * ns1 * s2 * s3 * s4 * s5;
2997 dF[48] = s0 * s1 * ns2 * ns3 * ns4 * ns5;
2998 dF[49] = s0 * s1 * ns2 * ns3 * ns4 * s5;
2999 dF[50] = s0 * s1 * ns2 * ns3 * s4 * ns5;
3000 dF[51] = s0 * s1 * ns2 * ns3 * s4 * s5;
3001 dF[52] = s0 * s1 * ns2 * s3 * ns4 * ns5;
3002 dF[53] = s0 * s1 * ns2 * s3 * ns4 * s5;
3003 dF[54] = s0 * s1 * ns2 * s3 * s4 * ns5;
3004 dF[55] = s0 * s1 * ns2 * s3 * s4 * s5;
3005 dF[56] = s0 * s1 * s2 * ns3 * ns4 * ns5;
3006 dF[57] = s0 * s1 * s2 * ns3 * ns4 * s5;
3007 dF[58] = s0 * s1 * s2 * ns3 * s4 * ns5;
3008 dF[59] = s0 * s1 * s2 * ns3 * s4 * s5;
3009 dF[60] = s0 * s1 * s2 * s3 * ns4 * ns5;
3010 dF[61] = s0 * s1 * s2 * s3 * ns4 * s5;
3011 dF[62] = s0 * s1 * s2 * s3 * s4 * ns5;
3012 dF[63] = s0 * s1 * s2 * s3 * s4 * s5;
3013
3014 for (i=0; i<m_nOutput; i++, p++) {
3015 for (pv=0, j=0; j<64; j++)
3016 pv += p[m_nOffset[j]] * dF[j];
3017
3018 destPixel[i] = pv;
3019 }
3020}

References m_MaxGridPoint, m_nOffset, m_nOutput, m_pData, n001, n010, n100, n1000, n10000, n100000, and UnitClip.

Referenced by CIccMpeCLUT::Apply(), and CIccMpeSpectralCLUT::Apply().

+ Here is the caller graph for this function:

◆ InterpND()

void CIccCLUT::InterpND ( icFloatNumber destPixel,
const icFloatNumber srcPixel,
CIccApplyCLUT pApply 
) const

Name: CIccCLUT::InterpND

Purpose: Generic N-dimensional interpolation function

Args: Pixel = Pixel value to be found in the CLUT. Also used to store the result.

3034{
3035 icUInt32Number i,j, index = 0;
3036 icFloatNumber* df = pApply->m_df;
3037 icFloatNumber* g = pApply->m_g;
3038 icFloatNumber* s = pApply->m_s;
3039 icUInt32Number* ig = pApply->m_ig;
3040
3041 for (i=0; i<m_nInput; i++) {
3042 g[i] = UnitClip(srcPixel[i]) * m_MaxGridPoint[i];
3043 ig[i] = (icUInt32Number)g[i];
3044 s[m_nInput-1-i] = g[i] - ig[i];
3045 if (ig[i]==m_MaxGridPoint[i]) {
3046 ig[i]--;
3047 s[m_nInput-1-i] = 1.0;
3048 }
3049 index += ig[i]*m_DimSize[i];
3050 }
3051
3052 icFloatNumber *p = &m_pData[index];
3053 icFloatNumber temp[2];
3054 icFloatNumber pv;
3055 int nFlag = 0;
3056
3057 for (i=0; i<m_nNodes; i++) {
3058 df[i] = 1.0f;
3059 }
3060
3061
3062 for (i=0; i<m_nInput; i++) {
3063 temp[0] = 1.0f - s[i];
3064 temp[1] = s[i];
3065 index = m_nPower[i];
3066 for (j=0; j<m_nNodes; j++) {
3067 df[j] *= temp[nFlag];
3068 if ((j+1)%index == 0)
3069 nFlag = !nFlag;
3070 }
3071 nFlag = 0;
3072 }
3073
3074 for (i=0; i<m_nOutput; i++, p++) {
3075 for (pv=0, j=0; j<m_nNodes; j++)
3076 pv += p[m_nOffset[j]] * df[j];
3077
3078 destPixel[i] = pv;
3079 }
3080
3081}
icFloatNumber * m_df
Definition IccTagLut.h:313
icFloatNumber * m_g
Definition IccTagLut.h:313
icFloatNumber * m_s
Definition IccTagLut.h:313
icUInt32Number * m_ig
Definition IccTagLut.h:314

References CIccApplyCLUT::m_df, m_DimSize, CIccApplyCLUT::m_g, CIccApplyCLUT::m_ig, m_MaxGridPoint, m_nInput, m_nNodes, m_nOffset, m_nOutput, m_nPower, m_pData, CIccApplyCLUT::m_s, and UnitClip.

Referenced by CIccMpeCLUT::Apply(), and CIccMpeSpectralCLUT::Apply().

+ Here is the caller graph for this function:

◆ Iterate() [1/2]

void CIccCLUT::Iterate ( IIccCLUTExec pExec)

Name: CIccCLUT::Iterate

Purpose: Iterate through the CLUT to get the data and execute PixelOp

Args: pExec = pointer to the IIccCLUTExec object that implements the IIccCLUTExec::Apply() function

2070{
2071 memset(&m_fGridAdr[0], 0, sizeof(m_fGridAdr));
2072 if (m_nInput==3) {
2073 int i,j,k;
2074 icUInt32Number index=0;
2075 for (i=0; i<m_GridPoints[0]; i++) {
2076 for (j=0; j<m_GridPoints[1]; j++) {
2077 for (k=0; k<m_GridPoints[2]; k++) {
2081
2082 index = (m_DimSize[0]*i + m_DimSize[1]*j + m_DimSize[2]*k);
2083 pExec->PixelOp(m_fGridAdr, &m_pData[index]);
2084
2085 }
2086 }
2087 }
2088 }
2089 else if (m_nInput==4) {
2090 int i,j,k,l;
2091 icUInt32Number index=0;
2092 for (i=0; i<m_GridPoints[0]; i++) {
2093 for (j=0; j<m_GridPoints[1]; j++) {
2094 for (k=0; k<m_GridPoints[2]; k++) {
2095 for (l=0; l<m_GridPoints[3]; l++) {
2100
2101 index = (m_DimSize[0]*i + m_DimSize[1]*j +
2102 m_DimSize[2]*k + m_DimSize[3]*l);
2103 pExec->PixelOp(m_fGridAdr, &m_pData[index]);
2104
2105 }
2106 }
2107 }
2108 }
2109 }
2110 else
2111 SubIterate(pExec, 0, 0);
2112}
virtual void PixelOp(icFloatNumber *pGridAdr, icFloatNumber *pData)=0
icFloatNumber m_fGridAdr[16]
Definition IccTagLut.h:404
void SubIterate(IIccCLUTExec *pExec, icUInt8Number nIndex, icUInt32Number nPos)
Definition IccTagLut.cpp:2129

References m_DimSize, m_fGridAdr, m_GridPoints, m_nInput, m_pData, IIccCLUTExec::PixelOp(), and SubIterate().

Referenced by icCLUTDataToXml().

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

◆ Iterate() [2/2]

void CIccCLUT::Iterate ( std::string &  sDescription,
icUInt8Number  nIndex,
icUInt32Number  nPos,
bool  bUseLegacy = false 
)
protected

Name: CIccCLUT::Iterate

Purpose: Iterate through the CLUT to dump the data

Args: sDescription = string to concatenate data dump to, nIndex = the channel number, nPos = the current position in the CLUT

2023{
2024 if (nIndex < m_nInput) {
2025 int i;
2026 for (i=0; i<m_GridPoints[nIndex]; i++) {
2027 m_GridAdr[nIndex] = i;
2028 Iterate(sDescription, nIndex+1, nPos, bUseLegacy);
2029 nPos += m_DimSize[nIndex];
2030 }
2031 }
2032 else {
2033 icChar *ptr = m_pOutText;
2034 icFloatNumber *pData = &m_pData[nPos];
2035 int i;
2036
2037 for (i=0; i<m_nInput; i++) {
2038 icColorValue(m_pVal, (icFloatNumber)m_GridAdr[i] / (m_GridPoints[i]-1) , m_csInput, i, bUseLegacy);
2039
2040 ptr += sprintf(ptr, " %s", m_pVal);
2041 }
2042 strcpy(ptr, " ");
2043 ptr += 2;
2044
2045 for (i=0; i<m_nOutput; i++) {
2046 icColorValue(m_pVal, pData[i], m_csOutput, i, bUseLegacy);
2047
2048 ptr += sprintf(ptr, " %s", m_pVal);
2049 }
2050 strcpy(ptr, "\n");
2051 sDescription += (const icChar*)m_pOutText;
2052
2053 }
2054}

References icColorValue(), Iterate(), m_csInput, m_csOutput, m_DimSize, m_GridAdr, m_GridPoints, m_nInput, m_nOutput, m_pData, m_pOutText, and m_pVal.

Referenced by DumpLut(), and Iterate().

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

◆ MaxGridPoint()

icUInt32Number CIccCLUT::MaxGridPoint ( int  index) const
inline
352{ return m_MaxGridPoint[index]; }

References m_MaxGridPoint.

◆ NumPoints()

icUInt32Number CIccCLUT::NumPoints ( ) const
inline
348{ return (m_nNumPoints != 0) ? m_nNumPoints : 0; }

References m_nNumPoints.

Referenced by CIccCLUT(), CDevLinkWriter::begin(), CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), DumpLut(), icCLutFromXml(), Init(), main(), operator=(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeSpectralCLUT::Read(), ReadData(), CIccMpeCLUT::Write(), CIccMpeExtCLUT::Write(), CIccMpeSpectralCLUT::Write(), and WriteData().

+ Here is the caller graph for this function:

◆ operator=()

CIccCLUT & CIccCLUT::operator= ( const CIccCLUT CLUTTag)

Name: CIccCLUT::operator=

Purpose: Copy Operator

Args: CLUTTag = The CIccCLUT object to be copied

1747{
1748 if (&CLUTTag == this)
1749 return *this;
1750
1751 m_nInput = CLUTTag.m_nInput;
1752 m_nOutput = CLUTTag.m_nOutput;
1753 m_nPrecision = CLUTTag.m_nPrecision;
1754 m_nNumPoints = CLUTTag.m_nNumPoints;
1755
1756 m_csInput = CLUTTag.m_csInput;
1757 m_csOutput = CLUTTag.m_csOutput;
1758
1759 memcpy(m_GridPoints, CLUTTag.m_GridPoints, sizeof(m_GridPoints));
1760 memcpy(m_DimSize, CLUTTag.m_DimSize, sizeof(m_DimSize));
1761 memcpy(m_GridAdr, CLUTTag.m_GridAdr, sizeof(m_GridAdr));
1762 memcpy(m_nReserved2, &CLUTTag.m_nReserved2, sizeof(m_nReserved2));
1763
1764 int num;
1765 if (m_pData)
1766 delete [] m_pData;
1767 num = NumPoints()*m_nOutput;
1768 m_pData = new icFloatNumber[num];
1769 memcpy(m_pData, CLUTTag.m_pData, num*sizeof(icFloatNumber));
1770
1771 UnitClip = CLUTTag.UnitClip;
1772
1773 return *this;
1774}

References m_csInput, m_csOutput, m_DimSize, m_GridAdr, m_GridPoints, m_nInput, m_nNumPoints, m_nOutput, m_nPrecision, m_nReserved2, m_pData, NumPoints(), and UnitClip.

+ Here is the call graph for this function:

◆ operator[]()

icFloatNumber & CIccCLUT::operator[] ( int  index)
inline
346{ return m_pData[index]; }

References m_pData.

◆ Read()

bool CIccCLUT::Read ( icUInt32Number  size,
CIccIO pIO 
)

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

1970{
1971 if (size < 20)
1972 return false;
1973
1974 if (pIO->Read8(m_GridPoints, 16)!=16 ||
1975 !pIO->Read8(&m_nPrecision) ||
1976 pIO->Read8(&m_nReserved2[0], 3)!=3)
1977 return false;
1978
1979 if (!Init(m_GridPoints, size - 20, m_nPrecision))
1980 return false;
1981
1982 return ReadData(size-20, pIO, m_nPrecision);
1983}
virtual icInt32Number Read8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:104
bool ReadData(icUInt32Number size, CIccIO *pIO, icUInt8Number nPrecision)
Definition IccTagLut.cpp:1896

References Init(), m_GridPoints, m_nPrecision, m_nReserved2, CIccIO::Read8(), and ReadData().

Referenced by CIccTagLutAtoB::Read().

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

◆ ReadData()

bool CIccCLUT::ReadData ( icUInt32Number  size,
CIccIO pIO,
icUInt8Number  nPrecision 
)

Name: CIccCLUT::ReadData

Purpose: Reads the CLUT data points into the data buffer

Args: size = # of bytes in the tag, pIO = IO object to read data from, nPrecision = data precision (8bit encoded as 1 or 16bit encoded as 2)

Return: true = data read succesfully, false = read data failed

1897{
1899
1900 if (nNum * nPrecision > size)
1901 return false;
1902
1903 if (m_pData == NULL)
1904 return false;
1905
1906 if (nPrecision==1) {
1907 if (pIO->ReadUInt8Float(m_pData, nNum)!=(icInt32Number)nNum)
1908 return false;
1909 }
1910 else if (nPrecision==2) {
1911 if (pIO->ReadUInt16Float(m_pData, nNum)!=(icInt32Number)nNum)
1912 return false;
1913 }
1914 else
1915 return false;
1916
1917 return true;
1918}
long icInt32Number
Definition icProfileHeader.h:291
icInt32Number ReadUInt8Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:203
icInt32Number ReadUInt16Float(void *pBufFloat, icInt32Number nNum=1)
Definition IccIO.cpp:236

References m_nOutput, m_pData, NumPoints(), CIccIO::ReadUInt16Float(), and CIccIO::ReadUInt8Float().

Referenced by Read(), CIccTagLut8::Read(), and CIccTagLut16::Read().

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

◆ SetClipFunc()

void CIccCLUT::SetClipFunc ( icCLUTCLIPFUNC  ClipFunc)
inline
379{ UnitClip = ClipFunc; }

References UnitClip.

Referenced by CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), CIccMpeCLUT::Read(), CIccMpeExtCLUT::Read(), CIccMpeSpectralCLUT::Read(), CIccMpeCLUT::SetCLUT(), and CIccMpeSpectralCLUT::SetData().

+ Here is the caller graph for this function:

◆ SetPrecision()

void CIccCLUT::SetPrecision ( icUInt8Number  nPrecision)
inline
382{ m_nPrecision = nPrecision; }

References m_nPrecision.

Referenced by icCLutFromXml().

+ Here is the caller graph for this function:

◆ SubIterate()

void CIccCLUT::SubIterate ( IIccCLUTExec pExec,
icUInt8Number  nIndex,
icUInt32Number  nPos 
)
protected

Name: CIccCLUT::SubIterate

Purpose: Iterate through the CLUT to get the data

Args: pExec = pointer to the IIccCLUTExec object that implements the IIccCLUTExec::Apply() function, nIndex = the channel number, nPos = the current position in the CLUT

2130{
2131 if (nIndex < m_nInput) {
2132 int i;
2133 for (i=0; i<m_GridPoints[nIndex]; i++) {
2134 m_fGridAdr[nIndex] = (icFloatNumber)i/(icFloatNumber)(m_GridPoints[nIndex]-1);
2135 SubIterate(pExec, nIndex+1, nPos);
2136 nPos += m_DimSize[nIndex];
2137 }
2138 }
2139 else
2140 pExec->PixelOp(m_fGridAdr, &m_pData[nPos]);
2141}

References m_DimSize, m_fGridAdr, m_GridPoints, m_nInput, m_pData, IIccCLUTExec::PixelOp(), and SubIterate().

Referenced by Iterate(), and SubIterate().

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

◆ Validate()

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

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

3099{
3101 icSignature sig = icGetFirstSigPathSig(sigPath);
3102
3103 CIccInfo Info;
3104 std::string sSigPathName = Info.GetSigPathName(sigPath);
3105 if (m_nReserved2[0]!=0 || m_nReserved2[1]!=0 || m_nReserved2[2]!=0) {
3106 sReport += icMsgValidateNonCompliant;
3107 sReport += sSigPathName;
3108 sReport += " - Reserved Value must be zero.\n";
3109
3111 }
3112
3113 if (sig==icSigLutAtoBType || sig==icSigLutBtoAType) {
3114 char temp[256];
3115 for (int i=0; i<m_nInput; i++) {
3116 if (m_GridPoints[i]<2) {
3117 sReport += icMsgValidateCriticalError;
3118 sReport += sSigPathName;
3119 sprintf(temp, " - CLUT: At least 2 grid points should be present in dimension %u.\n",i );
3120 sReport += temp;
3122 }
3123 }
3124 }
3125
3126 return rv;
3127}
icUInt32Number icSignature
Definition icProfileHeader.h:271
@ icSigLutBtoAType
Definition icProfileHeader.h:547
@ icSigLutAtoBType
Definition icProfileHeader.h:546
icValidateStatus
Definition IccDefs.h:119
@ icValidateOK
Definition IccDefs.h:120
@ icValidateCriticalError
Definition IccDefs.h:123
@ icValidateNonCompliant
Definition IccDefs.h:122
ICCPROFLIB_API icSignature icGetFirstSigPathSig(std::string sigPath)
Definition IccUtil.cpp:1201
ICCPROFLIB_API const char * icMsgValidateCriticalError
Definition IccUtil.cpp:92
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

References CIccInfo::GetSigPathName(), icGetFirstSigPathSig(), icMaxStatus(), icMsgValidateCriticalError, icMsgValidateNonCompliant, icSigLutAtoBType, icSigLutBtoAType, icValidateCriticalError, icValidateNonCompliant, icValidateOK, m_GridPoints, m_nInput, and m_nReserved2.

Referenced by CIccMBB::Validate().

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

◆ Write()

bool CIccCLUT::Write ( CIccIO pIO)

Name: CIccCLUT::Write

Purpose: Write the tag to a file

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

Return: true = succesful, false = failure

2000{
2001 if (pIO->Write8(m_GridPoints, 16)!=16 ||
2002 !pIO->Write8(&m_nPrecision) ||
2003 pIO->Write8(&m_nReserved2[0], 3)!=3)
2004 return false;
2005
2006 return WriteData(pIO, m_nPrecision);
2007}
virtual icInt32Number Write8(void *pBuf8, icInt32Number nNum=1)
Definition IccIO.h:105
bool WriteData(CIccIO *pIO, icUInt8Number nPrecision)
Definition IccTagLut.cpp:1936

References m_GridPoints, m_nPrecision, m_nReserved2, CIccIO::Write8(), and WriteData().

Referenced by CIccTagLutAtoB::Write().

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

◆ WriteData()

bool CIccCLUT::WriteData ( CIccIO pIO,
icUInt8Number  nPrecision 
)

Name: CIccCLUT::WriteData

Purpose: Writes the CLUT data points from the data buffer

Args: pIO = IO object to write data to, nPrecision = data precision (8bit encoded as 1 or 16bit encoded as 2)

Return: true = data written succesfully, false = write operation failed

1937{
1939
1940 if (nPrecision==1) {
1941 if (pIO->WriteUInt8Float(m_pData, nNum)!=(icInt32Number)nNum)
1942 return false;
1943 }
1944 else if (nPrecision==2) {
1945 if (pIO->WriteUInt16Float(m_pData, nNum)!=(icInt32Number)nNum)
1946 return false;
1947 }
1948 else
1949 return false;
1950
1951 return true;
1952}
icInt32Number WriteUInt8Float(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:219
icInt32Number WriteUInt16Float(void *pBuf16, icInt32Number nNum=1)
Definition IccIO.cpp:252

References m_nOutput, m_pData, NumPoints(), CIccIO::WriteUInt16Float(), and CIccIO::WriteUInt8Float().

Referenced by Write(), CIccTagLut8::Write(), and CIccTagLut16::Write().

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

Field Documentation

◆ m_csInput

icColorSpaceSignature CIccCLUT::m_csInput
protected

Referenced by CIccCLUT(), DumpLut(), Iterate(), and operator=().

◆ m_csOutput

icColorSpaceSignature CIccCLUT::m_csOutput
protected

Referenced by CIccCLUT(), DumpLut(), Iterate(), and operator=().

◆ m_DimSize

icUInt32Number CIccCLUT::m_DimSize[16]
protected

◆ m_fGridAdr

icFloatNumber CIccCLUT::m_fGridAdr[16]
protected

Referenced by Iterate(), and SubIterate().

◆ m_GridAdr

icUInt8Number CIccCLUT::m_GridAdr[16]
protected

Referenced by CIccCLUT(), DumpLut(), Iterate(), and operator=().

◆ m_GridPoints

◆ m_MaxGridPoint

◆ m_nInput

◆ m_nNodes

icUInt32Number CIccCLUT::m_nNodes
protected

◆ m_nNumPoints

icUInt32Number CIccCLUT::m_nNumPoints
protected

Referenced by CIccCLUT(), Init(), NumPoints(), and operator=().

◆ m_nOffset

icUInt32Number* CIccCLUT::m_nOffset
protected

◆ m_nOutput

◆ m_nPower

icUInt32Number CIccCLUT::m_nPower[16]
protected

Referenced by Begin(), and InterpND().

◆ m_nPrecision

icUInt8Number CIccCLUT::m_nPrecision
protected

◆ m_nReserved2

icUInt8Number CIccCLUT::m_nReserved2[3]
protected

◆ m_pData

◆ m_pOutText

icChar* CIccCLUT::m_pOutText
protected

Referenced by DumpLut(), and Iterate().

◆ m_pVal

icChar * CIccCLUT::m_pVal
protected

Referenced by DumpLut(), and Iterate().

◆ n000

icUInt32Number CIccCLUT::n000
protected

◆ n001

◆ n010

icUInt32Number CIccCLUT::n010
protected

◆ n011

icUInt32Number CIccCLUT::n011
protected

◆ n100

icUInt32Number CIccCLUT::n100
protected

◆ n1000

icUInt32Number CIccCLUT::n1000
protected

Referenced by Begin(), Interp4d(), Interp5d(), and Interp6d().

◆ n10000

icUInt32Number CIccCLUT::n10000
protected

Referenced by Begin(), Interp5d(), and Interp6d().

◆ n100000

icUInt32Number CIccCLUT::n100000
protected

Referenced by Begin(), and Interp6d().

◆ n101

icUInt32Number CIccCLUT::n101
protected

Referenced by Begin(), Interp3d(), and Interp3dTetra().

◆ n110

icUInt32Number CIccCLUT::n110
protected

Referenced by Begin(), Interp3d(), and Interp3dTetra().

◆ n111

icUInt32Number CIccCLUT::n111
protected

Referenced by Begin(), Interp3d(), and Interp3dTetra().

◆ UnitClip


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