Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

dondim.c

Go to the documentation of this file.
00001 /* 00002 File: LHDoNDim.c 00003 00004 Contains: 00005 00006 Written by: U. J. Krabbenhoeft 00007 00008 Copyright: � 1993-1997 by Heidelberger Druckmaschinen AG, all rights reserved. 00009 00010 Version: 00011 */ 00012 00013 #ifndef LHGeneralIncs_h 00014 #include "General.h" 00015 #endif 00016 00017 #ifndef LHDoNDim_h 00018 #include "DoNDim.h" 00019 #endif 00020 00021 #define SHRINK_FACTOR 13 00022 /* 00023 #define FARBR_FILES 1 00024 #define FARBR_DEBUG 1 00025 #define FARBR_DEBUG0 1 00026 */ 00027 #if FARBR_FILES 00028 #include "stdio.h" 00029 #include "string.h" 00030 void WriteLuts( char *theName,long WordSize,long aElutAdrSize,long aElutWordSize,UINT16 *Elut, 00031 long aXlutInDim,long aXlutOutDim,long aXlutAdrSize,long aXlutWordSize,UINT16 *Xlut, 00032 long aAlutAdrSize,long aAlutWordSize,UINT16 *aus_lut); 00033 #endif 00034 00035 #if UWEs_eigene_Umgebung 00036 #include <stdio.h> 00037 #define DebugPrint printf 00038 #else 00039 #ifdef DEBUG_OUTPUT 00040 #define kThisFile kLHDoNDimID 00041 /*#include "DebugSpecial.h"*/ 00042 #else 00043 #define DebugPrint(x) 00044 #endif 00045 #endif 00046 00047 #define CLIPPWord(x,a,b) ((x)<(a)?(UINT16)(a):((x)>(b)?(UINT16)(b):(UINT16)(x+.5))) 00048 #define CLIPP(x,a,b) ((x)<(a)?(a):((x)>(b)?(b):(x))) 00049 /*#if 0*/ 00050 00051 /*������������������������������������������������������������������������������������������� 00052 �������������������������������������������������������������������������������������������*/ 00053 #define Round(a) (((a)>0.)?((a)+.5):((a)-.5)) 00054 00055 /*������������������������������������������������������������������������������������������� 00056 DoOnlyMatrixForCube 00057 �������������������������������������������������������������������������������������������*/ 00058 void DoOnlyMatrixForCube( Matrix2D *theMatrix, Ptr aXlut, long aPointCount, long gridPointsCube ) 00059 { 00060 register long ii,jj; 00061 register long i; 00062 register long aLong0; 00063 register long aLong1; 00064 register long aLong2; 00065 register long theEnd; 00066 register long aVal; 00067 long aMatrix[3][3]; 00068 register double aFactor,dVal; 00069 register UINT16 accu,aMax; 00070 register UINT8 *theArr = (UINT8 *)aXlut; 00071 /* FILE *aSt; */ 00072 00073 00074 #ifdef DEBUG_OUTPUT 00075 long err=0; 00076 #endif 00077 LH_START_PROC("DoOnlyMatrixForCube") 00078 jj=aPointCount; 00079 theEnd = 3 * aPointCount; 00080 /*for( i=1; i<100; ++i)if( i*i*i == jj )break;*/ /* calculate gridpoints*/ 00081 /*if( i<= 0 || i >= 100 ) return;*/ 00082 i = gridPointsCube; 00083 aMax = 256 - 1; 00084 aFactor = 4096.*255./(256.*(i-1)/i); 00085 for( ii=0; ii<3; ii++){ 00086 for( jj=0; jj<3; jj++){ 00087 dVal = (*theMatrix)[ii][jj]*aFactor; 00088 aMatrix[ii][jj] = (long)Round(dVal); 00089 } 00090 } 00091 #if FARBR_DEBUG 00092 DebugPrint("theArr=(d)");for(ii=0; ii<3; ++ii) for( jj=0; jj<3; jj++) DebugPrint("%f ",aMatrix[ii][jj]); DebugPrint("\n"); 00093 #endif 00094 /* 00095 aSt = fopen("Matrix","a"); 00096 for(ii=0; ii<3; ++ii) for( jj=0; jj<3; jj++) fprintf(aSt,"%f ",(*(aStructPtr->theMatrix))[ii][jj]); fprintf(aSt,"\n"); 00097 for(ii=0; ii<3; ++ii) for( jj=0; jj<3; jj++) fprintf(aSt,"%d ",aMatrix[ii][jj]); fprintf(aSt,"\n"); 00098 fclose(aSt); 00099 */ 00100 for (i = 0; i < theEnd; i +=3){ /* Schleife der Points */ 00101 aLong0=theArr[i+0]; 00102 aLong1=theArr[i+1]; 00103 aLong2=theArr[i+2]; 00104 for( ii=0; ii<3; ii++){ 00105 aVal = aMatrix[ii][0] * aLong0; 00106 aVal += aMatrix[ii][1] * aLong1; 00107 aVal += aMatrix[ii][2] * aLong2; 00108 if( aVal > 0) aVal = (aVal+2047)>>12; 00109 else aVal = (aVal-2047)>>12; 00110 accu = (UINT16)CLIPP(aVal,0,(long)aMax); 00111 theArr[i+ii] = (UINT8)accu; 00112 } 00113 #if FARBR_DEBUG 00114 DebugPrint("i=%ld\n",i); 00115 DebugPrint("theArr=(d)");for(ii=0; ii<3; ++ii) DebugPrint("%ld ",theArr[i+ii]); DebugPrint("\n"); 00116 DebugPrint("ein_reg=(d)");DebugPrint("%ld ",aLong0);DebugPrint("%ld ",aLong1);DebugPrint("%ld ",aLong2); DebugPrint("\n"); 00117 #endif 00118 } 00119 00120 LH_END_PROC("DoOnlyMatrixForCube") 00121 } 00122 00123 00124 #define VAL_MAX 65536 00125 #define VAL_MAXM1 (VAL_MAX-1) 00126 00127 /*������������������������������������������������������������������������������������������� 00128 DoMatrixForCube16 00129 �������������������������������������������������������������������������������������������*/ 00130 void DoMatrixForCube16( DoMatrixForCubeStructPtr aStructPtr ) 00131 { 00132 register long ii,jj; 00133 register long i; 00134 /*long aLong[3];*/ 00135 register long aLong0; 00136 register long aLong1; 00137 register long aLong2; 00138 register long theEnd; 00139 register long aElutShift,aElutShiftNum,aAlutShift,aElutOffset,aAlutOffset; 00140 register unsigned long aElutAdrSize,separateEluts,separateAluts; 00141 register long aVal; 00142 long aMatrix[3][3]; 00143 register double aFactor,dVal; 00144 register unsigned long aMax; 00145 register UINT16 *ein_lut; 00146 register UINT16 *aus_lut; 00147 register UINT8 *aus_lutByte; 00148 register unsigned long aAlutAdrSize; 00149 register UINT16 *theArr; 00150 register UINT8 *theByteArr; 00151 register unsigned long ko,ko0; 00152 register long aElutShiftRight; 00153 /* FILE *aSt;*/ 00154 00155 #ifdef DEBUG_OUTPUT 00156 long err=0; 00157 #endif 00158 LH_START_PROC("DoMatrixForCube16") 00159 00160 /*DebugPrint("DoMatrixForCube16 with %d input pixels\n",aPointCount);*/ 00161 ein_lut = aStructPtr->ein_lut; 00162 aus_lut = (UINT16 *)aStructPtr->aus_lut; 00163 aus_lutByte = (UINT8 *)aus_lut; 00164 theArr = (UINT16 *)aStructPtr->theArr; 00165 theByteArr = (UINT8 *)theArr; 00166 aAlutAdrSize = aStructPtr->aAlutAdrSize; 00167 aElutAdrSize = aStructPtr->aElutAdrSize; 00168 separateEluts = aStructPtr->separateEluts; 00169 separateAluts = aStructPtr->separateAluts; 00170 theEnd = 3*aStructPtr->aPointCount; 00171 aMax = aAlutAdrSize-1; 00172 00173 for( i=0; i<33; i++) if( (1L<<i) == (long)aElutAdrSize )break; 00174 if( i > 32 ) return; 00175 aElutShift = 16-i; 00176 aElutShiftRight = aStructPtr->aElutWordSize - aElutShift + 0; /* use only 16 bit from elut*/ 00177 if( aElutShiftRight < 0 ) return; 00178 aElutShiftNum = 1<<aElutShift; 00179 00180 aFactor = 2*8. * aMax /(aStructPtr->gridPoints-1)*(double)aStructPtr->gridPoints; 00181 for( ii=0; ii<3; ii++){ 00182 for( jj=0; jj<3; jj++){ 00183 dVal = (*(aStructPtr->theMatrix))[ii][jj]*aFactor; 00184 aMatrix[ii][jj] = (long)Round(dVal); 00185 } 00186 } 00187 #if FARBR_DEBUG 00188 DebugPrint("theArr=(d)");for(ii=0; ii<3; ++ii) for( jj=0; jj<3; jj++) DebugPrint("%f ",aMatrix[ii][jj]); DebugPrint("\n"); 00189 /* 00190 aSt = fopen("Matrix","a"); 00191 for(ii=0; ii<3; ++ii) for( jj=0; jj<3; jj++) fprintf(aSt,"%f ",(*(aStructPtr->theMatrix))[ii][jj]); fprintf(aSt,"\n"); 00192 for(ii=0; ii<3; ++ii) for( jj=0; jj<3; jj++) fprintf(aSt,"%d ",aMatrix[ii][jj]); fprintf(aSt,"\n"); 00193 fclose(aSt); 00194 */ 00195 #endif 00196 if( aStructPtr->aBufferByteCount == 2 ){ 00197 aAlutShift = 16-aStructPtr->aAlutWordSize; 00198 for (i = 0; i < theEnd; i +=3){ /* Schleife der Points */ 00199 00200 aElutOffset = 0; 00201 ko = (theArr[i+0]); 00202 ko0 = ko - ( ko >> ( 16 - aElutShift )); 00203 ko = ko0 & ( aElutShiftNum - 1 ); 00204 ko0 = ko0 >> aElutShift; 00205 if( ko0 >= (aElutAdrSize-1) ){ 00206 aLong0 = ein_lut[ ko0 + aElutOffset ]<<(aElutShift-aElutShiftRight); 00207 } 00208 else{ 00209 ko0 += aElutOffset; 00210 aLong0 = ( ein_lut[ ko0 ] * ( aElutShiftNum - ko ) + ein_lut[ ko0 + 1 ] * ko )>>aElutShiftRight; 00211 } 00212 if( separateEluts )aElutOffset += aElutAdrSize; 00213 00214 ko = (theArr[i+1]); 00215 ko0 = ko - ( ko >> ( 16 - aElutShift )); 00216 ko = ko0 & ( aElutShiftNum - 1 ); 00217 ko0 = ko0 >> aElutShift; 00218 if( ko0 >= (aElutAdrSize-1) ){ 00219 aLong1 = ein_lut[ ko0 + aElutOffset ]<<(aElutShift-aElutShiftRight); 00220 } 00221 else{ 00222 ko0 += aElutOffset; 00223 aLong1 = ( ein_lut[ ko0 ] * ( aElutShiftNum - ko ) + ein_lut[ ko0 + 1 ] * ko )>>aElutShiftRight; 00224 } 00225 if( separateEluts )aElutOffset += aElutAdrSize; 00226 00227 ko = (theArr[i+2]); 00228 ko0 = ko - ( ko >> ( 16 - aElutShift )); 00229 ko = ko0 & ( aElutShiftNum - 1 ); 00230 ko0 = ko0 >> aElutShift; 00231 if( ko0 >= (aElutAdrSize-1) ){ 00232 aLong2 = ein_lut[ ko0 + aElutOffset ]<<(aElutShift-aElutShiftRight); 00233 } 00234 else{ 00235 ko0 += aElutOffset; 00236 aLong2 = ( ein_lut[ ko0 ] * ( aElutShiftNum - ko ) + ein_lut[ ko0 + 1 ] * ko )>>aElutShiftRight; 00237 } 00238 00239 aLong0 = ( aLong0 +2 )>>2; 00240 aLong1 = ( aLong1 +2 )>>2; 00241 aLong2 = ( aLong2 +2 )>>2; 00242 aAlutOffset = 0; 00243 for( ii=0; ii<3; ii++){ 00244 aVal = aMatrix[ii][0] * aLong0; 00245 aVal += aMatrix[ii][1] * aLong1; 00246 aVal += aMatrix[ii][2] * aLong2; 00247 aVal = (aVal+((1<<9)-1))>>10; 00248 if( aVal < 0 ) aVal = 0; 00249 00250 ko0= ( aVal>> (3+2+3) ); 00251 if( ko0 >= (aAlutAdrSize-1) ){ 00252 theArr[i+ii] = aus_lut[ (aAlutAdrSize-1) + aAlutOffset ] <<aAlutShift; 00253 } 00254 else{ 00255 ko0 += aAlutOffset; 00256 ko = ( aVal & ((1<<(3+2+3))-1) ); 00257 theArr[i+ii] = (UINT16)(( aus_lut[ ko0 ] * ( (1<<(3+2+3)) - ko ) + aus_lut[ ko0 +1 ] * ko)>>((3+2+3)-aAlutShift)); 00258 } 00259 if( separateAluts )aAlutOffset += aAlutAdrSize; 00260 } 00261 #if FARBR_DEBUG 00262 DebugPrint("i=%ld\n",i); 00263 DebugPrint("theArr=(d)");for(ii=0; ii<3; ++ii) DebugPrint("%ld ",theArr[i+ii]); DebugPrint("\n"); 00264 DebugPrint("ein_reg=(d)");DebugPrint("%ld ",aLong0);DebugPrint("%ld ",aLong1);DebugPrint("%ld ",aLong2); DebugPrint("\n"); 00265 #endif 00266 } 00267 } 00268 else{ 00269 aAlutShift = aStructPtr->aAlutWordSize - 8; 00270 for (i = 0; i < theEnd; i +=3){ /* Schleife der Points*/ 00271 00272 00273 aElutOffset = 0; 00274 ko = (theArr[i+0]); 00275 ko0 = ko - ( ko >> ( 16 - aElutShift )); 00276 ko = ko0 & ( aElutShiftNum - 1 ); 00277 ko0 = ko0 >> aElutShift; 00278 if( ko0 >= (aElutAdrSize-1) ){ 00279 aLong0 = ein_lut[ ko0 + aElutOffset ]<<(aElutShift-aElutShiftRight); 00280 } 00281 else{ 00282 ko0 += aElutOffset; 00283 aLong0 = ( ein_lut[ ko0 ] * ( aElutShiftNum - ko ) + ein_lut[ ko0 + 1 ] * ko )>>aElutShiftRight; 00284 } 00285 if( separateEluts )aElutOffset += aElutAdrSize; 00286 00287 ko = (theArr[i+1]); 00288 ko0 = ko - ( ko >> ( 16 - aElutShift )); 00289 ko = ko0 & ( aElutShiftNum - 1 ); 00290 ko0 = ko0 >> aElutShift; 00291 if( ko0 >= (aElutAdrSize-1) ){ 00292 aLong1 = ein_lut[ ko0 + aElutOffset ]<<(aElutShift-aElutShiftRight); 00293 } 00294 else{ 00295 ko0 += aElutOffset; 00296 aLong1 = ( ein_lut[ ko0 ] * ( aElutShiftNum - ko ) + ein_lut[ ko0 + 1 ] * ko )>>aElutShiftRight; 00297 } 00298 if( separateEluts )aElutOffset += aElutAdrSize; 00299 00300 ko = (theArr[i+2]); 00301 ko0 = ko - ( ko >> ( 16 - aElutShift )); 00302 ko = ko0 & ( aElutShiftNum - 1 ); 00303 ko0 = ko0 >> aElutShift; 00304 if( ko0 >= (aElutAdrSize-1) ){ 00305 aLong2 = ein_lut[ ko0 + aElutOffset ]<<(aElutShift-aElutShiftRight); 00306 } 00307 else{ 00308 ko0 += aElutOffset; 00309 aLong2 = ( ein_lut[ ko0 ] * ( aElutShiftNum - ko ) + ein_lut[ ko0 + 1 ] * ko )>>aElutShiftRight; 00310 } 00311 00312 aLong0 = ( aLong0 +2 )>>2; 00313 aLong1 = ( aLong1 +2 )>>2; 00314 aLong2 = ( aLong2 +2 )>>2; 00315 aAlutOffset = 0; 00316 if( aStructPtr->aAlutWordSize > 8 ){ 00317 for( ii=0; ii<3; ii++){ 00318 aVal = aMatrix[ii][0] * aLong0; 00319 aVal += aMatrix[ii][1] * aLong1; 00320 aVal += aMatrix[ii][2] * aLong2; 00321 aVal = (aVal+((1<<12)-1))>>13; 00322 if( aVal < 0 ) aVal = 0; 00323 00324 ko0= (aVal+((1<<(3+2-1))-1)) >> (3+2); 00325 if( ko0 >= (aAlutAdrSize-1) ){ 00326 theByteArr[i+ii] = aus_lut[ (aAlutAdrSize-1) + aAlutOffset ] >>aAlutShift; 00327 } 00328 else{ 00329 theByteArr[i+ii] = aus_lut[ ko0 + aAlutOffset ] >>aAlutShift; 00330 } 00331 if( separateAluts )aAlutOffset += aAlutAdrSize; 00332 } 00333 } 00334 else{ 00335 for( ii=0; ii<3; ii++){ 00336 aVal = aMatrix[ii][0] * aLong0; 00337 aVal += aMatrix[ii][1] * aLong1; 00338 aVal += aMatrix[ii][2] * aLong2; 00339 aVal = (aVal+((1<<12)-1))>>13; 00340 if( aVal < 0 ) aVal = 0; 00341 00342 ko0= (aVal+((1<<(3+2-1))-1)) >> (3+2); 00343 if( ko0 >= (aAlutAdrSize-1) ){ 00344 theByteArr[i+ii] = aus_lutByte[ (aAlutAdrSize-1) + aAlutOffset ] ; 00345 } 00346 else{ 00347 theByteArr[i+ii] = aus_lutByte[ ko0 + aAlutOffset ] ; 00348 } 00349 if( separateAluts )aAlutOffset += aAlutAdrSize; 00350 } 00351 } 00352 #if FARBR_DEBUG 00353 DebugPrint("i=%ld\n",i); 00354 DebugPrint("theArr=(d)");for(ii=0; ii<3; ++ii) DebugPrint("%ld ",theArr[i+ii]); DebugPrint("\n"); 00355 DebugPrint("ein_reg=(d)");DebugPrint("%ld ",aLong0);DebugPrint("%ld ",aLong1);DebugPrint("%ld ",aLong2); DebugPrint("\n"); 00356 #endif 00357 } 00358 } 00359 LH_END_PROC("DoMatrixForCube16") 00360 } 00361 00362 void DoOnlyMatrixForCube16( Matrix2D *theMatrix, Ptr aXlut, long aPointCount, long gridPointsCube ) 00363 { 00364 register long ii,jj; 00365 register long i; 00366 register long aLong0; 00367 register long aLong1; 00368 register long aLong2; 00369 register long theEnd; 00370 register long aVal; 00371 long aMatrix[3][3]; 00372 register double aFactor,dVal; 00373 register UINT16 accu,aMax; 00374 register UINT16 *theArr = (UINT16 *)aXlut; 00375 /* FILE *aSt;*/ 00376 00377 00378 #ifdef DEBUG_OUTPUT 00379 long err = 0; 00380 #endif 00381 LH_START_PROC("DoOnlyMatrixForCube16") 00382 jj=aPointCount; 00383 theEnd = 3 * aPointCount; 00384 /*for( i=1; i<100; ++i)if( i*i*i == jj )break; */ /* calculate gridpoints*/ 00385 /*if( i<= 0 || i >= 100 ) return;*/ 00386 i = gridPointsCube; 00387 aMax = VAL_MAXM1; 00388 aFactor = 4096.; 00389 for( ii=0; ii<3; ii++){ 00390 for( jj=0; jj<3; jj++){ 00391 dVal = (*theMatrix)[ii][jj]*aFactor; 00392 aMatrix[ii][jj] = (long)Round(dVal); 00393 } 00394 } 00395 #if FARBR_DEBUG 00396 DebugPrint("theArr=(d)");for(ii=0; ii<3; ++ii) for( jj=0; jj<3; jj++) DebugPrint("%f ",aMatrix[ii][jj]); DebugPrint("\n"); 00397 #endif 00398 /* 00399 aSt = fopen("Matrix","a"); 00400 for(ii=0; ii<3; ++ii) for( jj=0; jj<3; jj++) fprintf(aSt,"%f ",(*(aStructPtr->theMatrix))[ii][jj]); fprintf(aSt,"\n"); 00401 for(ii=0; ii<3; ++ii) for( jj=0; jj<3; jj++) fprintf(aSt,"%d ",aMatrix[ii][jj]); fprintf(aSt,"\n"); 00402 fclose(aSt); 00403 */ 00404 for (i = 0; i < theEnd; i +=3){ /* Schleife der Points */ 00405 aLong0=theArr[i+0]; 00406 aLong1=theArr[i+1]; 00407 aLong2=theArr[i+2]; 00408 for( ii=0; ii<3; ii++){ 00409 aVal = aMatrix[ii][0] * aLong0; 00410 aVal += aMatrix[ii][1] * aLong1; 00411 aVal += aMatrix[ii][2] * aLong2; 00412 if( aVal > 0) aVal = (aVal+2047)>>12; 00413 else aVal = (aVal-2047)>>12; 00414 accu = (UINT16)CLIPP(aVal,0,(long)aMax); 00415 theArr[i+ii] = accu; 00416 } 00417 #if FARBR_DEBUG 00418 DebugPrint("i=%ld\n",i); 00419 DebugPrint("theArr=(d)");for(ii=0; ii<3; ++ii) DebugPrint("%ld ",theArr[i+ii]); DebugPrint("\n"); 00420 DebugPrint("ein_reg=(d)");DebugPrint("%ld ",aLong0);DebugPrint("%ld ",aLong1);DebugPrint("%ld ",aLong2); DebugPrint("\n"); 00421 #endif 00422 } 00423 LH_END_PROC("DoOnlyMatrixForCube16") 00424 } 00425 00426 00427 #if FARBR_FILES 00428 static FileCount = 0; 00429 static FILE *stream1; 00430 00431 /*������������������������������������������������������������������������������������������� 00432 WriteLuts 00433 �������������������������������������������������������������������������������������������*/ 00434 void WriteLuts( char *theName,long WordSize,long aElutAdrSize,long aElutWordSize,UINT16 *Elut, 00435 long aXlutInDim,long aXlutOutDim,long aXlutAdrSize,long aXlutWordSize,UINT16 *Xlut, 00436 long aAlutAdrSize,long aAlutWordSize,UINT16 *Alut) 00437 { 00438 register unsigned long Size,i,ii,l,lMax; 00439 char FileNameBuffer[256]; 00440 00441 Size = aElutAdrSize*aXlutInDim; 00442 sprintf(FileNameBuffer,"%s Elut%d",theName,FileCount); 00443 stream1=fopen(FileNameBuffer,"wb"); /* oeffne Schreibedatei */ 00444 if(stream1 == NULL){ 00445 DebugPrint("Open %s failed \n",FileNameBuffer); 00446 return; 00447 } 00448 lMax=0; 00449 if( 2 == 2 ){ for(i=0; i<Size; ++i)if( lMax < Elut[i] )lMax = Elut[i];} 00450 else{ for(i=0; i<Size; ++i)if( lMax < ((UINT8 *)Elut)[i] )lMax = ((UINT8 *)Elut)[i];} 00451 sprintf(FileNameBuffer,"%s InputDimension=%d OutputDimension=%d AdrSize=%ld EndWert=%ld WordSize=%ld", 00452 FileNameBuffer,aXlutInDim,aXlutInDim,aElutAdrSize,lMax,aElutWordSize); 00453 i=strlen( FileNameBuffer )+1; 00454 for( ii=i; ii<((i+15)/16)*16; ii++)FileNameBuffer[ii-1]=' '; 00455 FileNameBuffer[ii-1]='\0'; 00456 l=fprintf(stream1,"%s\n",FileNameBuffer); 00457 00458 if(fwrite(Elut,sizeof(UINT16),Size,stream1) != Size){ 00459 DebugPrint("Write Error %s\n",FileNameBuffer); 00460 return; 00461 } 00462 fclose(stream1); 00463 Size = 1; 00464 for( i=0; i<aXlutInDim; ++i)Size *= aXlutAdrSize; /* Calc aXlutAdrSize^aXlutInDim */ 00465 Size = Size*aXlutOutDim; 00466 sprintf(FileNameBuffer,"DoNDim Xlut%d",FileCount); 00467 stream1=fopen(FileNameBuffer,"wb"); /* oeffne Schreibedatei */ 00468 if(stream1 == NULL){ 00469 DebugPrint("Open %s failed \n",FileNameBuffer); 00470 return; 00471 } 00472 lMax=0; 00473 if( WordSize == 2 ){ for(i=0; i<Size; ++i)if( lMax < Xlut[i] )lMax = Xlut[i];} 00474 else{ for(i=0; i<Size; ++i)if( lMax < ((UINT8 *)Xlut)[i] )lMax = ((UINT8 *)Xlut)[i];} 00475 sprintf(FileNameBuffer,"%s InputDimension=%d OutputDimension=%d AdrSize=%ld EndWert=%ld WordSize=%ld", 00476 FileNameBuffer,aXlutInDim,aXlutOutDim,aXlutAdrSize,lMax,aXlutWordSize); 00477 i=strlen( FileNameBuffer )+1; 00478 for( ii=i; ii<((i+15)/16)*16; ii++)FileNameBuffer[ii-1]=' '; 00479 FileNameBuffer[ii-1]='\0'; 00480 l=fprintf(stream1,"%s\n",FileNameBuffer); 00481 00482 if(fwrite(Xlut,WordSize,Size,stream1) != Size){ 00483 DebugPrint("Write Error %s\n",FileNameBuffer); 00484 return; 00485 } 00486 fclose(stream1); 00487 Size = aAlutAdrSize*aXlutOutDim; 00488 sprintf(FileNameBuffer,"DoNDim Alut%d",FileCount); 00489 stream1=fopen(FileNameBuffer,"wb"); /* oeffne Schreibedatei */ 00490 if(stream1 == NULL){ 00491 DebugPrint("Open %s failed \n",FileNameBuffer); 00492 return; 00493 } 00494 lMax=0; 00495 if( WordSize == 2 ){ for(i=0; i<Size; ++i)if( lMax < Alut[i] )lMax = Alut[i];} 00496 else{ for(i=0; i<Size; ++i)if( lMax < ((UINT8 *)Alut)[i] )lMax = ((UINT8 *)Alut)[i];} 00497 sprintf(FileNameBuffer,"%s InputDimension=%d OutputDimension=%d AdrSize=%ld EndWert=%ld WordSize=%ld", 00498 FileNameBuffer,aXlutOutDim,aXlutOutDim,aAlutAdrSize,lMax,aAlutWordSize); 00499 i=strlen( FileNameBuffer )+1; 00500 for( ii=i; ii<((i+15)/16)*16; ii++)FileNameBuffer[ii-1]=' '; 00501 FileNameBuffer[ii-1]='\0'; 00502 l=fprintf(stream1,"%s\n",FileNameBuffer); 00503 00504 if(fwrite(Alut,WordSize,Size,stream1) != Size){ 00505 DebugPrint("Write Error %s\n",FileNameBuffer); 00506 return; 00507 } 00508 fclose(stream1); 00509 FileCount++; 00510 } 00511 #endif

Generated on Sat May 15 19:39:46 2004 for test by doxygen 1.3.7