01758 {
01759
MEMPTR lpOldMem;
01760
SINT i, j;
01761
double TempMatrixABC[9];
01762
MEMPTR lpTable;
01763
MEMPTR lpLineStart;
01764 lpOldMem = lpMem;
01765
01766
01767 lpMem +=
WriteNewLineObject (lpMem, RangeABCTag);
01768 lpMem +=
WriteObject (lpMem, RangeABC);
01769
01770 lpMem +=
WriteNewLineObject (lpMem, MatrixABCTag);
01771
if (
pcs ==
icSigXYZData)
01772 {
01773 lpMem +=
WriteObject (lpMem, BeginArray);
01774
if (e)
01775 {
01776
for (i = 0; i < 3; i++)
01777 {
01778
for (j = 0; j < 3; j++)
01779 {
01780 lpMem +=
WriteFloat (lpMem, e[i + j * 3]);
01781 }
01782 }
01783 }
01784
else
01785 {
01786
if (LutTag ==
icSigLut8Type)
01787 {
01788 lpTable = (
MEMPTR) & ((
lpcpLut8Type) Buff)->lut.e00;
01789 }
else
01790 {
01791 lpTable = (
MEMPTR) & ((
lpcpLut16Type) Buff)->lut.e00;
01792 }
01793
for (i = 0; i < 9; i++)
01794 {
01795 TempMatrixABC[i] = ((
double)
si16f16toSFLOAT (lpTable)) /
CIEXYZRange;
01796 lpTable +=
sizeof (
icS15Fixed16Number);
01797 }
01798
for (i = 0; i < 3; i++)
01799 {
01800
for (j = 0; j < 3; j++)
01801 {
01802 lpMem +=
WriteFloat (lpMem, TempMatrixABC[i + j * 3]);
01803 }
01804 }
01805 }
01806 lpMem +=
WriteObject (lpMem, EndArray);
01807 }
else
01808 {
01809 lpMem +=
WriteObject (lpMem, MatrixABCLabCRD);
01810 }
01811
01812
if (nInputCh == 0)
01813
return (
SINT)(lpMem - lpOldMem);
01814
01815 lpLineStart = lpMem;
01816 lpMem +=
WriteNewLineObject (lpMem, EncodeABCTag);
01817 lpMem +=
WriteObject (lpMem, BeginArray);
01818
for (i = 0; i < nInputCh; i++)
01819 {
01820 lpLineStart = lpMem;
01821 lpMem +=
WriteNewLineObject (lpMem, BeginFunction);
01822
if (
pcs ==
icSigLabData)
01823 {
01824 lpMem +=
WriteObject (lpMem,
01825 (0 == i) ? EncodeABCLab1 : EncodeABCLab2);
01826 }
01827 lpMem +=
WriteObject (lpMem, StartClip);
01828
if (e)
01829 lpMem +=
WriteObject (lpMem, PreViewInArray);
01830
else
01831 lpMem +=
WriteObject (lpMem, InputArray);
01832 lpMem +=
WriteObjectN (lpMem, (MEMPTR) PublicArrayName, lstrlen (PublicArrayName));
01833 lpMem +=
WriteInt (lpMem, i);
01834
01835
if (!bAllowBinary)
01836 {
01837 lpMem +=
WriteNewLineObject (lpMem, IndexArray);
01838 }
else
01839 {
01840
if (LutTag ==
icSigLut8Type)
01841 {
01842 lpMem +=
WriteObject (lpMem, IndexArray);
01843 }
else
01844 {
01845 lpMem +=
WriteObject (lpMem, IndexArray16b);
01846 }
01847 }
01848 lpMem +=
WriteObject (lpMem, (LutTag == icSigLut8Type) ?
01849 Scale8 : Scale16);
01850 lpMem +=
WriteObject (lpMem, EndClip);
01851 lpMem +=
WriteObject (lpMem, EndFunction);
01852 }
01853 lpMem +=
WriteObject (lpMem, EndArray);
01854
return (
SINT)(lpMem - lpOldMem);
01855 }