798 if (nOutputs <= 0) return FALSE;
799 if (nInputs > MAX_INPUT_DIMENSIONS) return FALSE;
800 if (nOutputs >= MAX_STAGE_CHANNELS) return FALSE;
801
802 nTotalPoints = CubeSize(nSamples, nInputs);
803 if (nTotalPoints == 0) return FALSE;
804
805 index = 0;
806 for (i = 0; i < nTotalPoints; i++) {
807
808 rest = i;
809 for (t = nInputs-1; t >=0; --t) {
810
811 cmsUInt32Number Colorant = rest % nSamples[t];
812
813 rest /= nSamples[t];
814
815 In[t] = _cmsQuantizeVal(Colorant, nSamples[t]);
816 }
817
818 if (clut ->Tab.T != NULL) {
819 for (t=0; t < nOutputs; t++)
820 Out[t] = clut->Tab.T[index + t];
821 }
822
823 if (!Sampler(In, Out, Cargo))
824 return FALSE;
825
826 if (!(dwFlags & SAMPLER_INSPECT)) {
827
828 if (clut ->Tab.T != NULL) {
829 for (t=0; t < nOutputs; t++)
830 clut->Tab.T[index + t] = Out[t];
831 }
832 }
833
834 index += nOutputs;
835 }
836
837 return TRUE;
838 }
839
840 // Same as anterior, but for floting point
|
798 if (nOutputs <= 0) return FALSE;
799 if (nInputs > MAX_INPUT_DIMENSIONS) return FALSE;
800 if (nOutputs >= MAX_STAGE_CHANNELS) return FALSE;
801
802 nTotalPoints = CubeSize(nSamples, nInputs);
803 if (nTotalPoints == 0) return FALSE;
804
805 index = 0;
806 for (i = 0; i < nTotalPoints; i++) {
807
808 rest = i;
809 for (t = nInputs-1; t >=0; --t) {
810
811 cmsUInt32Number Colorant = rest % nSamples[t];
812
813 rest /= nSamples[t];
814
815 In[t] = _cmsQuantizeVal(Colorant, nSamples[t]);
816 }
817
818 for (t=0; t < nOutputs; t++) {
819 if (clut ->Tab.T != NULL) {
820 Out[t] = clut->Tab.T[index + t];
821 } else {
822 Out[t] = 0;
823 }
824 }
825
826 if (!Sampler(In, Out, Cargo))
827 return FALSE;
828
829 if (!(dwFlags & SAMPLER_INSPECT)) {
830
831 if (clut ->Tab.T != NULL) {
832 for (t=0; t < nOutputs; t++)
833 clut->Tab.T[index + t] = Out[t];
834 }
835 }
836
837 index += nOutputs;
838 }
839
840 return TRUE;
841 }
842
843 // Same as anterior, but for floting point
|