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

Class: CIccCLUT. More...

#include <IccTagLut.h>

+ Collaboration diagram for CIccCLUT:

Public Member Functions

void Begin ()
 Name: CIccCLUT::Begin.
 
 CIccCLUT (const CIccCLUT &ICLUT)
 Name: CIccCLUT::CIccCLUT.
 
 CIccCLUT (icUInt8Number nInputChannels, icUInt16Number nOutputChannels, icUInt8Number nPrecision=2)
 Name: CIccCLUT::CIccCLUT.
 
void DumpLut (std::string &sDescription, const icChar *szName, icColorSpaceSignature csInput, icColorSpaceSignature csOutput, int nVerboseness, bool bUseLegacy=false)
 Name: CIccCLUT::DumpLut.
 
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)
 Name: CIccCLUT::Init.
 
bool Init (icUInt8Number nGridPoints, icUInt32Number nMaxSize=0, icUInt8Number nBytesPerPoint=4)
 Name: CIccCLUT::Init.
 
void Interp1d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 Name: CIccCLUT::Interp1d.
 
void Interp2d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 Name: CIccCLUT::Interp2d.
 
void Interp3d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 Name: CIccCLUT::Interp3d.
 
void Interp3dTetra (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 Name: CIccCLUT::Interp3dTetra.
 
void Interp4d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 Name: CIccCLUT::Interp4d.
 
void Interp5d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 Name: CIccCLUT::Interp5d.
 
void Interp6d (icFloatNumber *destPixel, const icFloatNumber *srcPixel) const
 Name: CIccCLUT::Interp6d.
 
void InterpND (icFloatNumber *destPixel, const icFloatNumber *srcPixel, CIccApplyCLUT *pApply) const
 Name: CIccCLUT::InterpND.
 
void Iterate (IIccCLUTExec *pExec)
 Name: CIccCLUT::Iterate.
 
icUInt32Number MaxGridPoint (int index) const
 
icUInt32Number NumPoints () const
 
CIccCLUToperator= (const CIccCLUT &CLUTClass)
 Name: CIccCLUT::operator=.
 
icFloatNumberoperator[] (int index)
 
bool Read (icUInt32Number size, CIccIO *pIO)
 Name: CIccCLUT::Read.
 
bool ReadData (icUInt32Number size, CIccIO *pIO, icUInt8Number nPrecision)
 Name: CIccCLUT::ReadData.
 
void SetClipFunc (icCLUTCLIPFUNC ClipFunc)
 
void SetPrecision (icUInt8Number nPrecision)
 
icValidateStatus Validate (std::string sigPath, std::string &sReport, const CIccProfile *pProfile=NULL) const
 Name: CIccCLUT::Validate.
 
bool Write (CIccIO *pIO)
 Name: CIccCLUT::Write.
 
bool WriteData (CIccIO *pIO, icUInt8Number nPrecision)
 Name: CIccCLUT::WriteData.
 
virtual ~CIccCLUT ()
 Name: CIccCLUT::~CIccCLUT.
 

Protected Member Functions

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

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

Definition at line 325 of file IccTagLut.h.

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

Definition at line 1685 of file IccTagLut.cpp.

1686{
1687 m_nInput = nInputChannels;
1688 m_nOutput = nOutputChannels;
1689 m_nPrecision = nPrecision;
1690 m_pData = NULL;
1691 m_nOffset = NULL;
1692 memset(&m_nReserved2, 0 , sizeof(m_nReserved2));
1693
1695}
static icFloatNumber ClutUnitClip(icFloatNumber v)
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(), and UnitClip().

+ Here is the call 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

Definition at line 1708 of file IccTagLut.cpp.

1709{
1710 m_pData = NULL;
1711 m_nOffset = NULL;
1712 m_nInput = ICLUT.m_nInput;
1713 m_nOutput = ICLUT.m_nOutput;
1714 m_nPrecision = ICLUT.m_nPrecision;
1715 m_nNumPoints = ICLUT.m_nNumPoints;
1716
1717 m_csInput = ICLUT.m_csInput;
1718 m_csOutput = ICLUT.m_csOutput;
1719
1720 memcpy(m_GridPoints, ICLUT.m_GridPoints, sizeof(m_GridPoints));
1721 memcpy(m_DimSize, ICLUT.m_DimSize, sizeof(m_DimSize));
1722 memcpy(m_GridAdr, ICLUT.m_GridAdr, sizeof(m_GridAdr));
1723 memcpy(&m_nReserved2, &ICLUT.m_nReserved2, sizeof(m_nReserved2));
1724
1725 int num = NumPoints()*m_nOutput;
1726 m_pData = new icFloatNumber[num];
1727 memcpy(m_pData, ICLUT.m_pData, num*sizeof(icFloatNumber));
1728
1729 UnitClip = ICLUT.UnitClip;
1730}
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
Definition IccDefs.h:100
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_nOutput, m_nPrecision, m_nReserved2, m_pData, UnitClip, and UnitClip().

+ Here is the call graph for this function:

◆ ~CIccCLUT()

CIccCLUT::~CIccCLUT ( )
virtual

Name: CIccCLUT::~CIccCLUT.

Purpose: Destructor

Definition at line 1783 of file IccTagLut.cpp.

1784{
1785 if (m_pData)
1786 delete [] m_pData;
1787
1788 if (m_nOffset)
1789 delete [] m_nOffset;
1790
1791}

Member Function Documentation

◆ Begin()

void CIccCLUT::Begin ( )

Name: CIccCLUT::Begin.

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

Definition at line 2218 of file IccTagLut.cpp.

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

Referenced by 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)

Definition at line 2154 of file IccTagLut.cpp.

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

References icColorIndexName(), icColorValue(), and szName.

Referenced by CIccMpeExtCLUT::Describe().

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

◆ GetData()

icFloatNumber * CIccCLUT::GetData ( int index)
inline

Definition at line 347 of file IccTagLut.h.

347{ return &m_pData[index]; }

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

+ Here is the caller graph for this function:

◆ GetDimSize()

icUInt32Number CIccCLUT::GetDimSize ( icUInt8Number nIndex) const
inline

Definition at line 354 of file IccTagLut.h.

354{ return m_DimSize[nIndex]; }

◆ GetInputDim()

icUInt8Number CIccCLUT::GetInputDim ( ) const
inline

Definition at line 356 of file IccTagLut.h.

356{ return m_nInput; }

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

+ Here is the caller graph for this function:

◆ GetNewApply()

CIccApplyCLUT * CIccCLUT::GetNewApply ( )

Definition at line 2400 of file IccTagLut.cpp.

2401{
2402 CIccApplyCLUT* rv = new CIccApplyCLUT();
2403
2404 if (!rv)
2405 return NULL;
2406
2407 if (!rv->Init(m_nInput, m_nNodes)) {
2408 delete rv;
2409 return NULL;
2410 }
2411
2412 return rv;
2413}
Class: CIccApplyCLUT.
Definition IccTagLut.h:302
bool Init(icUInt8Number nSrcChannels, icUInt32Number nNodes)
Name: CIccApplyCLUT::Init.

References CIccApplyCLUT::Init().

+ Here is the call graph for this function:

◆ GetNumOffset()

icUInt32Number CIccCLUT::GetNumOffset ( ) const
inline

Definition at line 359 of file IccTagLut.h.

359{ return m_nNodes; }

◆ GetOffset()

icUInt32Number CIccCLUT::GetOffset ( int index) const
inline

Definition at line 360 of file IccTagLut.h.

360{ return m_nOffset ? m_nOffset[index] : 0; }

◆ GetOutputChannels()

icUInt16Number CIccCLUT::GetOutputChannels ( ) const
inline

Definition at line 357 of file IccTagLut.h.

357{ return 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

Definition at line 381 of file IccTagLut.h.

381{ return m_nPrecision; }

Referenced by icCLUTDataToXml().

+ Here is the caller graph for this function:

◆ GridPoint()

icUInt8Number CIccCLUT::GridPoint ( int index) const
inline

Definition at line 350 of file IccTagLut.h.

350{ return m_GridPoints[index]; }

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

+ Here is the caller graph for this function:

◆ GridPointArray()

const icUInt8Number * CIccCLUT::GridPointArray ( ) const
inline

Definition at line 351 of file IccTagLut.h.

351{return &m_GridPoints[0]; }

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

+ Here is the caller graph for this function:

◆ GridPoints()

icUInt8Number CIccCLUT::GridPoints ( ) const
inline

Definition at line 349 of file IccTagLut.h.

349{ return m_GridPoints[0]; }

Referenced by CIccEvalCompare::EvaluateProfile(), CIccTagLut16::Write(), and CIccTagLut8::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

Definition at line 1823 of file IccTagLut.cpp.

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

◆ 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

Definition at line 1803 of file IccTagLut.cpp.

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

Referenced by CIccMpeEmissionCLUT::Begin(), CIccMpeReflectanceCLUT::Begin(), CDevLinkWriter::begin(), icCLutFromXml(), main(), CIccMpeExtCLUT::Read(), CIccTagLut16::Read(), and CIccTagLut8::Read().

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

Definition at line 2425 of file IccTagLut.cpp.

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

References UnitClip().

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

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

Definition at line 2469 of file IccTagLut.cpp.

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

References UnitClip().

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

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

Definition at line 2610 of file IccTagLut.cpp.

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

References UnitClip().

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

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

Definition at line 2524 of file IccTagLut.cpp.

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

References UnitClip().

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

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

Definition at line 2680 of file IccTagLut.cpp.

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

References UnitClip().

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

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

Definition at line 2766 of file IccTagLut.cpp.

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

References UnitClip().

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

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

Definition at line 2878 of file IccTagLut.cpp.

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

References UnitClip().

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

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

Definition at line 3030 of file IccTagLut.cpp.

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

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

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

Definition at line 2066 of file IccTagLut.cpp.

2067{
2068 memset(&m_fGridAdr[0], 0, sizeof(m_fGridAdr));
2069 if (m_nInput==3) {
2070 int i,j,k;
2071 icUInt32Number index=0;
2072 for (i=0; i<m_GridPoints[0]; i++) {
2073 for (j=0; j<m_GridPoints[1]; j++) {
2074 for (k=0; k<m_GridPoints[2]; k++) {
2078
2079 index = (m_DimSize[0]*i + m_DimSize[1]*j + m_DimSize[2]*k);
2080 pExec->PixelOp(m_fGridAdr, &m_pData[index]);
2081
2082 }
2083 }
2084 }
2085 }
2086 else if (m_nInput==4) {
2087 int i,j,k,l;
2088 icUInt32Number index=0;
2089 for (i=0; i<m_GridPoints[0]; i++) {
2090 for (j=0; j<m_GridPoints[1]; j++) {
2091 for (k=0; k<m_GridPoints[2]; k++) {
2092 for (l=0; l<m_GridPoints[3]; l++) {
2097
2098 index = (m_DimSize[0]*i + m_DimSize[1]*j +
2099 m_DimSize[2]*k + m_DimSize[3]*l);
2100 pExec->PixelOp(m_fGridAdr, &m_pData[index]);
2101
2102 }
2103 }
2104 }
2105 }
2106 }
2107 else
2108 SubIterate(pExec, 0, 0);
2109}
icFloatNumber m_fGridAdr[16]
Definition IccTagLut.h:404
void SubIterate(IIccCLUTExec *pExec, icUInt8Number nIndex, icUInt32Number nPos)
Name: CIccCLUT::SubIterate.
virtual void PixelOp(icFloatNumber *pGridAdr, icFloatNumber *pData)=0

References IIccCLUTExec::PixelOp().

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

Definition at line 2019 of file IccTagLut.cpp.

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

References icColorValue().

+ Here is the call graph for this function:

◆ MaxGridPoint()

icUInt32Number CIccCLUT::MaxGridPoint ( int index) const
inline

Definition at line 352 of file IccTagLut.h.

352{ return m_MaxGridPoint[index]; }

◆ NumPoints()

icUInt32Number CIccCLUT::NumPoints ( ) const
inline

Definition at line 348 of file IccTagLut.h.

348{ return m_nNumPoints; }

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

+ 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

Definition at line 1743 of file IccTagLut.cpp.

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

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

+ Here is the call graph for this function:

◆ operator[]()

icFloatNumber & CIccCLUT::operator[] ( int index)
inline

Definition at line 346 of file IccTagLut.h.

346{ return m_pData[index]; }

◆ 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

Definition at line 1966 of file IccTagLut.cpp.

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

References CIccIO::Read8().

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

Definition at line 1893 of file IccTagLut.cpp.

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

References CIccIO::ReadUInt16Float(), and CIccIO::ReadUInt8Float().

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

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

◆ SetClipFunc()

void CIccCLUT::SetClipFunc ( icCLUTCLIPFUNC ClipFunc)
inline

Definition at line 379 of file IccTagLut.h.

379{ UnitClip = ClipFunc; }

References UnitClip().

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

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

◆ SetPrecision()

void CIccCLUT::SetPrecision ( icUInt8Number nPrecision)
inline

Definition at line 382 of file IccTagLut.h.

382{ m_nPrecision = 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

Definition at line 2126 of file IccTagLut.cpp.

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

References IIccCLUTExec::PixelOp().

+ Here is the call 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.

Definition at line 3095 of file IccTagLut.cpp.

3096{
3099
3100 CIccInfo Info;
3101 std::string sSigPathName = Info.GetSigPathName(sigPath);
3102 if (m_nReserved2[0]!=0 || m_nReserved2[1]!=0 || m_nReserved2[2]!=0) {
3103 sReport += icMsgValidateNonCompliant;
3104 sReport += sSigPathName;
3105 sReport += " - Reserved Value must be zero.\n";
3106
3108 }
3109
3111 char temp[256];
3112 for (int i=0; i<m_nInput; i++) {
3113 if (m_GridPoints[i]<2) {
3114 sReport += icMsgValidateCriticalError;
3115 sReport += sSigPathName;
3116 sprintf(temp, " - CLUT: At least 2 grid points should be present in dimension %u.\n",i );
3117 sReport += temp;
3119 }
3120 }
3121 }
3122
3123 return rv;
3124}
icArraySignature sig
icValidateStatus
Definition IccDefs.h:118
@ icValidateOK
Definition IccDefs.h:119
@ icValidateCriticalError
Definition IccDefs.h:122
@ icValidateNonCompliant
Definition IccDefs.h:121
icValidateStatus icMaxStatus(icValidateStatus s1, icValidateStatus s2)
Name: icMaxStatus.
Definition IccUtil.cpp:244
const char * icMsgValidateNonCompliant
Definition IccUtil.cpp:91
const char * icMsgValidateCriticalError
Definition IccUtil.cpp:92
icSignature icGetFirstSigPathSig(std::string sigPath)
Definition IccUtil.cpp:1201
Type: Class.
Definition IccUtil.h:303
std::string GetSigPathName(std::string sigPath)
Definition IccUtil.cpp:1614
icUInt32Number icSignature
@ icSigLutBtoAType
@ icSigLutAtoBType

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

+ Here is the call 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

Definition at line 1996 of file IccTagLut.cpp.

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

References CIccIO::Write8().

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

Definition at line 1933 of file IccTagLut.cpp.

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

References CIccIO::WriteUInt16Float(), and CIccIO::WriteUInt8Float().

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

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

Member Data Documentation

◆ m_csInput

icColorSpaceSignature CIccCLUT::m_csInput
protected

Definition at line 406 of file IccTagLut.h.

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

◆ m_csOutput

icColorSpaceSignature CIccCLUT::m_csOutput
protected

Definition at line 406 of file IccTagLut.h.

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

◆ m_DimSize

icUInt32Number CIccCLUT::m_DimSize[16]
protected

Definition at line 399 of file IccTagLut.h.

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

◆ m_fGridAdr

icFloatNumber CIccCLUT::m_fGridAdr[16]
protected

Definition at line 404 of file IccTagLut.h.

◆ m_GridAdr

icUInt8Number CIccCLUT::m_GridAdr[16]
protected

Definition at line 403 of file IccTagLut.h.

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

◆ m_GridPoints

icUInt8Number CIccCLUT::m_GridPoints[16]
protected

Definition at line 396 of file IccTagLut.h.

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

◆ m_MaxGridPoint

icUInt8Number CIccCLUT::m_MaxGridPoint[16]
protected

Definition at line 409 of file IccTagLut.h.

◆ m_nInput

icUInt8Number CIccCLUT::m_nInput
protected

Definition at line 392 of file IccTagLut.h.

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

◆ m_nNodes

icUInt32Number CIccCLUT::m_nNodes
protected

Definition at line 414 of file IccTagLut.h.

◆ m_nNumPoints

icUInt32Number CIccCLUT::m_nNumPoints
protected

Definition at line 397 of file IccTagLut.h.

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

◆ m_nOffset

icUInt32Number* CIccCLUT::m_nOffset
protected

Definition at line 413 of file IccTagLut.h.

◆ m_nOutput

icUInt16Number CIccCLUT::m_nOutput
protected

Definition at line 393 of file IccTagLut.h.

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

◆ m_nPower

icUInt32Number CIccCLUT::m_nPower[16]
protected

Definition at line 414 of file IccTagLut.h.

◆ m_nPrecision

icUInt8Number CIccCLUT::m_nPrecision
protected

Definition at line 394 of file IccTagLut.h.

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

◆ m_nReserved2

icUInt8Number CIccCLUT::m_nReserved2[3]
protected

Definition at line 390 of file IccTagLut.h.

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

◆ m_pData

icFloatNumber* CIccCLUT::m_pData
protected

Definition at line 400 of file IccTagLut.h.

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

◆ m_pOutText

icChar* CIccCLUT::m_pOutText
protected

Definition at line 405 of file IccTagLut.h.

◆ m_pVal

icChar * CIccCLUT::m_pVal
protected

Definition at line 405 of file IccTagLut.h.

◆ n000

icUInt32Number CIccCLUT::n000
protected

Definition at line 410 of file IccTagLut.h.

◆ n001

icUInt32Number CIccCLUT::n001
protected

Definition at line 410 of file IccTagLut.h.

◆ n010

icUInt32Number CIccCLUT::n010
protected

Definition at line 410 of file IccTagLut.h.

◆ n011

icUInt32Number CIccCLUT::n011
protected

Definition at line 410 of file IccTagLut.h.

◆ n100

icUInt32Number CIccCLUT::n100
protected

Definition at line 410 of file IccTagLut.h.

◆ n1000

icUInt32Number CIccCLUT::n1000
protected

Definition at line 410 of file IccTagLut.h.

◆ n10000

icUInt32Number CIccCLUT::n10000
protected

Definition at line 410 of file IccTagLut.h.

◆ n100000

icUInt32Number CIccCLUT::n100000
protected

Definition at line 410 of file IccTagLut.h.

◆ n101

icUInt32Number CIccCLUT::n101
protected

Definition at line 410 of file IccTagLut.h.

◆ n110

icUInt32Number CIccCLUT::n110
protected

Definition at line 410 of file IccTagLut.h.

◆ n111

icUInt32Number CIccCLUT::n111
protected

Definition at line 410 of file IccTagLut.h.

◆ UnitClip

icCLUTCLIPFUNC CIccCLUT::UnitClip
protected

Definition at line 388 of file IccTagLut.h.

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


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