From 9491825ddff7a294d1f49061bae7044e426aeb2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 6 Nov 2015 05:38:49 +0100 Subject: Imported Upstream version 1.8.3 --- icc/ClayRGB1998.icm | Bin icc/EBU3213_PAL.icm | Bin icc/Jamfile | 0 icc/License.txt | 0 icc/Makefile | 0 icc/Makefile.IBMNT | 0 icc/Makefile.OSX | 0 icc/Makefile.UNIX | 0 icc/Makefile.WNT | 0 icc/ProPhoto.icm | Bin icc/ProPhotoLin.icm | Bin icc/Readme.txt | 0 icc/Rec2020.icm | Bin icc/Rec709.icm | Bin icc/SMPTE431_P3.icm | Bin icc/SMPTE_RP145_NTSC.icm | Bin icc/afiles | 0 icc/icc.c | 53 ++++++++++++++++++++++++++++++++++++++++++++--- icc/icc.h | 3 +++ icc/iccV42.h | 0 icc/iccdump.c | 0 icc/icclu.c | 0 icc/iccrw.c | 0 icc/iccstd.c | 0 icc/icctest.c | 0 icc/lab2lab.icm | Bin icc/log.txt | 0 icc/lutest.c | 0 icc/mcheck.c | 0 icc/mkDispProf.c | 0 icc/sRGB.icm | Bin icc/testDE2K.c | 0 icc/todo.txt | 0 33 files changed, 53 insertions(+), 3 deletions(-) mode change 100644 => 100755 icc/ClayRGB1998.icm mode change 100644 => 100755 icc/EBU3213_PAL.icm mode change 100644 => 100755 icc/Jamfile mode change 100644 => 100755 icc/License.txt mode change 100644 => 100755 icc/Makefile mode change 100644 => 100755 icc/Makefile.IBMNT mode change 100644 => 100755 icc/Makefile.OSX mode change 100644 => 100755 icc/Makefile.UNIX mode change 100644 => 100755 icc/Makefile.WNT mode change 100644 => 100755 icc/ProPhoto.icm mode change 100644 => 100755 icc/ProPhotoLin.icm mode change 100644 => 100755 icc/Readme.txt mode change 100644 => 100755 icc/Rec2020.icm mode change 100644 => 100755 icc/Rec709.icm mode change 100644 => 100755 icc/SMPTE431_P3.icm mode change 100644 => 100755 icc/SMPTE_RP145_NTSC.icm mode change 100644 => 100755 icc/afiles mode change 100644 => 100755 icc/icc.c mode change 100644 => 100755 icc/icc.h mode change 100644 => 100755 icc/iccV42.h mode change 100644 => 100755 icc/iccdump.c mode change 100644 => 100755 icc/icclu.c mode change 100644 => 100755 icc/iccrw.c mode change 100644 => 100755 icc/iccstd.c mode change 100644 => 100755 icc/icctest.c mode change 100644 => 100755 icc/lab2lab.icm mode change 100644 => 100755 icc/log.txt mode change 100644 => 100755 icc/lutest.c mode change 100644 => 100755 icc/mcheck.c mode change 100644 => 100755 icc/mkDispProf.c mode change 100644 => 100755 icc/sRGB.icm mode change 100644 => 100755 icc/testDE2K.c mode change 100644 => 100755 icc/todo.txt (limited to 'icc') diff --git a/icc/ClayRGB1998.icm b/icc/ClayRGB1998.icm old mode 100644 new mode 100755 diff --git a/icc/EBU3213_PAL.icm b/icc/EBU3213_PAL.icm old mode 100644 new mode 100755 diff --git a/icc/Jamfile b/icc/Jamfile old mode 100644 new mode 100755 diff --git a/icc/License.txt b/icc/License.txt old mode 100644 new mode 100755 diff --git a/icc/Makefile b/icc/Makefile old mode 100644 new mode 100755 diff --git a/icc/Makefile.IBMNT b/icc/Makefile.IBMNT old mode 100644 new mode 100755 diff --git a/icc/Makefile.OSX b/icc/Makefile.OSX old mode 100644 new mode 100755 diff --git a/icc/Makefile.UNIX b/icc/Makefile.UNIX old mode 100644 new mode 100755 diff --git a/icc/Makefile.WNT b/icc/Makefile.WNT old mode 100644 new mode 100755 diff --git a/icc/ProPhoto.icm b/icc/ProPhoto.icm old mode 100644 new mode 100755 diff --git a/icc/ProPhotoLin.icm b/icc/ProPhotoLin.icm old mode 100644 new mode 100755 diff --git a/icc/Readme.txt b/icc/Readme.txt old mode 100644 new mode 100755 diff --git a/icc/Rec2020.icm b/icc/Rec2020.icm old mode 100644 new mode 100755 diff --git a/icc/Rec709.icm b/icc/Rec709.icm old mode 100644 new mode 100755 diff --git a/icc/SMPTE431_P3.icm b/icc/SMPTE431_P3.icm old mode 100644 new mode 100755 diff --git a/icc/SMPTE_RP145_NTSC.icm b/icc/SMPTE_RP145_NTSC.icm old mode 100644 new mode 100755 diff --git a/icc/afiles b/icc/afiles old mode 100644 new mode 100755 diff --git a/icc/icc.c b/icc/icc.c old mode 100644 new mode 100755 index 92611c3..d5b72ce --- a/icc/icc.c +++ b/icc/icc.c @@ -13401,6 +13401,13 @@ void icmMul3(double out[3], double in1[3], double in2[3]) { out[2] = in1[2] * in2[2]; } +/* Take absolute of a 3 vector */ +void icmAbs3(double out[3], double in[3]) { + out[0] = fabs(in[0]); + out[1] = fabs(in[1]); + out[2] = fabs(in[2]); +} + /* - - - - - - - - - - - - - - - - - - - - - - - - */ /* Set a 3x3 matrix to unity */ @@ -13837,6 +13844,11 @@ void icmRotMat(double m[3][3], double s[3], double t[3]) { /* If the two input vectors are close to being parallel, */ /* then h will be close to zero. */ if (fabs(h) < 1e-12) { + + /* Make sure scale is the correct sign */ + if (s[0] * t[0] + s[1] * t[1] + s[2] * t[2] < 0.0) + tl = -tl; + m[0][0] = tl/sl; m[0][1] = 0.0; m[0][2] = 0.0; @@ -13860,6 +13872,19 @@ void icmRotMat(double m[3][3], double s[3], double t[3]) { m[2][1] = tl/sl * (h * v[1] * v[2] + v[0]); m[2][2] = tl/sl * (e + h * v[2] * v[2]); } + +#ifdef NEVER /* Check result */ + { + double tt[3]; + + icmMulBy3x3(tt, m, s); + + if (icmLabDEsq(t, tt) > 1e-4) { + printf("icmRotMat error t, is %f %f %f\n",tt[0],tt[1],tt[2]); + printf(" should be %f %f %f\n",t[0],t[1],t[2]); + } + } +#endif /* NEVER */ } /* - - - - - - - - - - - - - - - - - - - - - - - - */ @@ -13908,9 +13933,9 @@ void icmMul3By3x4(double out[3], double mat[3][4], double in[3]) { /* "Real-Time Rendering". */ /* s0 -> s1 is source vector, t0 -> t1 is target vector. */ /* Usage of icmRotMat: */ -/* t[0] == mat[0][0] * s[0] + mat[0][1] * s[1] + mat[0][2] * s[2] + mat[0][3]; */ -/* t[1] == mat[1][0] * s[0] + mat[1][1] * s[1] + mat[1][2] * s[2] + mat[1][3]; */ -/* t[2] == mat[2][0] * s[0] + mat[2][1] * s[1] + mat[2][2] * s[2] + mat[2][3]; */ +/* t[0] = mat[0][0] * s[0] + mat[0][1] * s[1] + mat[0][2] * s[2] + mat[0][3]; */ +/* t[1] = mat[1][0] * s[0] + mat[1][1] * s[1] + mat[1][2] * s[2] + mat[1][3]; */ +/* t[2] = mat[2][0] * s[0] + mat[2][1] * s[1] + mat[2][2] * s[2] + mat[2][3]; */ /* i.e. use icmMul3By3x4 */ void icmVecRotMat(double m[3][4], double s1[3], double s0[3], double t1[3], double t0[3]) { int i, j; @@ -13939,6 +13964,26 @@ void icmVecRotMat(double m[3][4], double s1[3], double s0[3], double t1[3], doub m[j][i] = 0.0; } } + +#ifdef NEVER /* Check result */ + { + double tt0[3], tt1[3]; + + icmMul3By3x4(tt0, m, s0); + + if (icmLabDEsq(t0, tt0) > 1e-4) { + printf("icmVecRotMat error t0, is %f %f %f\n",tt0[0],tt0[1],tt0[2]); + printf(" should be %f %f %f\n",t0[0],t0[1],t0[2]); + } + + icmMul3By3x4(tt1, m, s1); + + if (icmLabDEsq(t1, tt1) > 1e-4) { + printf("icmVecRotMat error t1, is %f %f %f\n",tt1[0],tt1[1],tt1[2]); + printf(" should be %f %f %f\n",t1[0],t1[1],t1[2]); + } + } +#endif /* NEVER */ } /* - - - - - - - - - - - - - - - - - - - - - - - - */ @@ -15314,6 +15359,8 @@ int icmClipXYZ(double out[3], double in[3]) { /* --------------------------------------------------------------- */ /* Some video specific functions */ +/* Should add ST.2048 log functions */ + /* Convert Lut table index/value to YPbPr */ /* (Same as Lut_Lut2YPbPr() ) */ void icmLut2YPbPr(double *out, double *in) { diff --git a/icc/icc.h b/icc/icc.h old mode 100644 new mode 100755 index 4eba0ec..36ec73a --- a/icc/icc.h +++ b/icc/icc.h @@ -1754,6 +1754,9 @@ void icmMul3(double out[3], double in1[3], double in2[3]); #define ICMMUL3(o, i, j) ((o)[0] = (i)[0] * (j)[0], (o)[1] = (i)[1] * (j)[1], (o)[2] = (i)[2] * (j)[2]) +/* Take absolute of a 3 vector */ +void icmAbs3(double out[3], double in[3]); + /* Compute the dot product of two 3 vectors */ double icmDot3(double in1[3], double in2[3]); diff --git a/icc/iccV42.h b/icc/iccV42.h old mode 100644 new mode 100755 diff --git a/icc/iccdump.c b/icc/iccdump.c old mode 100644 new mode 100755 diff --git a/icc/icclu.c b/icc/icclu.c old mode 100644 new mode 100755 diff --git a/icc/iccrw.c b/icc/iccrw.c old mode 100644 new mode 100755 diff --git a/icc/iccstd.c b/icc/iccstd.c old mode 100644 new mode 100755 diff --git a/icc/icctest.c b/icc/icctest.c old mode 100644 new mode 100755 diff --git a/icc/lab2lab.icm b/icc/lab2lab.icm old mode 100644 new mode 100755 diff --git a/icc/log.txt b/icc/log.txt old mode 100644 new mode 100755 diff --git a/icc/lutest.c b/icc/lutest.c old mode 100644 new mode 100755 diff --git a/icc/mcheck.c b/icc/mcheck.c old mode 100644 new mode 100755 diff --git a/icc/mkDispProf.c b/icc/mkDispProf.c old mode 100644 new mode 100755 diff --git a/icc/sRGB.icm b/icc/sRGB.icm old mode 100644 new mode 100755 diff --git a/icc/testDE2K.c b/icc/testDE2K.c old mode 100644 new mode 100755 diff --git a/icc/todo.txt b/icc/todo.txt old mode 100644 new mode 100755 -- cgit v1.2.3