OLD | NEW |
1 //------------------------------------------------------------------------------
--- | 1 //------------------------------------------------------------------------------
--- |
2 // | 2 // |
3 // Little Color Management System | 3 // Little Color Management System |
4 // Copyright (c) 1998-2012 Marti Maria Saguer | 4 // Copyright (c) 1998-2012 Marti Maria Saguer |
5 // | 5 // |
6 // Permission is hereby granted, free of charge, to any person obtaining | 6 // Permission is hereby granted, free of charge, to any person obtaining |
7 // a copy of this software and associated documentation files (the "Software"), | 7 // a copy of this software and associated documentation files (the "Software"), |
8 // to deal in the Software without restriction, including without limitation | 8 // to deal in the Software without restriction, including without limitation |
9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, | 9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, |
10 // and/or sell copies of the Software, and to permit persons to whom the Softwar
e | 10 // and/or sell copies of the Software, and to permit persons to whom the Softwar
e |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 } | 1272 } |
1273 } | 1273 } |
1274 | 1274 |
1275 | 1275 |
1276 // Default to evaluate the LUT on 16 bit-basis. Precision is retained. | 1276 // Default to evaluate the LUT on 16 bit-basis. Precision is retained. |
1277 static | 1277 static |
1278 void _LUTeval16(register const cmsUInt16Number In[], register cmsUInt16Number Ou
t[], register const void* D) | 1278 void _LUTeval16(register const cmsUInt16Number In[], register cmsUInt16Number Ou
t[], register const void* D) |
1279 { | 1279 { |
1280 cmsPipeline* lut = (cmsPipeline*) D; | 1280 cmsPipeline* lut = (cmsPipeline*) D; |
1281 cmsStage *mpe; | 1281 cmsStage *mpe; |
1282 cmsFloat32Number Storage[2][MAX_STAGE_CHANNELS]; | 1282 cmsFloat32Number Storage[2][MAX_STAGE_CHANNELS] = {0.0f}; |
1283 int Phase = 0, NextPhase; | 1283 int Phase = 0, NextPhase; |
1284 | 1284 |
1285 From16ToFloat(In, &Storage[Phase][0], lut ->InputChannels); | 1285 From16ToFloat(In, &Storage[Phase][0], lut ->InputChannels); |
1286 | 1286 |
1287 for (mpe = lut ->Elements; | 1287 for (mpe = lut ->Elements; |
1288 mpe != NULL; | 1288 mpe != NULL; |
1289 mpe = mpe ->Next) { | 1289 mpe = mpe ->Next) { |
1290 | 1290 |
1291 NextPhase = Phase ^ 1; | 1291 NextPhase = Phase ^ 1; |
1292 mpe ->EvalPtr(&Storage[Phase][0], &Storage[NextPhase][0], mpe); | 1292 mpe ->EvalPtr(&Storage[Phase][0], &Storage[NextPhase][0], mpe); |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1784 // Some clipping.... | 1784 // Some clipping.... |
1785 for (j=0; j < 3; j++) { | 1785 for (j=0; j < 3; j++) { |
1786 if (x[j] < 0) x[j] = 0; | 1786 if (x[j] < 0) x[j] = 0; |
1787 else | 1787 else |
1788 if (x[j] > 1.0) x[j] = 1.0; | 1788 if (x[j] > 1.0) x[j] = 1.0; |
1789 } | 1789 } |
1790 } | 1790 } |
1791 | 1791 |
1792 return TRUE; | 1792 return TRUE; |
1793 } | 1793 } |
OLD | NEW |