Lines Matching defs:mpe
64 const cmsStage *mpe)
66 memmove(Out, In, mpe ->InputChannels * sizeof(cmsFloat32Number));
104 // This function is quite useful to analyze the structure of a LUT and retrieve the MPE elements
106 // then a list of expected types followed with a list of cmsFloat64Number pointers to MPE elements. If
114 cmsStage* mpe;
124 mpe = Lut ->Elements;
129 if (mpe ->Type != Type) {
134 mpe = mpe ->Next;
138 mpe = Lut ->Elements;
143 *ElemPtr = mpe;
145 mpe = mpe ->Next;
159 cmsToneCurve** _cmsStageGetPtrToCurveSet(const cmsStage* mpe)
161 _cmsStageToneCurvesData* Data = (_cmsStageToneCurvesData*) mpe ->Data;
169 const cmsStage *mpe)
174 _cmsAssert(mpe != NULL);
176 Data = (_cmsStageToneCurvesData*) mpe ->Data;
187 void CurveSetElemTypeFree(cmsStage* mpe)
192 _cmsAssert(mpe != NULL);
194 Data = (_cmsStageToneCurvesData*) mpe ->Data;
203 _cmsFree(mpe ->ContextID, Data ->TheCurves);
204 _cmsFree(mpe ->ContextID, Data);
209 void* CurveSetDup(cmsStage* mpe)
211 _cmsStageToneCurvesData* Data = (_cmsStageToneCurvesData*) mpe ->Data;
215 NewElem = (_cmsStageToneCurvesData*) _cmsMallocZero(mpe ->ContextID, sizeof(_cmsStageToneCurvesData));
219 NewElem ->TheCurves = (cmsToneCurve**) _cmsCalloc(mpe ->ContextID, NewElem ->nCurves, sizeof(cmsToneCurve*));
241 _cmsFree(mpe ->ContextID, NewElem ->TheCurves);
242 _cmsFree(mpe ->ContextID, NewElem);
297 cmsStage* mpe = cmsStageAllocToneCurves(ContextID, nChannels, NULL);
299 if (mpe == NULL) return NULL;
300 mpe ->Implements = cmsSigIdentityElemType;
301 return mpe;
314 const cmsStage *mpe)
317 _cmsStageMatrixData* Data = (_cmsStageMatrixData*) mpe ->Data;
321 for (i=0; i < mpe ->OutputChannels; i++) {
324 for (j=0; j < mpe->InputChannels; j++) {
325 Tmp += In[j] * Data->Double[i*mpe->InputChannels + j];
341 void* MatrixElemDup(cmsStage* mpe)
343 _cmsStageMatrixData* Data = (_cmsStageMatrixData*) mpe ->Data;
347 NewElem = (_cmsStageMatrixData*) _cmsMallocZero(mpe ->ContextID, sizeof(_cmsStageMatrixData));
350 sz = mpe ->InputChannels * mpe ->OutputChannels;
352 NewElem ->Double = (cmsFloat64Number*) _cmsDupMem(mpe ->ContextID, Data ->Double, sz * sizeof(cmsFloat64Number)) ;
355 NewElem ->Offset = (cmsFloat64Number*) _cmsDupMem(mpe ->ContextID,
356 Data ->Offset, mpe -> OutputChannels * sizeof(cmsFloat64Number)) ;
363 void MatrixElemTypeFree(cmsStage* mpe)
365 _cmsStageMatrixData* Data = (_cmsStageMatrixData*) mpe ->Data;
369 _cmsFree(mpe ->ContextID, Data ->Double);
372 _cmsFree(mpe ->ContextID, Data ->Offset);
374 _cmsFree(mpe ->ContextID, mpe ->Data);
441 void EvaluateCLUTfloat(const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage *mpe)
443 _cmsStageCLutData* Data = (_cmsStageCLutData*) mpe ->Data;
451 void EvaluateCLUTfloatIn16(const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage *mpe)
453 _cmsStageCLutData* Data = (_cmsStageCLutData*) mpe ->Data;
456 _cmsAssert(mpe ->InputChannels <= MAX_STAGE_CHANNELS);
457 _cmsAssert(mpe ->OutputChannels <= MAX_STAGE_CHANNELS);
459 FromFloatTo16(In, In16, mpe ->InputChannels);
461 From16ToFloat(Out16, Out, mpe ->OutputChannels);
488 void* CLUTElemDup(cmsStage* mpe)
490 _cmsStageCLutData* Data = (_cmsStageCLutData*) mpe ->Data;
494 NewElem = (_cmsStageCLutData*) _cmsMallocZero(mpe ->ContextID, sizeof(_cmsStageCLutData));
503 NewElem ->Tab.TFloat = (cmsFloat32Number*) _cmsDupMem(mpe ->ContextID, Data ->Tab.TFloat, Data ->nEntries * sizeof (cmsFloat32Number));
507 NewElem ->Tab.T = (cmsUInt16Number*) _cmsDupMem(mpe ->ContextID, Data ->Tab.T, Data ->nEntries * sizeof (cmsUInt16Number));
513 NewElem ->Params = _cmsComputeInterpParamsEx(mpe ->ContextID,
524 _cmsFree(mpe ->ContextID, NewElem -> Tab.T);
525 _cmsFree(mpe ->ContextID, NewElem);
531 void CLutElemTypeFree(cmsStage* mpe)
534 _cmsStageCLutData* Data = (_cmsStageCLutData*) mpe ->Data;
541 _cmsFree(mpe ->ContextID, Data -> Tab.T);
544 _cmsFree(mpe ->ContextID, mpe ->Data);
714 // Creates an MPE that just copies input to output
718 cmsStage* mpe ;
724 mpe = cmsStageAllocCLut16bitGranular(ContextID, Dimensions, nChan, nChan, NULL);
725 if (mpe == NULL) return NULL;
727 if (!cmsStageSampleCLut16bit(mpe, IdentitySampler, &nChan, 0)) {
728 cmsStageFree(mpe);
732 mpe ->Implements = cmsSigIdentityElemType;
733 return mpe;
750 cmsBool CMSEXPORT cmsStageSampleCLut16bit(cmsStage* mpe, cmsSAMPLER16 Sampler, void * Cargo, cmsUInt32Number dwFlags)
758 if (mpe == NULL) return FALSE;
760 clut = (_cmsStageCLutData*) mpe->Data;
812 cmsBool CMSEXPORT cmsStageSampleCLutFloat(cmsStage* mpe, cmsSAMPLERFLOAT Sampler, void * Cargo, cmsUInt32Number dwFlags)
818 _cmsStageCLutData* clut = (_cmsStageCLutData*) mpe->Data;
939 const cmsStage *mpe)
960 cmsUNUSED_PARAMETER(mpe);
980 cmsStage* mpe;
1005 mpe = cmsStageAllocToneCurves(ContextID, 3, LabTable);
1008 if (mpe == NULL) return NULL;
1009 mpe ->Implements = cmsSigLabV2toV4;
1010 return mpe;
1023 cmsStage *mpe = cmsStageAllocMatrix(ContextID, 3, 3, V2ToV4, NULL);
1025 if (mpe == NULL) return mpe;
1026 mpe ->Implements = cmsSigLabV2toV4;
1027 return mpe;
1039 cmsStage *mpe = cmsStageAllocMatrix(ContextID, 3, 3, V4ToV2, NULL);
1041 if (mpe == NULL) return mpe;
1042 mpe ->Implements = cmsSigLabV4toV2;
1043 return mpe;
1047 // To Lab to float. Note that the MPE gives numbers in normal Lab range
1066 cmsStage *mpe = cmsStageAllocMatrix(ContextID, 3, 3, a1, o1);
1068 if (mpe == NULL) return mpe;
1069 mpe ->Implements = cmsSigLab2FloatPCS;
1070 return mpe;
1084 cmsStage *mpe = cmsStageAllocMatrix(ContextID, 3, 3, a1, NULL);
1086 if (mpe == NULL) return mpe;
1087 mpe ->Implements = cmsSigXYZ2FloatPCS;
1088 return mpe;
1105 cmsStage *mpe = cmsStageAllocMatrix(ContextID, 3, 3, a1, o1);
1106 if (mpe == NULL) return mpe;
1107 mpe ->Implements = cmsSigFloatPCS2Lab;
1108 return mpe;
1122 cmsStage *mpe = cmsStageAllocMatrix(ContextID, 3, 3, a1, NULL);
1123 if (mpe == NULL) return mpe;
1124 mpe ->Implements = cmsSigFloatPCS2XYZ;
1125 return mpe;
1130 void Clipper(const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage *mpe)
1133 for (i = 0; i < mpe->InputChannels; i++) {
1151 void EvaluateXYZ2Lab(const cmsFloat32Number In[], cmsFloat32Number Out[], const cmsStage *mpe)
1172 cmsUNUSED_PARAMETER(mpe);
1198 // Free a single MPE
1199 void CMSEXPORT cmsStageFree(cmsStage* mpe)
1201 if (mpe ->FreePtr)
1202 mpe ->FreePtr(mpe);
1204 _cmsFree(mpe ->ContextID, mpe);
1208 cmsUInt32Number CMSEXPORT cmsStageInputChannels(const cmsStage* mpe)
1210 return mpe ->InputChannels;
1213 cmsUInt32Number CMSEXPORT cmsStageOutputChannels(const cmsStage* mpe)
1215 return mpe ->OutputChannels;
1218 cmsStageSignature CMSEXPORT cmsStageType(const cmsStage* mpe)
1220 return mpe -> Type;
1223 void* CMSEXPORT cmsStageData(const cmsStage* mpe)
1225 return mpe -> Data;
1228 cmsStage* CMSEXPORT cmsStageNext(const cmsStage* mpe)
1230 return mpe -> Next;
1234 // Duplicates an MPE
1235 cmsStage* CMSEXPORT cmsStageDup(cmsStage* mpe)
1239 if (mpe == NULL) return NULL;
1240 NewMPE = _cmsStageAllocPlaceholder(mpe ->ContextID,
1241 mpe ->Type,
1242 mpe ->InputChannels,
1243 mpe ->OutputChannels,
1244 mpe ->EvalPtr,
1245 mpe ->DupElemPtr,
1246 mpe ->FreePtr,
1250 NewMPE ->Implements = mpe ->Implements;
1252 if (mpe ->DupElemPtr) {
1254 NewMPE ->Data = mpe ->DupElemPtr(mpe);
1315 cmsStage *mpe;
1321 for (mpe = lut ->Elements;
1322 mpe != NULL;
1323 mpe = mpe ->Next) {
1326 mpe ->EvalPtr(&Storage[Phase][0], &Storage[NextPhase][0], mpe);
1341 cmsStage *mpe;
1347 for (mpe = lut ->Elements;
1348 mpe != NULL;
1349 mpe = mpe ->Next) {
1352 mpe ->EvalPtr(&Storage[Phase][0], &Storage[NextPhase][0], mpe);
1416 cmsStage *mpe, *Next;
1420 for (mpe = lut ->Elements;
1421 mpe != NULL;
1422 mpe = Next) {
1424 Next = mpe ->Next;
1425 cmsStageFree(mpe);
1455 cmsStage *NewMPE, *Anterior = NULL, *mpe;
1463 for (mpe = lut ->Elements;
1464 mpe != NULL;
1465 mpe = mpe ->Next) {
1467 NewMPE = cmsStageDup(mpe);
1507 int CMSEXPORT cmsPipelineInsertStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage* mpe)
1511 if (lut == NULL || mpe == NULL)
1517 mpe ->Next = lut ->Elements;
1518 lut ->Elements = mpe;
1524 lut ->Elements = mpe;
1531 Anterior ->Next = mpe;
1532 mpe ->Next = NULL;
1543 void CMSEXPORT cmsPipelineUnlinkStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage** mpe)
1551 if (mpe) *mpe = NULL;
1589 if (mpe)
1590 *mpe = Unlinked;
1602 cmsStage* mpe;
1612 for (mpe = l2 ->Elements;
1613 mpe != NULL;
1614 mpe = mpe ->Next) {
1617 if (!cmsPipelineInsertStage(l1, cmsAT_END, cmsStageDup(mpe)))
1641 cmsStage *mpe, *Anterior = NULL;
1643 for (mpe = lut ->Elements; mpe != NULL; mpe = mpe ->Next)
1644 Anterior = mpe;
1651 cmsStage *mpe;
1654 for (n=0, mpe = lut ->Elements; mpe != NULL; mpe = mpe ->Next)