01586 {
01587
CSIG ColorSpace,
Intent;
01588
BOOL Success =
FALSE;
01589
DWORD dwSaveSize;
01590
if (!cp)
01591
return Success;
01592
01593
if (!
GetCPDevSpace (cp, (LPCSIG) & ColorSpace) ||
01594 !
GetCPRenderIntent (cp, (LPCSIG) & Intent))
01595 {
01596
return Success;
01597 }
01598 dwSaveSize = *lpcbSize;
01599
if (InputIntent ==
icUseRenderingIntent)
01600 InputIntent = (
DWORD)
Intent;
01601
01602
01603
if ((
CSIG) InputIntent ==
Intent)
01604 {
01605 Success =
GetCSAFromProfile (cp, lpBuffer, lpcbSize,
01606 InpDrvClrSp, ColorSpace, AllowBinary);
01607 }
01608
if (!Success)
01609 {
01610
switch (ColorSpace)
01611 {
01612
case icSigRgbData:
01613 Success =
GetPS2CSA_DEFG_Intent (cp, lpBuffer, lpcbSize,
01614 InpDrvClrSp, (CSIG) InputIntent,
01615 TYPE_CIEBASEDDEF, AllowBinary);
01616
if (Success)
01617 {
01618
01619
01620
DWORD cbNewSize = 0;
01621
MEMPTR lpNewBuffer;
01622
MEMPTR lpOldBuffer;
01623
if (lpBuffer)
01624 {
01625 lpNewBuffer = lpBuffer + *lpcbSize;
01626 lpOldBuffer = lpNewBuffer;
01627 lpNewBuffer +=
WriteObject (lpNewBuffer, NewLine);
01628 cbNewSize = dwSaveSize - (
DWORD) (lpNewBuffer - lpBuffer);
01629 }
else
01630 lpNewBuffer =
NULL;
01631
01632
if (!
GetPS2CSA_ABC (cp, lpNewBuffer, &cbNewSize,
01633 (CSIG)InputIntent, InpDrvClrSp,
01634 AllowBinary, 1))
01635
GetDeviceRGB (lpNewBuffer, &cbNewSize, InpDrvClrSp, 1);
01636
01637
if (lpBuffer)
01638 {
01639 lpNewBuffer += cbNewSize;
01640 *lpcbSize += (
DWORD) (lpNewBuffer - lpOldBuffer);
01641 }
else
01642 *lpcbSize += cbNewSize;
01643
01644 }
01645
if (!Success)
01646 {
01647 Success =
GetPS2CSA_ABC (cp, lpBuffer, lpcbSize,
01648 (CSIG)InputIntent, InpDrvClrSp,
01649 AllowBinary, 0);
01650 }
01651
if (!Success)
01652 {
01653 Success =
GetDeviceRGB (lpBuffer, lpcbSize, InpDrvClrSp, 0);
01654 Success =
FALSE;
01655 }
01656
break;
01657
case icSigCmykData:
01658 Success =
GetPS2CSA_DEFG_Intent (cp, lpBuffer, lpcbSize,
01659 InpDrvClrSp, (CSIG) InputIntent,
01660 TYPE_CIEBASEDDEFG, AllowBinary);
01661
if (Success)
01662 {
01663
01664
DWORD cbNewSize = 0;
01665
MEMPTR lpNewBuffer;
01666
MEMPTR lpOldBuffer;
01667
if (lpBuffer)
01668 {
01669 lpNewBuffer = lpBuffer + *lpcbSize;
01670 lpOldBuffer = lpNewBuffer;
01671 lpNewBuffer +=
WriteObject (lpNewBuffer, NewLine);
01672 lpNewBuffer +=
WriteNewLineObject (lpNewBuffer, NotSupportDEFG_S);
01673 cbNewSize = dwSaveSize - (
DWORD) (lpNewBuffer - lpBuffer);
01674 }
else
01675 lpNewBuffer =
NULL;
01676
01677
GetDeviceCMYK (lpNewBuffer, &cbNewSize, InpDrvClrSp);
01678
01679
if (lpBuffer)
01680 {
01681 lpNewBuffer += cbNewSize;
01682 lpNewBuffer +=
WriteNewLineObject (lpNewBuffer, SupportDEFG_E);
01683 *lpcbSize += (
DWORD) (lpNewBuffer - lpOldBuffer);
01684 }
else
01685 *lpcbSize += cbNewSize;
01686 }
01687
if (!Success)
01688 {
01689 Success =
GetDeviceCMYK (lpBuffer, lpcbSize, InpDrvClrSp);
01690 Success =
FALSE;
01691 }
01692
break;
01693
case icSigGrayData:
01694 Success =
GetPS2CSA_MONO (cp, lpBuffer, lpcbSize, InpDrvClrSp,
01695 (CSIG)InputIntent, AllowBinary);
01696
if (!Success)
01697 {
01698 Success =
GetDeviceGray (lpBuffer, lpcbSize, InpDrvClrSp);
01699 Success =
FALSE;
01700 }
01701
break;
01702
case icSigLabData:
01703 Success =
GetPS2CSA_DEFG_Intent (cp, lpBuffer, lpcbSize,
01704 InpDrvClrSp, (CSIG) InputIntent,
01705 TYPE_CIEBASEDDEF, AllowBinary);
01706
if (Success)
01707 {
01708
01709
01710
DWORD cbNewSize = 0;
01711
MEMPTR lpNewBuffer;
01712
MEMPTR lpOldBuffer;
01713
if (lpBuffer)
01714 {
01715 lpNewBuffer = lpBuffer + *lpcbSize;
01716 lpOldBuffer = lpNewBuffer;
01717 lpNewBuffer +=
WriteObject (lpNewBuffer, NewLine);
01718 lpNewBuffer +=
WriteNewLineObject (lpNewBuffer, NotSupportDEFG_S);
01719 cbNewSize = dwSaveSize - (
DWORD) (lpNewBuffer - lpBuffer);
01720 }
else
01721 lpNewBuffer =
NULL;
01722
01723
GetPS2CSA_ABC_LAB (cp, lpNewBuffer, &cbNewSize,
01724 (CSIG)InputIntent, InpDrvClrSp, AllowBinary);
01725
01726
if (lpBuffer)
01727 {
01728 lpNewBuffer += cbNewSize;
01729 lpNewBuffer +=
WriteNewLineObject (lpNewBuffer, SupportDEFG_E);
01730 *lpcbSize += (
DWORD) (lpNewBuffer - lpOldBuffer);
01731 }
else
01732 *lpcbSize += cbNewSize;
01733 }
01734
if (!Success)
01735 {
01736 Success =
GetPS2CSA_ABC_LAB (cp, lpBuffer, lpcbSize,
01737 (CSIG)InputIntent, InpDrvClrSp, AllowBinary);
01738 }
01739
break;
01740
01741
default:
01742
break;
01743 }
01744 }
01745
return Success;
01746 }