00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
#undef LH_DATA_IN_TYPE
00015
#undef LH_DATA_OUT_TYPE
00016
#undef LH_LUT_DATA_TYPE
00017
#undef LH_DATA_IN_COUNT
00018
#undef LH_DATA_OUT_COUNT
00019
#undef LH_DATA_SHR
00020
#undef LH_DATA_SHR_CORR
00021
#undef LH_LUT_DATA_SHR
00022
#undef LH_BIT_BREIT_INTERNAL
00023
#if LH_DATA_IN_SIZE_16
00024
#define LH_DATA_IN_TYPE LH_UINT16
00025
#else
00026 #define LH_DATA_IN_TYPE LH_UINT8
00027
#endif
00028
#if LH_DATA_OUT_SIZE_16
00029
#define LH_DATA_OUT_TYPE LH_UINT16
00030
#else
00031 #define LH_DATA_OUT_TYPE LH_UINT8
00032
#endif
00033
#if LH_LUT_DATA_SIZE_16
00034
#define LH_BIT_BREIT_INTERNAL 16
00035
#define LH_LUT_DATA_TYPE LH_UINT16
00036
#else
00037 #define LH_BIT_BREIT_INTERNAL 10
00038 #define LH_LUT_DATA_TYPE LH_UINT8
00039
#endif
00040
00041
#if LH_DATA_IN_COUNT_4
00042
#define LH_DATA_IN_COUNT 4
00043
#else
00044 #define LH_DATA_IN_COUNT 3
00045
#endif
00046
00047
#if LH_DATA_OUT_COUNT_4
00048
#define LH_DATA_OUT_COUNT 4
00049
#else
00050 #define LH_DATA_OUT_COUNT 3
00051
#endif
00052
00053 #define LH_BIT_MASKE_ADR (((1<<LH_BIT_BREIT_ADR)-1)<< (LH_BIT_BREIT_INTERNAL-LH_BIT_BREIT_ADR))
00054 #define LH_BIT_BREIT_SELEKTOR (LH_BIT_BREIT_INTERNAL-LH_BIT_BREIT_ADR)
00055 #define LH_BIT_MASKE_SELEKTOR ((1<<LH_BIT_BREIT_SELEKTOR)-1)
00056
00057 #define LH_ADR_BEREICH_SEL (1<<LH_BIT_BREIT_SELEKTOR)
00058
00059
#if LH_LUT_DATA_SIZE_16
00060
#define LH_DATA_SHR (16-LH_ADR_BREIT_AUS_LUT)
00061
#define LH_DATA_SHR_CORR 0
00062
#define LH_LUT_DATA_SHR 16
00063
#else
00064 #define LH_DATA_SHR (LH_ADR_BREIT_AUS_LUT-8)
00065 #define LH_LUT_DATA_SHR 8
00066
#endif
00067
00068
#if LH_DATA_IN_COUNT_4
00069
{
00070
00071
LH_UINT32 ein_regY;
00072
LH_UINT32 ein_regM;
00073
LH_UINT32 ein_regC;
00074
LH_UINT32 ein_regK;
00075
LH_DATA_IN_TYPE ein_cache[4];
00076
LH_LUT_DATA_TYPE * paNewVal0;
00077
00078
LH_UINT8 Mode;
00079
LH_UINT32 PixelCount, LineCount, i, j;
00080
long inputOffset,outputOffset;
00081
LH_DATA_IN_TYPE * input0 = (
LH_DATA_IN_TYPE *)calcParam->inputData[0];
00082
LH_DATA_IN_TYPE * input1 = (
LH_DATA_IN_TYPE *)calcParam->inputData[1];
00083
LH_DATA_IN_TYPE * input2 = (
LH_DATA_IN_TYPE *)calcParam->inputData[2];
00084
LH_DATA_IN_TYPE * input3 = (
LH_DATA_IN_TYPE *)calcParam->inputData[3];
00085
LH_DATA_IN_TYPE * input4 = (
LH_DATA_IN_TYPE *)calcParam->inputData[4];
00086
00087
LH_DATA_OUT_TYPE * output0 = (
LH_DATA_OUT_TYPE *)calcParam->outputData[0];
00088
LH_DATA_OUT_TYPE * output1 = (
LH_DATA_OUT_TYPE *)calcParam->outputData[1];
00089
LH_DATA_OUT_TYPE * output2 = (
LH_DATA_OUT_TYPE *)calcParam->outputData[2];
00090
LH_DATA_OUT_TYPE * output3 = (
LH_DATA_OUT_TYPE *)calcParam->outputData[3];
00091
LH_DATA_OUT_TYPE * output4 = (
LH_DATA_OUT_TYPE *)calcParam->outputData[4];
00092
00093
LH_UINT16 * My_InputLut = (
LH_UINT16 *)lutParam->inputLut;
00094
LH_LUT_DATA_TYPE * My_OutputLut = (
LH_LUT_DATA_TYPE *)lutParam->outputLut;
00095
LH_LUT_DATA_TYPE * My_ColorLut = (
LH_LUT_DATA_TYPE *)lutParam->colorLut;
00096
00097
LH_DATA_OUT_TYPE Mask = (
LH_DATA_OUT_TYPE)-1;
00098
00099
#ifdef DEBUG_OUTPUT
00100
CMError err =
noErr;
00101
#endif
00102
LH_START_PROC(
LH_CALC_PROC_NAME)
00103
00104 #
if LH_DATA_IN_SIZE_16
00105 inputOffset = (
long)calcParam->cmInputPixelOffset / 2;
00106
#else
00107
inputOffset = (
long)calcParam->cmInputPixelOffset;
00108
#endif
00109
#if LH_DATA_OUT_SIZE_16
00110
outputOffset = (
long)calcParam->cmOutputPixelOffset / 2;
00111
#else
00112
outputOffset = (
long)calcParam->cmOutputPixelOffset;
00113
#endif
00114
00115
if (calcParam->clearMask)
00116 Mask = 0;
00117 Mode =
LH_CALC_ENGINE_UNDEF_MODE;
00118
00119
00120
if ((calcParam->cmInputPixelOffset * calcParam->cmPixelPerLine == calcParam->cmInputBytesPerLine) && (calcParam->cmOutputPixelOffset * calcParam->cmPixelPerLine == calcParam->cmOutputBytesPerLine))
00121 {
00122 PixelCount = calcParam->cmPixelPerLine * calcParam->cmLineCount;
00123 LineCount = 1;
00124 }
00125
else
00126 {
00127 PixelCount = calcParam->cmPixelPerLine;
00128 LineCount = calcParam->cmLineCount;
00129 }
00130
if (calcParam->copyAlpha )
00131 {
00132 Mode =
LH_CALC_ENGINE_U_TO_U;
00133 }
00134
else
00135 {
00136
if (calcParam->clearMask)
00137 Mode =
LH_CALC_ENGINE_P_TO_U;
00138
else
00139 Mode =
LH_CALC_ENGINE_P_TO_P;
00140 }
00141
00142 j = 0;
00143
while (LineCount)
00144 {
00145 i = PixelCount;
00146
while (i)
00147 {
00148
#if LH_LUT_DATA_SIZE_16
00149
#if LH_DATA_OUT_SIZE_16
00150
register LH_UINT32 ko;
00151
register LH_UINT32 aVal;
00152
#endif
00153
#endif
00154
#if LH_DATA_IN_SIZE_16
00155
ein_regC = My_InputLut[((ein_cache[0]=*input0)>>( 16-
LH_ADR_BREIT_EIN_LUT )) + ( 0 <<
LH_ADR_BREIT_EIN_LUT )];
00156 ein_regC += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00157 ein_regM = My_InputLut[((ein_cache[1]=*input1)>>( 16-
LH_ADR_BREIT_EIN_LUT )) + ( 1 <<
LH_ADR_BREIT_EIN_LUT )];
00158 ein_regM += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00159 ein_regY = My_InputLut[((ein_cache[2]=*input2)>>( 16-
LH_ADR_BREIT_EIN_LUT )) + ( 2 <<
LH_ADR_BREIT_EIN_LUT )];
00160 ein_regY += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00161 ein_regK = My_InputLut[((ein_cache[3]=*input3)>>( 16-
LH_ADR_BREIT_EIN_LUT )) + ( 3 <<
LH_ADR_BREIT_EIN_LUT )];
00162 ein_regK += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00163
#else
00164
ein_regC = My_InputLut[(ein_cache[0]=*input0) + ( 0 <<
LH_ADR_BREIT_EIN_LUT )];
00165 ein_regC += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00166 ein_regM = My_InputLut[(ein_cache[1]=*input1) + ( 1 <<
LH_ADR_BREIT_EIN_LUT )];
00167 ein_regM += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00168 ein_regY = My_InputLut[(ein_cache[2]=*input2) + ( 2 <<
LH_ADR_BREIT_EIN_LUT )];
00169 ein_regY += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00170 ein_regK = My_InputLut[(ein_cache[3]=*input3) + ( 3 <<
LH_ADR_BREIT_EIN_LUT )];
00171 ein_regK += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00172
#endif
00173
paNewVal0 = (
LH_LUT_DATA_TYPE *)My_ColorLut +
00174 ((((((((ein_regC &
LH_BIT_MASKE_ADR) <<
LH_BIT_BREIT_ADR) +
00175 (ein_regM &
LH_BIT_MASKE_ADR)) <<
LH_BIT_BREIT_ADR) +
00176 (ein_regY &
LH_BIT_MASKE_ADR))>> (
LH_BIT_BREIT_SELEKTOR-
LH_BIT_BREIT_ADR)) +
00177 (ein_regK >>
LH_BIT_BREIT_SELEKTOR))*
LH_DATA_OUT_COUNT);
00178
#if LH_LUT_DATA_SIZE_16
00179
#if LH_DATA_OUT_SIZE_16
00180
00181 aVal = ( paNewVal0[0]);
00182 aVal = aVal + ( aVal >> (
LH_LUT_DATA_SHR ));
00183 aVal = aVal - ( aVal >> (
LH_ADR_BREIT_AUS_LUT ));
00184 ko = (aVal>>LH_DATA_SHR_CORR) & ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR))-1 );
00185 aVal = (aVal >> (
LH_DATA_SHR )) + ( 0 <<
LH_ADR_BREIT_AUS_LUT );
00186 *output0 = (
LH_DATA_OUT_TYPE)((My_OutputLut[aVal] * ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR )) - ko ) + My_OutputLut[aVal +1] * ko)>>(
LH_DATA_SHR - LH_DATA_SHR_CORR) );
00187
00188 aVal = ( paNewVal0[1]);
00189 aVal = aVal + ( aVal >> (
LH_LUT_DATA_SHR ));
00190 aVal = aVal - ( aVal >> (
LH_ADR_BREIT_AUS_LUT ));
00191 ko = (aVal>>LH_DATA_SHR_CORR) & ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR))-1 );
00192 aVal = (aVal >> (
LH_DATA_SHR )) + ( 1 <<
LH_ADR_BREIT_AUS_LUT );
00193 *output1 = (
LH_DATA_OUT_TYPE)((My_OutputLut[aVal] * ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR )) - ko ) + My_OutputLut[aVal +1] * ko)>>(
LH_DATA_SHR - LH_DATA_SHR_CORR) );
00194
00195 aVal = ( paNewVal0[2]);
00196 aVal = aVal + ( aVal >> (
LH_LUT_DATA_SHR ));
00197 aVal = aVal - ( aVal >> (
LH_ADR_BREIT_AUS_LUT ));
00198 ko = (aVal>>LH_DATA_SHR_CORR) & ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR))-1 );
00199 aVal = (aVal >> (
LH_DATA_SHR )) + ( 2 <<
LH_ADR_BREIT_AUS_LUT );
00200 *output2 = (
LH_DATA_OUT_TYPE)((My_OutputLut[aVal] * ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR )) - ko ) + My_OutputLut[aVal +1] * ko)>>(
LH_DATA_SHR - LH_DATA_SHR_CORR) );
00201
00202
#if LH_DATA_OUT_COUNT_4
00203
aVal = ( paNewVal0[3]);
00204 aVal = aVal + ( aVal >> (
LH_LUT_DATA_SHR ));
00205 aVal = aVal - ( aVal >> (
LH_ADR_BREIT_AUS_LUT ));
00206 ko = (aVal>>LH_DATA_SHR_CORR) & ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR))-1 );
00207 aVal = (aVal >> (
LH_DATA_SHR )) + ( 3 <<
LH_ADR_BREIT_AUS_LUT );
00208 *output3 = (
LH_DATA_OUT_TYPE)((My_OutputLut[aVal] * ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR )) - ko ) + My_OutputLut[aVal +1] * ko)>>(
LH_DATA_SHR - LH_DATA_SHR_CORR) );
00209
#endif
00210
00211
#else
00212
*output0 = My_OutputLut[(( paNewVal0[0])>>
LH_DATA_SHR) + (0<<
LH_ADR_BREIT_AUS_LUT)]>>8;
00213 *output1 = My_OutputLut[(( paNewVal0[1])>>
LH_DATA_SHR) + (1<<
LH_ADR_BREIT_AUS_LUT)]>>8;
00214 *output2 = My_OutputLut[(( paNewVal0[2])>>
LH_DATA_SHR) + (2<<
LH_ADR_BREIT_AUS_LUT)]>>8;
00215
#if LH_DATA_OUT_COUNT_4
00216
*output3 = My_OutputLut[(( paNewVal0[3])>>
LH_DATA_SHR) + (3<<
LH_ADR_BREIT_AUS_LUT)]>>8;
00217
#endif
00218
#endif
00219
00220
#else
00221
*output0 = My_OutputLut[(( paNewVal0[0])<<
LH_DATA_SHR) + (0<<
LH_ADR_BREIT_AUS_LUT)];
00222 *output1 = My_OutputLut[(( paNewVal0[1])<<
LH_DATA_SHR) + (1<<
LH_ADR_BREIT_AUS_LUT)];
00223 *output2 = My_OutputLut[(( paNewVal0[2])<<
LH_DATA_SHR) + (2<<
LH_ADR_BREIT_AUS_LUT)];
00224
#if LH_DATA_OUT_COUNT_4
00225
*output3 = My_OutputLut[(( paNewVal0[3])<<
LH_DATA_SHR) + (3<<
LH_ADR_BREIT_AUS_LUT)];
00226
#endif
00227
#endif
00228
00229
#if LH_DATA_OUT_SIZE_16 && ! LH_LUT_DATA_SIZE_16
00230
*output0 |= (*output0 << 8);
00231 *output1 |= (*output1 << 8);
00232 *output2 |= (*output2 << 8);
00233
#if LH_DATA_OUT_COUNT_4
00234
*output3 |= (*output3 << 8);
00235
#endif
00236
#endif
00237
00238
if (Mode ==
LH_CALC_ENGINE_P_TO_P)
00239 {
00240
while (--i)
00241 {
00242 input0 += inputOffset;
00243 input1 += inputOffset;
00244 input2 += inputOffset;
00245 input3 += inputOffset;
00246 output0 += outputOffset;
00247 output1 += outputOffset;
00248 output2 += outputOffset;
00249
#if LH_DATA_OUT_COUNT_4
00250
output3 += outputOffset;
00251
#endif
00252
00253
if ((*input0 ^ ein_cache[0]) || (*input1 ^ ein_cache[1]) || (*input2 ^ ein_cache[2]) || (*input3 ^ ein_cache[3]))
00254 {
00255
break;
00256 }
00257 *output0 = output0[-outputOffset];
00258 *output1 = output1[-outputOffset];
00259 *output2 = output2[-outputOffset];
00260
#if LH_DATA_OUT_COUNT_4
00261
*output3 = output3[-outputOffset];
00262
#endif
00263
}
00264 }
00265
else if (Mode ==
LH_CALC_ENGINE_P_TO_U)
00266 {
00267
#if LH_DATA_OUT_COUNT_4
00268
*output4 &= Mask;
00269
#else
00270
*output3 &= Mask;
00271
#endif
00272
while (--i)
00273 {
00274 input0 += inputOffset;
00275 input1 += inputOffset;
00276 input2 += inputOffset;
00277 input3 += inputOffset;
00278 output0 += outputOffset;
00279 output1 += outputOffset;
00280 output2 += outputOffset;
00281 output3 += outputOffset;
00282
#if LH_DATA_OUT_COUNT_4
00283
output4 += outputOffset;
00284
#endif
00285
if ((*input0 ^ ein_cache[0]) || (*input1 ^ ein_cache[1]) || (*input2 ^ ein_cache[2]) || (*input3 ^ ein_cache[3]))
00286 {
00287
break;
00288 }
00289 *output0 = output0[-outputOffset];
00290 *output1 = output1[-outputOffset];
00291 *output2 = output2[-outputOffset];
00292
#if LH_DATA_OUT_COUNT_4
00293
*output3 = output3[-outputOffset];
00294 *output4 &= Mask;
00295
#else
00296
*output3 &= Mask;
00297
#endif
00298
}
00299 }
00300
else
00301 {
00302
#if LH_DATA_OUT_COUNT_4
00303
*output4 = (
LH_DATA_OUT_TYPE)*input4;
00304
#else
00305
*output3 = (
LH_DATA_OUT_TYPE)*input4;
00306
#endif
00307
while (--i)
00308 {
00309 input0 += inputOffset;
00310 input1 += inputOffset;
00311 input2 += inputOffset;
00312 input3 += inputOffset;
00313 input4 += inputOffset;
00314
00315 output0 += outputOffset;
00316 output1 += outputOffset;
00317 output2 += outputOffset;
00318 output3 += outputOffset;
00319
#if LH_DATA_OUT_COUNT_4
00320
output4 += outputOffset;
00321
#endif
00322
if ((*input0 ^ ein_cache[0]) || (*input1 ^ ein_cache[1]) || (*input2 ^ ein_cache[2]) || (*input3 ^ ein_cache[3]))
00323 {
00324
break;
00325 }
00326 *output0 = output0[-outputOffset];
00327 *output1 = output1[-outputOffset];
00328 *output2 = output2[-outputOffset];
00329
#if LH_DATA_OUT_COUNT_4
00330
*output3 = output3[-outputOffset];
00331 *output4 = (
LH_DATA_OUT_TYPE)*input4;
00332
#else
00333
*output3 = (
LH_DATA_OUT_TYPE)*input4;
00334
#endif
00335
}
00336 }
00337 }
00338
if (--LineCount)
00339 {
00340 j++;
00341 input0 = (
LH_DATA_IN_TYPE *)((
LH_UINT8 *)calcParam->inputData[0] + j * calcParam->cmInputBytesPerLine);
00342 input1 = (
LH_DATA_IN_TYPE *)((
LH_UINT8 *)calcParam->inputData[1] + j * calcParam->cmInputBytesPerLine);
00343 input2 = (
LH_DATA_IN_TYPE *)((
LH_UINT8 *)calcParam->inputData[2] + j * calcParam->cmInputBytesPerLine);
00344 input3 = (
LH_DATA_IN_TYPE *)((
LH_UINT8 *)calcParam->inputData[3] + j * calcParam->cmInputBytesPerLine);
00345 input4 = (
LH_DATA_IN_TYPE *)((
LH_UINT8 *)calcParam->inputData[4] + j * calcParam->cmInputBytesPerLine);
00346
00347 output0 = (
LH_DATA_OUT_TYPE *)((
LH_UINT8 *)calcParam->outputData[0] + j * calcParam->cmOutputBytesPerLine);
00348 output1 = (
LH_DATA_OUT_TYPE *)((
LH_UINT8 *)calcParam->outputData[1] + j * calcParam->cmOutputBytesPerLine);
00349 output2 = (
LH_DATA_OUT_TYPE *)((
LH_UINT8 *)calcParam->outputData[2] + j * calcParam->cmOutputBytesPerLine);
00350 output3 = (
LH_DATA_OUT_TYPE *)((
LH_UINT8 *)calcParam->outputData[3] + j * calcParam->cmOutputBytesPerLine);
00351
#if LH_DATA_OUT_COUNT_4
00352
output4 = (
LH_DATA_OUT_TYPE *)((
LH_UINT8 *)calcParam->outputData[4] + j * calcParam->cmOutputBytesPerLine);
00353
#endif
00354
}
00355 }
00356
LH_END_PROC(
LH_CALC_PROC_NAME)
00357
return 0;
00358 }
00359
#else
00360
{
00361
00362
LH_UINT32 ein_regb;
00363
LH_UINT32 ein_regg;
00364
LH_UINT32 ein_regr;
00365
LH_DATA_IN_TYPE ein_cache[3];
00366
LH_LUT_DATA_TYPE * paNewVal0;
00367
00368
LH_UINT8 Mode;
00369
LH_UINT32 PixelCount, LineCount, i, j;
00370
long inputOffset,outputOffset;
00371
LH_DATA_IN_TYPE * input0 = (
LH_DATA_IN_TYPE *)calcParam->inputData[0];
00372
LH_DATA_IN_TYPE * input1 = (
LH_DATA_IN_TYPE *)calcParam->inputData[1];
00373
LH_DATA_IN_TYPE * input2 = (
LH_DATA_IN_TYPE *)calcParam->inputData[2];
00374
LH_DATA_IN_TYPE * input3 = (
LH_DATA_IN_TYPE *)calcParam->inputData[3];
00375
00376
LH_DATA_OUT_TYPE * output0 = (
LH_DATA_OUT_TYPE *)calcParam->outputData[0];
00377
LH_DATA_OUT_TYPE * output1 = (
LH_DATA_OUT_TYPE *)calcParam->outputData[1];
00378
LH_DATA_OUT_TYPE * output2 = (
LH_DATA_OUT_TYPE *)calcParam->outputData[2];
00379
LH_DATA_OUT_TYPE * output3 = (
LH_DATA_OUT_TYPE *)calcParam->outputData[3];
00380
LH_DATA_OUT_TYPE * output4 = (
LH_DATA_OUT_TYPE *)calcParam->outputData[4];
00381
00382
LH_UINT16 * My_InputLut = (
LH_UINT16 *)lutParam->inputLut;
00383
LH_LUT_DATA_TYPE * My_OutputLut = (
LH_LUT_DATA_TYPE *)lutParam->outputLut;
00384
LH_LUT_DATA_TYPE * My_ColorLut = (
LH_LUT_DATA_TYPE *)lutParam->colorLut;
00385
00386
LH_DATA_OUT_TYPE Mask = (
LH_DATA_OUT_TYPE)-1;
00387
00388
#ifdef DEBUG_OUTPUT
00389
CMError err =
noErr;
00390
#endif
00391
LH_START_PROC(LH_CALC_PROC_NAME)
00392
00393 #
if LH_DATA_IN_SIZE_16
00394 inputOffset = (
long)calcParam->cmInputPixelOffset / 2;
00395
#else
00396
inputOffset = (
long)calcParam->cmInputPixelOffset;
00397
#endif
00398
#if LH_DATA_OUT_SIZE_16
00399
outputOffset = (
long)calcParam->cmOutputPixelOffset / 2;
00400
#else
00401
outputOffset = (
long)calcParam->cmOutputPixelOffset;
00402
#endif
00403
00404
if (calcParam->clearMask)
00405 Mask = 0;
00406 Mode =
LH_CALC_ENGINE_UNDEF_MODE;
00407
00408
00409
if ((calcParam->cmInputPixelOffset * calcParam->cmPixelPerLine == calcParam->cmInputBytesPerLine) && (calcParam->cmOutputPixelOffset * calcParam->cmPixelPerLine == calcParam->cmOutputBytesPerLine))
00410 {
00411 PixelCount = calcParam->cmPixelPerLine * calcParam->cmLineCount;
00412 LineCount = 1;
00413 }
00414
else
00415 {
00416 PixelCount = calcParam->cmPixelPerLine;
00417 LineCount = calcParam->cmLineCount;
00418 }
00419
if (calcParam->copyAlpha )
00420 {
00421 Mode =
LH_CALC_ENGINE_U_TO_U;
00422 }
00423
else
00424 {
00425
if (calcParam->clearMask)
00426 Mode =
LH_CALC_ENGINE_P_TO_U;
00427
else
00428 Mode =
LH_CALC_ENGINE_P_TO_P;
00429 }
00430 j = 0;
00431
while (LineCount)
00432 {
00433 i = PixelCount;
00434
while (i)
00435 {
00436
#if LH_LUT_DATA_SIZE_16
00437
#if LH_DATA_OUT_SIZE_16
00438
register LH_UINT32 ko;
00439
register LH_UINT32 aVal;
00440
#endif
00441
#endif
00442
#if LH_DATA_IN_SIZE_16
00443
ein_regr = My_InputLut[((ein_cache[0]=*input0)>>( 16-
LH_ADR_BREIT_EIN_LUT )) + ( 0 <<
LH_ADR_BREIT_EIN_LUT )];
00444 ein_regr += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00445 ein_regg = My_InputLut[((ein_cache[1]=*input1)>>( 16-
LH_ADR_BREIT_EIN_LUT )) + ( 1 <<
LH_ADR_BREIT_EIN_LUT )];
00446 ein_regg += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00447 ein_regb = My_InputLut[((ein_cache[2]=*input2)>>( 16-
LH_ADR_BREIT_EIN_LUT )) + ( 2 <<
LH_ADR_BREIT_EIN_LUT )];
00448 ein_regb += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00449
#else
00450
ein_regr = My_InputLut[(ein_cache[0]=*input0) + ( 0 <<
LH_ADR_BREIT_EIN_LUT )];
00451 ein_regr += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00452 ein_regg = My_InputLut[(ein_cache[1]=*input1) + ( 1 <<
LH_ADR_BREIT_EIN_LUT )];
00453 ein_regg += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00454 ein_regb = My_InputLut[(ein_cache[2]=*input2) + ( 2 <<
LH_ADR_BREIT_EIN_LUT )];
00455 ein_regb += 1<<
LH_BIT_BREIT_SELEKTOR-1;
00456
#endif
00457
paNewVal0 = (
LH_LUT_DATA_TYPE *)My_ColorLut +
00458 ((((((ein_regr &
LH_BIT_MASKE_ADR) <<
LH_BIT_BREIT_ADR) +
00459 (ein_regg &
LH_BIT_MASKE_ADR))>> (
LH_BIT_BREIT_SELEKTOR-
LH_BIT_BREIT_ADR)) +
00460 (ein_regb >>
LH_BIT_BREIT_SELEKTOR))*
LH_DATA_OUT_COUNT);
00461
#if LH_LUT_DATA_SIZE_16
00462
#if LH_DATA_OUT_SIZE_16
00463
00464 aVal = ( paNewVal0[0]);
00465 aVal = aVal + ( aVal >> (
LH_LUT_DATA_SHR ));
00466 aVal = aVal - ( aVal >> (
LH_ADR_BREIT_AUS_LUT ));
00467 ko = (aVal>>LH_DATA_SHR_CORR) & ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR))-1 );
00468 aVal = (aVal >> (
LH_DATA_SHR )) + ( 0 <<
LH_ADR_BREIT_AUS_LUT );
00469 *output0 = (
LH_DATA_OUT_TYPE)((My_OutputLut[aVal] * ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR )) - ko ) + My_OutputLut[aVal +1] * ko)>>(
LH_DATA_SHR - LH_DATA_SHR_CORR) );
00470
00471 paNewVal0++;
00472 aVal = ( paNewVal0[0]);
00473 aVal = aVal + ( aVal >> (
LH_LUT_DATA_SHR ));
00474 aVal = aVal - ( aVal >> (
LH_ADR_BREIT_AUS_LUT ));
00475 ko = (aVal>>LH_DATA_SHR_CORR) & ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR))-1 );
00476 aVal = (aVal >> (
LH_DATA_SHR )) + ( 1 <<
LH_ADR_BREIT_AUS_LUT );
00477 *output1 = (
LH_DATA_OUT_TYPE)((My_OutputLut[aVal] * ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR )) - ko ) + My_OutputLut[aVal +1] * ko)>>(
LH_DATA_SHR - LH_DATA_SHR_CORR) );
00478
00479 paNewVal0++;
00480 aVal = ( paNewVal0[0]);
00481 aVal = aVal + ( aVal >> (
LH_LUT_DATA_SHR ));
00482 aVal = aVal - ( aVal >> (
LH_ADR_BREIT_AUS_LUT ));
00483 ko = (aVal>>LH_DATA_SHR_CORR) & ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR))-1 );
00484 aVal = (aVal >> (
LH_DATA_SHR )) + ( 2 <<
LH_ADR_BREIT_AUS_LUT );
00485 *output2 = (
LH_DATA_OUT_TYPE)((My_OutputLut[aVal] * ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR )) - ko ) + My_OutputLut[aVal +1] * ko)>>(
LH_DATA_SHR - LH_DATA_SHR_CORR) );
00486
00487
#if LH_DATA_OUT_COUNT_4
00488
paNewVal0++;
00489 aVal = ( paNewVal0[0]);
00490 aVal = aVal + ( aVal >> (
LH_LUT_DATA_SHR ));
00491 aVal = aVal - ( aVal >> (
LH_ADR_BREIT_AUS_LUT ));
00492 ko = (aVal>>LH_DATA_SHR_CORR) & ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR))-1 );
00493 aVal = (aVal >> (
LH_DATA_SHR )) + ( 3 <<
LH_ADR_BREIT_AUS_LUT );
00494 *output3 = (
LH_DATA_OUT_TYPE)((My_OutputLut[aVal] * ( (1<<(
LH_DATA_SHR - LH_DATA_SHR_CORR )) - ko ) + My_OutputLut[aVal +1] * ko)>>(
LH_DATA_SHR - LH_DATA_SHR_CORR) );
00495
#endif
00496
00497
#else
00498
*output0 = My_OutputLut[(( paNewVal0[0])>>
LH_DATA_SHR) + (0<<
LH_ADR_BREIT_AUS_LUT)]>>8;
00499 paNewVal0++;
00500 *output1 = My_OutputLut[(( paNewVal0[0])>>
LH_DATA_SHR) + (1<<
LH_ADR_BREIT_AUS_LUT)]>>8;
00501 paNewVal0++;
00502 *output2 = My_OutputLut[(( paNewVal0[0])>>
LH_DATA_SHR) + (2<<
LH_ADR_BREIT_AUS_LUT)]>>8;
00503
#if LH_DATA_OUT_COUNT_4
00504
paNewVal0++;
00505 *output3 = My_OutputLut[(( paNewVal0[0])>>
LH_DATA_SHR) + (3<<
LH_ADR_BREIT_AUS_LUT)]>>8;
00506
#endif
00507
#endif
00508
00509
#else
00510
*output0 = My_OutputLut[(( paNewVal0[0])<<
LH_DATA_SHR) + (0<<
LH_ADR_BREIT_AUS_LUT)];
00511 paNewVal0++;
00512 *output1 = My_OutputLut[(( paNewVal0[0])<<
LH_DATA_SHR) + (1<<
LH_ADR_BREIT_AUS_LUT)];
00513 paNewVal0++;
00514 *output2 = My_OutputLut[(( paNewVal0[0])<<
LH_DATA_SHR) + (2<<
LH_ADR_BREIT_AUS_LUT)];
00515
#if LH_DATA_OUT_COUNT_4
00516
paNewVal0++;
00517 *output3 = My_OutputLut[(( paNewVal0[0])<<
LH_DATA_SHR) + (3<<
LH_ADR_BREIT_AUS_LUT)];
00518
#endif
00519
#endif
00520
00521
#if LH_DATA_OUT_SIZE_16 && ! LH_LUT_DATA_SIZE_16
00522
*output0 |= (*output0 << 8);
00523 *output1 |= (*output1 << 8);
00524 *output2 |= (*output2 << 8);
00525
#if LH_DATA_OUT_COUNT_4
00526
*output3 |= (*output3 << 8);
00527
#endif
00528
#endif
00529
00530
if (Mode ==
LH_CALC_ENGINE_P_TO_P)
00531 {
00532
while (--i)
00533 {
00534 input0 += inputOffset;
00535 input1 += inputOffset;
00536 input2 += inputOffset;
00537 output0 += outputOffset;
00538 output1 += outputOffset;
00539 output2 += outputOffset;
00540
#if LH_DATA_OUT_COUNT_4
00541
output3 += outputOffset;
00542
#endif
00543
00544
if ((*input0 ^ ein_cache[0]) || (*input1 ^ ein_cache[1]) || (*input2 ^ ein_cache[2]))
00545 {
00546
break;
00547 }
00548 *output0 = output0[-outputOffset];
00549 *output1 = output1[-outputOffset];
00550 *output2 = output2[-outputOffset];
00551
#if LH_DATA_OUT_COUNT_4
00552
*output3 = output3[-outputOffset];
00553
#endif
00554
}
00555 }
00556
else if (Mode ==
LH_CALC_ENGINE_P_TO_U)
00557 {
00558
#if LH_DATA_OUT_COUNT_4
00559
*output4 &= Mask;
00560
#else
00561
*output3 &= Mask;
00562
#endif
00563
while (--i)
00564 {
00565 input0 += inputOffset;
00566 input1 += inputOffset;
00567 input2 += inputOffset;
00568 output0 += outputOffset;
00569 output1 += outputOffset;
00570 output2 += outputOffset;
00571 output3 += outputOffset;
00572
#if LH_DATA_OUT_COUNT_4
00573
output4 += outputOffset;
00574
#endif
00575
if ((*input0 ^ ein_cache[0]) || (*input1 ^ ein_cache[1]) || (*input2 ^ ein_cache[2]))
00576 {
00577
break;
00578 }
00579 *output0 = output0[-outputOffset];
00580 *output1 = output1[-outputOffset];
00581 *output2 = output2[-outputOffset];
00582
#if LH_DATA_OUT_COUNT_4
00583
*output3 = output3[-outputOffset];
00584 *output4 &= Mask;
00585
#else
00586
*output3 &= Mask;
00587
#endif
00588
}
00589 }
00590
else
00591 {
00592
#if LH_DATA_OUT_COUNT_4
00593
*output4 = (
LH_DATA_OUT_TYPE)*input3;
00594
#else
00595
*output3 = (
LH_DATA_OUT_TYPE)*input3;
00596
#endif
00597
while (--i)
00598 {
00599 input0 += inputOffset;
00600 input1 += inputOffset;
00601 input2 += inputOffset;
00602 input3 += inputOffset;
00603
00604 output0 += outputOffset;
00605 output1 += outputOffset;
00606 output2 += outputOffset;
00607 output3 += outputOffset;
00608
#if LH_DATA_OUT_COUNT_4
00609
output4 += outputOffset;
00610
#endif
00611
if ((*input0 ^ ein_cache[0]) || (*input1 ^ ein_cache[1]) || (*input2 ^ ein_cache[2]))
00612 {
00613
break;
00614 }
00615 *output0 = output0[-outputOffset];
00616 *output1 = output1[-outputOffset];
00617 *output2 = output2[-outputOffset];
00618
#if LH_DATA_OUT_COUNT_4
00619
*output3 = output3[-outputOffset];
00620 *output4 = (
LH_DATA_OUT_TYPE)*input3;
00621
#else
00622
*output3 = (
LH_DATA_OUT_TYPE)*input3;
00623
#endif
00624
}
00625 }
00626 }
00627
if (--LineCount)
00628 {
00629 j++;
00630 input0 = (
LH_DATA_IN_TYPE *)((
LH_UINT8 *)calcParam->inputData[0] + j * calcParam->cmInputBytesPerLine);
00631 input1 = (
LH_DATA_IN_TYPE *)((
LH_UINT8 *)calcParam->inputData[1] + j * calcParam->cmInputBytesPerLine);
00632 input2 = (
LH_DATA_IN_TYPE *)((
LH_UINT8 *)calcParam->inputData[2] + j * calcParam->cmInputBytesPerLine);
00633 input3 = (
LH_DATA_IN_TYPE *)((
LH_UINT8 *)calcParam->inputData[3] + j * calcParam->cmInputBytesPerLine);
00634
00635 output0 = (
LH_DATA_OUT_TYPE *)((
LH_UINT8 *)calcParam->outputData[0] + j * calcParam->cmOutputBytesPerLine);
00636 output1 = (
LH_DATA_OUT_TYPE *)((
LH_UINT8 *)calcParam->outputData[1] + j * calcParam->cmOutputBytesPerLine);
00637 output2 = (
LH_DATA_OUT_TYPE *)((
LH_UINT8 *)calcParam->outputData[2] + j * calcParam->cmOutputBytesPerLine);
00638 output3 = (
LH_DATA_OUT_TYPE *)((
LH_UINT8 *)calcParam->outputData[3] + j * calcParam->cmOutputBytesPerLine);
00639
#if LH_DATA_OUT_COUNT_4
00640
output4 = (
LH_DATA_OUT_TYPE *)((
LH_UINT8 *)calcParam->outputData[4] + j * calcParam->cmOutputBytesPerLine);
00641
#endif
00642
}
00643 }
00644
LH_END_PROC(LH_CALC_PROC_NAME)
00645 return 0;
00646 }
00647 #endif
00648 #undef LH_CALC_PROC_NAME