Home | History | Annotate | Download | only in src

Lines Matching defs:lut

104 // This function is quite useful to analyze the structure of a LUT and retrieve the MPE elements
105 // that conform the LUT. It should be called with the LUT, the number of expected elements and
110 cmsBool CMSEXPORT cmsPipelineCheckAndRetreiveStages(const cmsPipeline* Lut, cmsUInt32Number n, ...)
119 if (cmsPipelineStageCount(Lut) != n) return FALSE;
124 mpe = Lut ->Elements;
138 mpe = Lut ->Elements;
619 // Our resulting LUT would be same gridpoints on all dimensions
636 // Our resulting LUT would be same gridpoints on all dimensions
1260 void BlessLUT(cmsPipeline* lut)
1263 if (lut ->Elements != NULL) {
1267 First = cmsPipelineGetPtrToFirstStage(lut);
1268 Last = cmsPipelineGetPtrToLastStage(lut);
1270 if (First != NULL)lut ->InputChannels = First ->InputChannels;
1271 if (Last != NULL) lut ->OutputChannels = Last ->OutputChannels;
1276 // Default to evaluate the LUT on 16 bit-basis. Precision is retained.
1280 cmsPipeline* lut = (cmsPipeline*) D;
1285 From16ToFloat(In, &Storage[Phase][0], lut ->InputChannels);
1287 for (mpe = lut ->Elements;
1297 FromFloatTo16(&Storage[Phase][0], Out, lut ->OutputChannels);
1302 // Does evaluate the LUT on cmsFloat32Number-basis.
1306 cmsPipeline* lut = (cmsPipeline*) D;
1311 memmove(&Storage[Phase][0], In, lut ->InputChannels * sizeof(cmsFloat32Number));
1313 for (mpe = lut ->Elements;
1322 memmove(Out, &Storage[Phase][0], lut ->OutputChannels * sizeof(cmsFloat32Number));
1328 // LUT Creation & Destruction
1356 cmsContext CMSEXPORT cmsGetPipelineContextID(const cmsPipeline* lut)
1358 _cmsAssert(lut != NULL);
1359 return lut ->ContextID;
1362 cmsUInt32Number CMSEXPORT cmsPipelineInputChannels(const cmsPipeline* lut)
1364 _cmsAssert(lut != NULL);
1365 return lut ->InputChannels;
1368 cmsUInt32Number CMSEXPORT cmsPipelineOutputChannels(const cmsPipeline* lut)
1370 _cmsAssert(lut != NULL);
1371 return lut ->OutputChannels;
1374 // Free a profile elements LUT
1375 void CMSEXPORT cmsPipelineFree(cmsPipeline* lut)
1379 if (lut == NULL) return;
1381 for (mpe = lut ->Elements;
1389 if (lut ->FreeDataFn) lut ->FreeDataFn(lut ->ContextID, lut ->Data);
1391 _cmsFree(lut ->ContextID, lut);
1395 // Default to evaluate the LUT on 16 bit-basis.
1396 void CMSEXPORT cmsPipelineEval16(const cmsUInt16Number In[], cmsUInt16Number Out[], const cmsPipeline* lut)
1398 _cmsAssert(lut != NULL);
1399 lut ->Eval16Fn(In, Out, lut->Data);
1403 // Does evaluate the LUT on cmsFloat32Number-basis.
1404 void CMSEXPORT cmsPipelineEvalFloat(const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsPipeline* lut)
1406 _cmsAssert(lut != NULL);
1407 lut ->EvalFloatFn(In, Out, lut);
1412 // Duplicates a LUT
1413 cmsPipeline* CMSEXPORT cmsPipelineDup(const cmsPipeline* lut)
1419 if (lut == NULL) return NULL;
1421 NewLUT = cmsPipelineAlloc(lut ->ContextID, lut ->InputChannels, lut ->OutputChannels);
1424 for (mpe = lut ->Elements;
1446 NewLUT ->Eval16Fn = lut ->Eval16Fn;
1447 NewLUT ->EvalFloatFn = lut ->EvalFloatFn;
1448 NewLUT ->DupDataFn = lut ->DupDataFn;
1449 NewLUT ->FreeDataFn = lut ->FreeDataFn;
1452 NewLUT ->Data = NewLUT ->DupDataFn(lut ->ContextID, lut->Data);
1455 NewLUT ->SaveAs8Bits = lut ->SaveAs8Bits;
1462 int CMSEXPORT cmsPipelineInsertStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage* mpe)
1466 if (lut == NULL || mpe == NULL)
1472 mpe ->Next = lut ->Elements;
1473 lut ->Elements = mpe;
1478 if (lut ->Elements == NULL)
1479 lut ->Elements = mpe;
1482 for (pt = lut ->Elements;
1494 BlessLUT(lut);
1499 void CMSEXPORT cmsPipelineUnlinkStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage** mpe)
1505 // If empty LUT, there is nothing to remove
1506 if (lut ->Elements == NULL) {
1516 cmsStage* elem = lut ->Elements;
1518 lut ->Elements = elem -> Next;
1527 for (pt = lut ->Elements;
1540 lut ->Elements = NULL;
1550 BlessLUT(lut);
1554 // Concatenate two LUT into a new single one
1581 cmsBool CMSEXPORT cmsPipelineSetSaveAs8bitsFlag(cmsPipeline* lut, cmsBool On)
1583 cmsBool Anterior = lut ->SaveAs8Bits;
1585 lut ->SaveAs8Bits = On;
1590 cmsStage* CMSEXPORT cmsPipelineGetPtrToFirstStage(const cmsPipeline* lut)
1592 return lut ->Elements;
1595 cmsStage* CMSEXPORT cmsPipelineGetPtrToLastStage(const cmsPipeline* lut)
1599 for (mpe = lut ->Elements; mpe != NULL; mpe = mpe ->Next)
1605 cmsUInt32Number CMSEXPORT cmsPipelineStageCount(const cmsPipeline* lut)
1610 for (n=0, mpe = lut ->Elements; mpe != NULL; mpe = mpe ->Next)
1617 // duplicator and free functions should also be specified in order to duplicate the LUT construct. Use NULL to inhibit such functionality.
1618 void CMSEXPORT _cmsPipelineSetOptimizationParameters(cmsPipeline* Lut,
1625 Lut ->Eval16Fn = Eval16;
1626 Lut ->DupDataFn = DupPrivateDataFn;
1627 Lut ->FreeDataFn = FreePrivateDataFn;
1628 Lut ->Data = PrivateData;
1688 // Evaluate a LUT in reverse direction. It only searches on 3->3 LUT. Uses Newton method
1692 // lut: The LUT on where to do the search
1700 const cmsPipeline* lut)
1709 if (lut ->InputChannels != 3 && lut ->InputChannels != 4) return FALSE;
1710 if (lut ->OutputChannels != 3) return FALSE;
1725 // If Lut is 4-dimensions, then grab target[3], which is fixed
1726 if (lut ->InputChannels == 4) {
1736 cmsPipelineEvalFloat(x, fx, lut);
1747 for (j=0; j < lut ->InputChannels; j++)
1764 cmsPipelineEvalFloat(xd, fxd, lut);