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

memlink.h File Reference

Go to the source code of this file.

Classes

struct  LHTextType
struct  LHTextDescriptionType
struct  MyDoubleXYZ

Defines

#define Round(a)   (((a)>0.)?((a)+.5):((a)-.5))

Typedefs

typedef icXYZNumber MyXYZNumber
typedef LHTextType LHTextType
typedef LHTextDescriptionType LHTextDescriptionType

Functions

CMError MyGetColorSpaces (CMConcatProfileSet *profileSet, UINT32 *sCS, UINT32 *dCS)
void MakeMyDoubleXYZ (MyXYZNumber *x, MyDoubleXYZ *ret)
CMError MyAdd_NL_Header (UINT32 theSize, icHeader *linkHeader, UINT32 aIntent, UINT32 aClass, UINT32 aColorSpace, UINT32 aConnectionSpace)
CMError MyAdd_NL_DescriptionTag (LHTextDescriptionType *descPtr, unsigned char *theText)
CMError MyAdd_NL_ColorantTag (icXYZType *descPtr, MyXYZNumber *aColor)
CMError MyAdd_NL_CurveTag (icCurveType *descPtr, unsigned short Gamma)
CMError MyAdd_NL_CopyrightTag (unsigned char *copyrightText, LHTextType *aLHTextType)
CMError MyAdd_NL_SequenceDescTag (CMConcatProfileSet *profileSet, icProfileSequenceDescType *pSeqPtr, long *aSize)
CMError MyAdd_NL_AToB0Tag_mft1 (CMMModelPtr cw, icLut8Type *lutPtr, long colorLutSize)
CMError MyAdd_NL_AToB0Tag_mft2 (CMMModelPtr cw, icLut16Type *lutPtr, long colorLutSize)
CMError MyAdd_NL_HeaderMS (UINT32 theSize, icHeader *linkHeader, unsigned long aIntent, icColorSpaceSignature sCS, icColorSpaceSignature dCS)
CMError DeviceLinkFill (CMMModelPtr cw, CMConcatProfileSet *profileSet, icProfile **theProf, unsigned long aIntent)


Define Documentation

#define Round  )     (((a)>0.)?((a)+.5):((a)-.5))
 

Definition at line 32 of file lh_core/memlink.h.


Typedef Documentation

typedef struct LHTextDescriptionType LHTextDescriptionType
 

Definition at line 24 of file lh_core/memlink.h.

typedef struct LHTextType LHTextType
 

Definition at line 11 of file lh_core/memlink.h.

typedef icXYZNumber MyXYZNumber
 

Definition at line 4 of file lh_core/memlink.h.

Referenced by MyAdd_NL_ColorantTag().


Function Documentation

CMError DeviceLinkFill CMMModelPtr  cw,
CMConcatProfileSet profileSet,
icProfile **  theProf,
unsigned long  aIntent
 

Definition at line 1281 of file lh_core/memlink.c.

01285 { 01286 CMError err = unimpErr; 01287 OSErr aOSerr = unimpErr; 01288 #ifdef __MWERKS__ 01289 unsigned char theText[] = "\pDeviceLink profile "; 01290 char copyrightText[] = "\p�1996 by Heidelberger Druckmaschinen AG U.J.K."; 01291 #elif __IS_MSDOS 01292 char theText[] = "\030DeviceLink profile "; 01293 char copyrightText[] = "\060�1996 by Heidelberger Druckmaschinen AG U.J.K."; 01294 #else 01295 char theText[] = "\030DeviceLink profile "; 01296 char copyrightText[] = "\060�1996 by Heidelberger Druckmaschinen AG U.J.K."; 01297 #endif 01298 icProfile *aProf=0; 01299 long theTagTabSize; 01300 long theHeaderSize; 01301 long theDescSize; 01302 long theMediaSize; 01303 long theSequenceDescSize; 01304 long theA2B0Size; 01305 long theCopyRightSize; 01306 long currentSize=0; 01307 long theTotalSize=0; 01308 icTag aTag; 01309 UINT32 sCS,dCS,clutSize; 01310 Ptr aPtr=0; 01311 01312 MyDoubleXYZ D50XYZ = { 0.9642, 1.0000, 0.8249 }; 01313 MyXYZNumber D50 = { (unsigned long)(0.9642 * 65536), (unsigned long)(1.0000 * 65536), (unsigned long)(0.8249 * 65536)}; 01314 theHeaderSize = sizeof(icHeader); 01315 theDescSize = sizeof(OSType) /* type descriptor */ 01316 + sizeof(unsigned long) /* reserved */ 01317 + sizeof(unsigned long) /* ASCII length */ 01318 + theText[0] /* ASCII profile description */ 01319 + sizeof(unsigned long) /* Unicode code */ 01320 + sizeof(unsigned long) /* Unicode character count */ 01321 + sizeof(unsigned short) /* Macintosh script code */ 01322 + sizeof(unsigned char) /* Macintosh string length */ 01323 + 67 /* Macintosh string */ 01324 ; 01325 theCopyRightSize = sizeof(OSType) /* type descriptor */ 01326 + sizeof(unsigned long) /* reserved */ 01327 + copyrightText[0] /* ASCII profile description */ 01328 ; 01329 theMediaSize = sizeof( icXYZType );; 01330 01331 theTagTabSize = MyTagCountLink * sizeof( icTag ) + sizeof( unsigned long ); 01332 01333 *theProf = 0; 01334 01335 if( cw->hasNamedColorProf != NoNamedColorProfile ){ 01336 err = cmProfileError; 01337 goto CleanupAndExit; 01338 } 01339 err = MyGetColorSpaces( profileSet, &sCS, &dCS ); 01340 if (err) 01341 goto CleanupAndExit; 01342 01343 aProf = (icProfile *)SmartNewPtrClear( LINK_BUFFER_MAX, &aOSerr ); 01344 err = aOSerr; 01345 if (err) 01346 goto CleanupAndExit; 01347 01348 err = MyAdd_NL_Header(theTotalSize, (icHeader*)((Ptr)aProf+currentSize), aIntent, icSigLinkClass, sCS, dCS ); 01349 if (err) 01350 goto CleanupAndExit; 01351 01352 /*----------------------------------------------------------------------------------------- cmProfileDescriptionTag */ 01353 currentSize = theHeaderSize + theTagTabSize; 01354 CMHelperICC2int32Const(&(aProf->tagList.count ), MyTagCountLink); 01355 01356 CMHelperICC2int32Const(&(aTag.sig ), icSigProfileDescriptionTag); 01357 CMHelperICC2int32Const(&(aTag.offset ), currentSize); 01358 CMHelperICC2int32Const(&(aTag.size ), theDescSize); 01359 aProf->tagList.tags[0] = aTag; 01360 err =MyAdd_NL_DescriptionTag ( (LHTextDescriptionType *)((Ptr)aProf+currentSize), (unsigned char *)theText ); 01361 if (err) 01362 goto CleanupAndExit; 01363 currentSize += theDescSize; 01364 currentSize = ( currentSize + 3 ) & ~ 3; 01365 01366 CMHelperICC2int32Const(&(aTag.sig ), icSigMediaWhitePointTag); 01367 CMHelperICC2int32Const(&(aTag.offset ), currentSize ); 01368 CMHelperICC2int32Const(&(aTag.size ), theMediaSize); 01369 aProf->tagList.tags[1] = aTag; 01370 MyAdd_NL_ColorantTag((icXYZType *)((Ptr)aProf+currentSize), &D50); 01371 currentSize += theMediaSize; 01372 currentSize = ( currentSize + 3 ) & ~ 3; 01373 01374 CMHelperICC2int32Const(&(aTag.sig ), icSigCopyrightTag); 01375 CMHelperICC2int32Const(&(aTag.offset ), currentSize ); 01376 CMHelperICC2int32Const(&(aTag.size ), theCopyRightSize); 01377 aProf->tagList.tags[2] = aTag; 01378 err = MyAdd_NL_CopyrightTag( (unsigned char *)copyrightText, (LHTextType *)((Ptr)aProf+currentSize)); 01379 if (err) 01380 goto CleanupAndExit; 01381 currentSize += theCopyRightSize; 01382 currentSize = ( currentSize + 3 ) & ~ 3; 01383 01384 err = MyAdd_NL_SequenceDescTag( profileSet, (icProfileSequenceDescType *)((Ptr)aProf+currentSize), &theSequenceDescSize ); 01385 CMHelperICC2int32Const(&(aTag.sig ), icSigProfileSequenceDescTag); 01386 CMHelperICC2int32Const(&(aTag.offset ), currentSize ); 01387 CMHelperICC2int32Const(&(aTag.size ), theSequenceDescSize); 01388 aProf->tagList.tags[3] = aTag; 01389 currentSize += theSequenceDescSize; 01390 currentSize = ( currentSize + 3 ) & ~ 3; 01391 01392 theA2B0Size = GetSizes( (CMMModelPtr)cw, &clutSize ); 01393 01394 CMHelperICC2int32Const(&(aTag.sig ), icSigAToB0Tag); 01395 CMHelperICC2int32Const(&(aTag.offset ), currentSize ); 01396 CMHelperICC2int32Const(&(aTag.size ), theA2B0Size); 01397 aProf->tagList.tags[4] = aTag; 01398 01399 #if __IS_MSDOS 01400 aPtr = GlobalAllocPtr( GHND, theA2B0Size+currentSize ); 01401 if( aPtr == 0 ){ 01402 err = GetLastError(); 01403 goto CleanupAndExit; 01404 } 01405 #else 01406 aPtr = SmartNewPtr( theA2B0Size+currentSize, &aOSerr ); 01407 err = aOSerr; 01408 if( err ){ 01409 goto CleanupAndExit; 01410 } 01411 #endif 01412 01413 01414 if ( cw->lutParam.colorLutWordSize == 8 ) 01415 err = MyAdd_NL_AToB0Tag_mft1( (CMMModelPtr)cw, (icLut8Type *)(aPtr+currentSize), clutSize ); 01416 else 01417 err = MyAdd_NL_AToB0Tag_mft2( (CMMModelPtr)cw, (icLut16Type *)(aPtr+currentSize), clutSize ); 01418 01419 if (err) 01420 goto CleanupAndExit; 01421 01422 BlockMove( (Ptr)aProf, aPtr, currentSize ); 01423 aProf = (icProfile *)DisposeIfPtr( (Ptr)aProf ); 01424 01425 CMHelperICC2int32Const( aPtr, theA2B0Size+currentSize ); 01426 01427 *theProf = (icProfile *)aPtr; 01428 #ifdef WRITE_PROFILE 01429 WriteProf( "DeviceLinkFill.pf", (icProfile *)aPtr, theA2B0Size+currentSize ); 01430 #endif 01431 return noErr; 01432 01433 CleanupAndExit: 01434 *theProf = (icProfile *)DisposeIfPtr( (Ptr)aProf ); 01435 #if __IS_MSDOS 01436 if( aPtr )GlobalFreePtr( aPtr ); 01437 #else 01438 aPtr = DisposeIfPtr( (Ptr)aPtr ); 01439 #endif 01440 return err; 01441 }

void MakeMyDoubleXYZ MyXYZNumber x,
MyDoubleXYZ ret
 

CMError MyAdd_NL_AToB0Tag_mft1 CMMModelPtr  cw,
icLut8Type lutPtr,
long  colorLutSize
 

Definition at line 521 of file lh_core/memlink.c.

00522 { 00523 CMError err; 00524 icLut8 *tempLutPtr; 00525 long offset; 00526 UINT16 inputChannels; 00527 UINT16 outputChannels; 00528 UINT16 gridPoints; 00529 00530 LH_START_PROC("Add_NL_AToB0Tag_mft1") 00531 00532 LOCK_DATA(cw->lutParam.inputLut); 00533 LOCK_DATA(cw->lutParam.colorLut); 00534 LOCK_DATA(cw->lutParam.outputLut); 00535 00536 inputChannels = (UINT16)cw->lutParam.colorLutInDim; 00537 outputChannels = (UINT16)cw->lutParam.colorLutOutDim; 00538 gridPoints = (UINT16)cw->lutParam.colorLutGridPoints; 00539 00540 tempLutPtr = &lutPtr->lut; 00541 CMHelperICC2int32Const(&(lutPtr->base ), icSigLut8Type); 00542 CMHelperICC2int32Const((OSType*)&(lutPtr->base )+1, 0); 00543 tempLutPtr->inputChan = (UINT8)inputChannels; 00544 tempLutPtr->outputChan = (UINT8)outputChannels; 00545 tempLutPtr->clutPoints = (UINT8)gridPoints; 00546 tempLutPtr->e00 = tempLutPtr->e01 = tempLutPtr->e02 = 0; 00547 tempLutPtr->e10 = tempLutPtr->e11 = tempLutPtr->e12 = 0; 00548 tempLutPtr->e20 = tempLutPtr->e21 = tempLutPtr->e22 = 0; 00549 CMHelperICC2int32Const(&(tempLutPtr->e00 ), 0x10000); 00550 CMHelperICC2int32Const(&(tempLutPtr->e11 ), 0x10000); 00551 CMHelperICC2int32Const(&(tempLutPtr->e22 ), 0x10000); 00552 00553 err = Fill_mft1_InputTable((Ptr)DATA_2_PTR(cw->lutParam.inputLut), tempLutPtr, cw); 00554 if (err) 00555 goto CleanupAndExit; 00556 00557 offset = 256 * inputChannels; 00558 BlockMoveData( DATA_2_PTR(cw->lutParam.colorLut), & tempLutPtr->data[0] + offset, colorLutSize); 00559 00560 offset = offset + colorLutSize; 00561 err = Fill_mft1_OutputTable((Ptr)DATA_2_PTR(cw->lutParam.outputLut), tempLutPtr, offset, cw); 00562 if (err) 00563 goto CleanupAndExit; 00564 00565 CleanupAndExit: 00566 00567 #ifdef DEBUG_OUTPUT 00568 if ( err ) 00569 DebugPrint("� MyAdd_NL_AToB0Tag_mft1-Error: result = %d\n",err); 00570 #endif 00571 UNLOCK_DATA(cw->lutParam.inputLut); 00572 UNLOCK_DATA(cw->lutParam.colorLut); 00573 UNLOCK_DATA(cw->lutParam.outputLut); 00574 LH_END_PROC("Add_NL_AToB0Tag_mft1") 00575 return err; 00576 }

CMError MyAdd_NL_AToB0Tag_mft2 CMMModelPtr  cw,
icLut16Type lutPtr,
long  colorLutSize
 

Definition at line 619 of file lh_core/memlink.c.

00620 { 00621 CMError err; 00622 icLut16 *tempLutPtr; 00623 long offset; 00624 UINT16 inputChannels; 00625 UINT16 outputChannels; 00626 UINT16 gridPoints; 00627 00628 LH_START_PROC("Add_NL_AToB0Tag_mft2") 00629 00630 LOCK_DATA(cw->lutParam.inputLut); 00631 LOCK_DATA(cw->lutParam.colorLut); 00632 LOCK_DATA(cw->lutParam.outputLut); 00633 00634 inputChannels = (UINT16)cw->lutParam.colorLutInDim; 00635 outputChannels = (UINT16)cw->lutParam.colorLutOutDim; 00636 gridPoints = (UINT16)cw->lutParam.colorLutGridPoints; 00637 00638 tempLutPtr = &lutPtr->lut; 00639 CMHelperICC2int32Const(&(lutPtr->base ), icSigLut16Type); 00640 CMHelperICC2int32Const((OSType*)&(lutPtr->base )+1, 0); 00641 tempLutPtr->inputChan = (UINT8)inputChannels; 00642 tempLutPtr->outputChan = (UINT8)outputChannels; 00643 tempLutPtr->clutPoints = (UINT8)((gridPoints>255)?255:gridPoints); 00644 tempLutPtr->e00 = tempLutPtr->e01 = tempLutPtr->e02 = 0; 00645 tempLutPtr->e10 = tempLutPtr->e11 = tempLutPtr->e12 = 0; 00646 tempLutPtr->e20 = tempLutPtr->e21 = tempLutPtr->e22 = 0; 00647 CMHelperICC2int32Const(&(tempLutPtr->e00 ), 0x10000); 00648 CMHelperICC2int32Const(&(tempLutPtr->e11 ), 0x10000); 00649 CMHelperICC2int32Const(&(tempLutPtr->e22 ), 0x10000); 00650 00651 tempLutPtr->inputEnt = (UINT16)cw->lutParam.inputLutEntryCount; 00652 tempLutPtr->outputEnt = (UINT16)cw->lutParam.outputLutEntryCount; 00653 err = Fill_mft2_InputTable((Ptr)DATA_2_PTR(cw->lutParam.inputLut), tempLutPtr, cw); 00654 if (err) 00655 goto CleanupAndExit; 00656 00657 offset = cw->lutParam.inputLutEntryCount * inputChannels; 00658 Fill_mft2_ColorTable( (Ptr)DATA_2_PTR(cw->lutParam.colorLut), tempLutPtr, offset, colorLutSize); 00659 00660 offset = offset + colorLutSize; 00661 err = Fill_mft2_OutputTable((Ptr)DATA_2_PTR(cw->lutParam.outputLut), tempLutPtr, offset, cw); 00662 if (err) 00663 goto CleanupAndExit; 00664 00665 CMHelperICC2int16Const(&(tempLutPtr->inputEnt ), (UINT16)cw->lutParam.inputLutEntryCount); 00666 CMHelperICC2int16Const(&(tempLutPtr->outputEnt ), (UINT16)cw->lutParam.outputLutEntryCount); 00667 00668 CleanupAndExit: 00669 00670 #ifdef DEBUG_OUTPUT 00671 if ( err ) 00672 DebugPrint("� MyAdd_NL_AToB0Tag_mft2-Error: result = %d\n",err); 00673 #endif 00674 UNLOCK_DATA(cw->lutParam.inputLut); 00675 UNLOCK_DATA(cw->lutParam.colorLut); 00676 UNLOCK_DATA(cw->lutParam.outputLut); 00677 LH_END_PROC("Add_NL_AToB0Tag_mft2") 00678 return err; 00679 }

CMError MyAdd_NL_ColorantTag icXYZType descPtr,
MyXYZNumber aColor
 

Definition at line 222 of file lh_core/memlink.c.

00223 { 00224 OSErr err = noErr; 00225 00226 CMHelperICC2int32Const(&(descPtr->base ), icSigXYZType); 00227 CMHelperICC2int32Const((OSType*)&(descPtr->base )+1, 0); 00228 CMHelperICC2int32(&(descPtr->data.data[0].X ), &aColor->X); 00229 CMHelperICC2int32(&(descPtr->data.data[0].Y ), &aColor->Y); 00230 CMHelperICC2int32(&(descPtr->data.data[0].Z ), &aColor->Z); 00231 return err; 00232 }

CMError MyAdd_NL_CopyrightTag unsigned char *  copyrightText,
LHTextType aLHTextType
 

Definition at line 245 of file lh_core/memlink.c.

00246 { 00247 OSErr err=noErr; 00248 00249 copyrightText[copyrightText[0]] = 0x00; 00250 CMHelperICC2int32Const(&(aLHTextType->base ), icSigTextType); 00251 CMHelperICC2int32Const((OSType*)&(aLHTextType->base )+1, 0); 00252 BlockMove(&copyrightText[1], &aLHTextType->text[0], copyrightText[0]); 00253 00254 #ifdef DEBUG_OUTPUT 00255 if ( err && DebugCheck(kThisFile, kDebugErrorInfo) ) 00256 DebugPrint("� MyAdd_NL_CopyrightTag-Error: result = %d\n",err); 00257 #endif 00258 return err; 00259 }

CMError MyAdd_NL_CurveTag icCurveType descPtr,
unsigned short  Gamma
 

Definition at line 234 of file lh_core/memlink.c.

00235 { 00236 OSErr err = noErr; 00237 00238 CMHelperICC2int32Const(&(descPtr->base ), icSigCurveType); 00239 CMHelperICC2int32Const((OSType*)&(descPtr->base )+1, 0); 00240 CMHelperICC2int32Const(&(descPtr->curve.count ), 1); 00241 CMHelperICC2int16(&(descPtr->curve.data[0] ), &Gamma ); 00242 return err; 00243 }

CMError MyAdd_NL_DescriptionTag LHTextDescriptionType descPtr,
unsigned char *  theText
 

Definition at line 178 of file lh_core/memlink.c.

00179 { 00180 Ptr thePtr; 00181 OSErr err = noErr; 00182 00183 theText[theText[0]] = 0x00; 00184 00185 /*descPtr = (LHTextDescriptionType*)NewPtrClear( theSize ); */ 00186 if (descPtr == 0) 00187 return -1; 00188 00189 /*------------------------------------------------------------------------ ASCII */ 00190 CMHelperICC2int32Const(&(descPtr->typeDescriptor ), icSigTextDescriptionType); 00191 CMHelperICC2int32Const(&(descPtr->reserved ), 0); 00192 CMHelperICC2int32Const(&(descPtr->ASCIICount ), (long)theText[0]); 00193 thePtr = (Ptr) &descPtr->ASCIIName[0]; 00194 BlockMove(&theText[1], thePtr, theText[0]); 00195 thePtr += theText[0]; 00196 00197 /*------------------------------------------------------------------------ Unicode */ 00199 /*thePtr+=sizeof(unsigned long); */ 00200 *thePtr++ = 0; 00201 *thePtr++ = 0; 00202 *thePtr++ = 0; 00203 *thePtr++ = 0; 00205 /*thePtr+=sizeof(unsigned long); */ 00206 *thePtr++ = 0; 00207 *thePtr++ = 0; 00208 *thePtr++ = 0; 00209 *thePtr++ = 0; 00210 /*BlockMove(&theText[1], thePtr, theText[0]); //Unicode string */ 00211 /*thePtr += theText[0]; */ 00212 00213 /*------------------------------------------------------------------------ Macintosh */ 00216 *thePtr++ = 0; 00217 *thePtr++ = 0; 00218 BlockMove(&theText[0], thePtr, theText[0]+1); 00219 return err; 00220 }

CMError MyAdd_NL_Header UINT32  theSize,
icHeader linkHeader,
UINT32  aIntent,
UINT32  aClass,
UINT32  aColorSpace,
UINT32  aConnectionSpace
 

Definition at line 53 of file lh_core/memlink.c.

00055 { 00056 OSErr err = noErr; 00057 #if ! __IS_MSDOS 00058 unsigned long secs; 00059 #endif 00060 DateTimeRec datetimeRec; 00061 /*icHeader linkHeader; */ 00062 00063 #if __IS_MSDOS 00064 SYSTEMTIME aSystemTime; 00065 GetLocalTime( (SYSTEMTIME *)&aSystemTime); 00066 datetimeRec.year = aSystemTime.wYear; datetimeRec.month = aSystemTime.wMonth; 00067 datetimeRec.day = aSystemTime.wDay; datetimeRec.hour = aSystemTime.wHour; 00068 datetimeRec.minute = aSystemTime.wMinute; datetimeRec.second = aSystemTime.wSecond; 00069 #else 00070 #if __IS_MAC 00071 GetDateTime(&secs); 00072 SecondsToDate(secs, &datetimeRec);/* Secs2Date (link.*)=(.*); CMHelperICC2int32(\&(\1),\2); */ 00073 #else 00074 struct tm* loctime; 00075 time_t long_time; 00076 time( &long_time ); /* Get time as long integer. */ 00077 loctime = localtime(&long_time); 00078 datetimeRec.year = loctime->tm_year; datetimeRec.month = loctime->tm_mon+1; 00079 datetimeRec.day = loctime->tm_mday; datetimeRec.hour = loctime->tm_hour; 00080 datetimeRec.minute = loctime->tm_min; datetimeRec.second = loctime->tm_sec; 00081 #endif 00082 #endif 00083 00084 CMHelperICC2int32Const(&(linkHeader->size ), theSize); /* This is the total size of the CMProfileRef */ 00085 CMHelperICC2int32Const(&(linkHeader->cmmId ), 'Win '); /* CMM signature, Registered with ICC consortium */ 00086 CMHelperICC2int32Const(&(linkHeader->version ), icVersionNumber); /* Version of CMProfile format */ 00087 CMHelperICC2int32Const(&(linkHeader->deviceClass ), aClass); /* input, display, output, devicelink, abstract, or color conversion profile type */ 00088 00089 CMHelperICC2int32Const(&(linkHeader->colorSpace ), aColorSpace); /* color space of data = dataColorSpace of first profile*/ 00090 00091 CMHelperICC2int32Const(&(linkHeader->pcs ), aConnectionSpace); /* profile connection color space = dataColorSpace of last profile*/ 00092 00093 CMHelperICC2int16(&(linkHeader->date.year ), &datetimeRec.year); /* date and time of profile creation */ 00094 CMHelperICC2int16(&(linkHeader->date.month ), &datetimeRec.month); 00095 CMHelperICC2int16(&(linkHeader->date.day ), &datetimeRec.day); 00096 CMHelperICC2int16(&(linkHeader->date.hours ), &datetimeRec.hour); 00097 CMHelperICC2int16(&(linkHeader->date.minutes ), &datetimeRec.minute); 00098 CMHelperICC2int16(&(linkHeader->date.seconds ), &datetimeRec.second); 00099 CMHelperICC2int32Const(&(linkHeader->magic ), icMagicNumber); /* 'acsp' constant ICC file ID */ 00100 CMHelperICC2int32Const(&(linkHeader->platform ), icSigMicrosoft); /* primary profile platform, Registered with ICC consortium */ 00101 CMHelperICC2int32Const(&(linkHeader->flags ), 0); /* profile flags */ 00102 CMHelperICC2int32Const(&(linkHeader->manufacturer ), icSigMicrosoft); /* Registered with ICC consortium */ 00103 CMHelperICC2int32Const(&(linkHeader->model ), 0); /* Registered with ICC consortium */ 00104 CMHelperICC2int32Const(&(linkHeader->attributes[0] ), 0); /* Attributes like paper type */ 00105 CMHelperICC2int32Const(&(linkHeader->attributes[1] ), 0); 00106 CMHelperICC2int32Const(&(linkHeader->renderingIntent ), aIntent ); /* preferred rendering intent of tagged object */ 00107 CMHelperICC2int32Const(&(linkHeader->illuminant.X ), 0.9642 * 65536); /* profile illuminant */ 00108 CMHelperICC2int32Const(&(linkHeader->illuminant.Y ), 1.0000 * 65536); 00109 CMHelperICC2int32Const(&(linkHeader->illuminant.Z ), 0.8249 * 65536); 00110 CMHelperICC2int32Const(&(linkHeader->creator ), 'UJK '); 00111 00112 return err; 00113 }

CMError MyAdd_NL_HeaderMS UINT32  theSize,
icHeader linkHeader,
unsigned long  aIntent,
icColorSpaceSignature  sCS,
icColorSpaceSignature  dCS
 

CMError MyAdd_NL_SequenceDescTag CMConcatProfileSet profileSet,
icProfileSequenceDescType pSeqPtr,
long *  aSize
 

Definition at line 724 of file lh_core/memlink.c.

00727 { 00728 CMError err; 00729 OSErr aOSerr; 00730 /*icProfileSequenceDescType* pSeqPtr = nil;*/ 00731 Ptr thePtr = nil; 00732 icHeader profHeader; 00733 SINT32 loop; 00734 OSType technology; 00735 UINT32 elementSize; 00736 icSignatureType theSignature; 00737 icTextDescriptionType* descPtr = nil; 00738 char descPtrNull[90]={0}; 00739 00740 LH_START_PROC("MyAdd_NL_SequenceDescTag") 00741 00742 CMHelperICC2int32Const(&(((icTextDescriptionType*)descPtrNull)->base ), icSigTextDescriptionType ); 00743 CMHelperICC2int32Const(((OSType*)&((icTextDescriptionType*)descPtrNull)->base )+1, 0); 00744 CMHelperICC2int32Const(&(((icTextDescriptionType*)descPtrNull)->desc.count ), 1 ); 00745 /*pSeqPtr = (icProfileSequenceDescType*)SmartNewPtrClear(5000, &aOSerr); 00746 err = aOSerr; 00747 if (err) 00748 goto CleanupAndExit;*/ 00749 CMHelperICC2int32Const(&(pSeqPtr->base ), icSigProfileSequenceDescType); 00750 CMHelperICC2int32Const((OSType*)&(pSeqPtr->base )+1, 0); 00751 CMHelperICC2int32Const(&(pSeqPtr->desc.count ), profileSet->count ); 00752 thePtr = (Ptr)( (SIZE_T)&(pSeqPtr->desc.count) + sizeof(SINT32) ) ; 00753 00754 for (loop = 0; loop < (SINT32)profileSet->count; loop++) 00755 { 00756 err = CMGetProfileHeader(profileSet->profileSet[loop], (CMCoreProfileHeader *)&profHeader); 00757 if (err) 00758 goto CleanupAndExit; 00759 CMHelperICC2int32Const(thePtr, profHeader.manufacturer); 00760 thePtr += sizeof(OSType); 00761 CMHelperICC2int32Const(thePtr, profHeader.model); 00762 thePtr += sizeof(OSType); 00763 CMHelperICC2int32Const(thePtr, profHeader.attributes[0]); 00764 thePtr += sizeof(UINT32); 00765 CMHelperICC2int32Const(thePtr, profHeader.attributes[1]); 00766 thePtr += sizeof(UINT32); 00767 00768 /* ----------------------------------------------------------------- icSigTechnologyTag */ 00769 technology = 0; 00770 if ( CMGetProfileElement(profileSet->profileSet[loop], icSigTechnologyTag, &elementSize, nil) == noErr) 00771 { 00772 if (elementSize == sizeof(icSigTechnologyTag)) 00773 { 00774 if ( CMGetProfileElement(profileSet->profileSet[loop], icSigTechnologyTag, &elementSize, &theSignature) == noErr) 00775 technology = theSignature.signature; 00776 } 00777 } 00778 *((OSType*)thePtr) = technology; /* signature */ 00779 thePtr += sizeof(OSType); 00780 00781 /* ----------------------------------------------------------------- icSigDeviceMfgDescTag */ 00782 if ( CMGetProfileElement(profileSet->profileSet[loop], icSigDeviceMfgDescTag, &elementSize, nil) == noErr) 00783 { 00784 descPtr = (icTextDescriptionType*)SmartNewPtr(elementSize,&aOSerr); 00785 err = aOSerr; 00786 if (err) 00787 goto CleanupAndExit; 00788 if ( CMGetProfileElement(profileSet->profileSet[loop], icSigDeviceMfgDescTag, &elementSize, descPtr) == noErr) 00789 { 00790 BlockMoveData( descPtr, thePtr, elementSize); 00791 thePtr += elementSize; 00792 } 00793 descPtr = (icTextDescriptionType*)DisposeIfPtr((Ptr)descPtr); 00794 } else 00795 { 00796 BlockMoveData( descPtrNull, thePtr, sizeof(descPtrNull)); 00797 thePtr += sizeof(descPtrNull); 00798 } 00799 /* ----------------------------------------------------------------- icSigDeviceModelDescTag */ 00800 if ( CMGetProfileElement(profileSet->profileSet[loop], icSigDeviceModelDescTag, &elementSize, nil) == noErr) 00801 { 00802 descPtr = (icTextDescriptionType*)SmartNewPtr(elementSize,&aOSerr); 00803 err = aOSerr; 00804 if (err) 00805 goto CleanupAndExit; 00806 if ( CMGetProfileElement(profileSet->profileSet[loop], icSigDeviceModelDescTag, &elementSize, descPtr) == noErr) 00807 { 00808 BlockMoveData( descPtr, thePtr, elementSize); 00809 thePtr += elementSize; 00810 } 00811 descPtr = (icTextDescriptionType*)DisposeIfPtr((Ptr)descPtr); 00812 } else 00813 { 00814 BlockMoveData( descPtrNull, thePtr, sizeof(descPtrNull)); 00815 thePtr += sizeof(descPtrNull); 00816 } 00817 /* ----------------------------------------------------------------- */ 00818 } 00819 00820 //Sundown safe truncation 00821 *aSize = (LONG)((ULONG_PTR)thePtr - (ULONG_PTR)pSeqPtr); 00822 00823 CleanupAndExit: 00824 descPtr = (icTextDescriptionType*)DisposeIfPtr((Ptr)descPtr); 00825 LH_END_PROC("MyAdd_NL_SequenceDescTag") 00826 return err; 00827 }

CMError MyGetColorSpaces CMConcatProfileSet profileSet,
UINT32 sCS,
UINT32 dCS
 


Generated on Sat May 15 19:44:37 2004 for test by doxygen 1.3.7