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

runtime.c File Reference

#include "General.h"
#include "CalcEng.h"
#include "CalcEng1.h"
#include "CalcNDim.h"
#include "Runtime.h"
#include <string.h>

Go to the source code of this file.

Classes

struct  ColorSpaceInfo

Defines

#define kProgressTicks   30 /* .5secs -> min. time between calls of progressproc */
#define kMaxTempBlock   300 * 1024 /* allow max. 300 kByte temp buffer */
#define NewCalcProc(userRoutine)   ((CalcProcUPP) (userRoutine))
#define NewCalcProc1Dim(userRoutine)   ((CalcProc1DimUPP) (userRoutine))
#define CallCalcProc(userRoutine, calcParamPtr, lutParamPtr)   (*(userRoutine))( (calcParamPtr), (lutParamPtr) )
#define Byte_Factor   1
#define POS(x)   ((x) > (0) ? (UINT32)(x) : (UINT32)(-(x)))

Typedefs

typedef ColorSpaceInfo ColorSpaceInfo
typedef CMError(* CalcProcPtr )(CMCalcParamPtr calcParamPtr, CMLutParamPtr lutParamPtr)
typedef CalcProcPtr CalcProcUPP
typedef CMError(* CalcProc1DimPtr )(CMCalcParamPtr calcParamPtr, CMLutParamPtr lutParamPtr, char OutDim)
typedef CalcProc1DimPtr CalcProc1DimUPP

Functions

OSErr Convert5To8 (Ptr dataPtr5, Ptr dataPtr8, SINT32 startLine, SINT32 height, SINT32 width, SINT32 rowBytes5)
OSErr Convert8To5 (Ptr dataPtr8, Ptr dataPtr5, SINT32 startLine, SINT32 height, SINT32 width, SINT32 rowBytes5)
OSErr Convert8To1 (Ptr dataPtr8, Ptr dataPtr5, SINT32 startLine, SINT32 height, SINT32 width, SINT32 rowBytes5)
OSErr Convert16To10 (Ptr dataPtr16, Ptr dataPtr10, SINT32 startLine, SINT32 height, SINT32 width, SINT32 rowBytes10)
OSErr Convert10To16 (Ptr dataPtr10, Ptr dataPtr16, SINT32 startLine, SINT32 height, SINT32 width, SINT32 rowBytes10)
CMError FillLutParam (CMLutParamPtr lutParam, CMMModelPtr modelingData)
CMError FillLutParamChk (CMLutParamPtr lutParam, CMMModelPtr modelingData)
CMError FillCalcParam (CMCalcParamPtr calcParam, const CMBitmap *bitMap, const CMBitmap *matchedBitMap)
CMError FillCalcParamCM (CMCalcParamPtr calcParam, CMLutParamPtr lutParam, CMColor *myColors, SINT32 count)
CMError CheckInputColorSpace (const CMBitmap *bitMap, CMCalcParamPtr calcParam, ColorSpaceInfo *info, OSType inColorSpace, long colorLutInDim)
CMError CheckOutputColorSpace (const CMBitmap *bitMap, CMCalcParamPtr calcParam, ColorSpaceInfo *info, OSType outColorSpace, long colorLutOutDim)
CMError SetOutputColorSpaceInplace (CMCalcParamPtr calcParam, ColorSpaceInfo *info, OSType outColorSpace)
CMError CheckOutputColorSpaceChk (const CMBitmap *bitMap, CMCalcParamPtr calcParam, ColorSpaceInfo *info)
CMError AllocBufferCheckCM (CMCalcParamPtr calcParam, ColorSpaceInfo *info)
CalcProcPtr FindLookupRoutine (const CMLutParam *lutParam, const ColorSpaceInfo *info)
CalcProcPtr FindCalcRoutine (const CMCalcParam *calcParam, const CMLutParam *lutParam, const ColorSpaceInfo *info, const Boolean lookupOnly)
CMError Do8To555Setup (CMCalcParamPtr calcParam, ColorSpaceInfo *info, SINT32 *theLinesAtOnce, long reverseOrder)
CMError Do555To8Setup (CMCalcParamPtr calcParam, ColorSpaceInfo *info, SINT32 *theLinesAtOnce, long reverseOrder)
CMError LHMatchColorsPrivate (CMMModelPtr modelingData, CMColor *myColors, SINT32 count)
CMError LHCheckColorsPrivateMS (CMMModelPtr modelingData, CMColor *myColors, UINT32 count, UINT8 *result)
CMError LHCheckColorsPrivate (CMMModelPtr modelingData, CMColor *myColors, UINT32 count, UINT8 *result)
void CopyIndexData (CMBitmap *bitMapIn, CMBitmap *bitMapOut, ColorSpaceInfo *info)
CMError LHMatchBitMapPrivate (CMMModelPtr modelingData, const CMBitmap *inBitMap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *outBitMap)
CMError LHCheckBitMapPrivate (CMMModelPtr modelingData, const CMBitmap *inBitMap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *outBitMap)
CMError LHMatchBitMapPlanePrivate (CMMModelPtr modelingData, const LH_CMBitmapPlane *bitMapLH, CMBitmapCallBackUPP progressProc, void *refCon, LH_CMBitmapPlane *matchedBitMapLH)
OSErr ConvertNamedIndexToColors (CMMModelPtr modelingData, CMColor *theData, SINT32 pixCnt)
OSErr ConvertNamedIndexToPCS (CMMModelPtr cw, CMColor *theData, SINT32 pixCnt)
OSErr ConvertPCSToNamedIndex (CMMModelPtr modelingData, CMColor *theData, SINT32 pixCnt)
CMError CMConvertNamedIndexToColors (CMWorldRef cw, CMColor *theData, unsigned long pixCnt)
CMError CMConvertNamedIndexToPCS (CMWorldRef cw, CMColor *theData, unsigned long pixCnt)
CMError ConvertLabToIndexBitmap (CMMModelPtr modelingData, Ptr InBuffer, UINT32 processedLinesIn, UINT32 inLineCount, UINT32 width, UINT32 rowBytes)
CMError ConvertIndexToLabBitmap (CMMModelPtr modelingData, Ptr InBuffer, Ptr OutBuffer, UINT32 processedLinesIn, UINT32 lineCount, UINT32 inWidth, UINT32 inRowBytes, UINT32 outRowBytes, UINT32 outputSize)
CMError CMConvNameToIndex (icNamedColor2Type *Data, pcCMColorName Ptr2Name, unsigned long *Arr2Indices, unsigned long count)
CMError CMConvNameToIndexCW (CMWorldRef *Storage, pcCMColorName Ptr2Name, unsigned long *Arr2Indices, unsigned long count)
CMError CMConvNameToIndexProfile (CMProfileRef aProf, pcCMColorName Ptr2Name, unsigned long *Arr2Indices, unsigned long count)
CMError CMConvIndexToName (icNamedColor2Type *Data, unsigned long *Arr2Indices, pCMColorName Ptr2Name, unsigned long count)
CMError CMConvIndexToNameCW (CMWorldRef *Storage, unsigned long *Arr2Indices, pCMColorName Ptr2Name, unsigned long count)
CMError CMConvIndexToNameProfile (CMProfileRef aProf, unsigned long *Arr2Indices, pCMColorName Ptr2Name, unsigned long count)
CMError CMGetNamedProfileInfoProfile (CMProfileRef aProf, pCMNamedProfileInfo Info)
CMError CMGetNamedProfileInfoCW (CMWorldRef *Storage, pCMNamedProfileInfo Info)


Define Documentation

#define Byte_Factor   1
 

Definition at line 625 of file lh_core/runtime.c.

Referenced by CheckInputColorSpace(), and CheckOutputColorSpace().

#define CallCalcProc userRoutine,
calcParamPtr,
lutParamPtr   )     (*(userRoutine))( (calcParamPtr), (lutParamPtr) )
 

Definition at line 78 of file lh_core/runtime.c.

Referenced by LHCheckBitMapPrivate(), LHCheckColorsPrivate(), LHCheckColorsPrivateMS(), LHMatchBitMapPlanePrivate(), LHMatchBitMapPrivate(), and LHMatchColorsPrivate().

#define kMaxTempBlock   300 * 1024 /* allow max. 300 kByte temp buffer */
 

Definition at line 63 of file lh_core/runtime.c.

Referenced by AllocBufferCheckCM(), CheckInputColorSpace(), CheckOutputColorSpace(), CheckOutputColorSpaceChk(), Do555To8Setup(), Do8To555Setup(), LHCheckBitMapPrivate(), and LHMatchBitMapPrivate().

#define kProgressTicks   30 /* .5secs -> min. time between calls of progressproc */
 

Definition at line 62 of file lh_core/runtime.c.

Referenced by LHCheckBitMapPrivate(), and LHMatchBitMapPrivate().

#define NewCalcProc userRoutine   )     ((CalcProcUPP) (userRoutine))
 

Definition at line 74 of file lh_core/runtime.c.

Referenced by FindCalcRoutine(), and FindLookupRoutine().

#define NewCalcProc1Dim userRoutine   )     ((CalcProc1DimUPP) (userRoutine))
 

Definition at line 76 of file lh_core/runtime.c.

#define POS  )     ((x) > (0) ? (UINT32)(x) : (UINT32)(-(x)))
 

Definition at line 4764 of file lh_core/runtime.c.

Referenced by ConvertLabToIndexBitmap(), and ConvertPCSToNamedIndex().


Typedef Documentation

typedef CMError(* CalcProc1DimPtr)(CMCalcParamPtr calcParamPtr, CMLutParamPtr lutParamPtr, char OutDim)
 

Definition at line 70 of file lh_core/runtime.c.

typedef CalcProc1DimPtr CalcProc1DimUPP
 

Definition at line 73 of file lh_core/runtime.c.

typedef CMError(* CalcProcPtr)(CMCalcParamPtr calcParamPtr, CMLutParamPtr lutParamPtr)
 

Definition at line 66 of file lh_core/runtime.c.

Referenced by FindCalcRoutine(), FindLookupRoutine(), LHCheckBitMapPrivate(), LHCheckColorsPrivate(), LHCheckColorsPrivateMS(), LHMatchBitMapPlanePrivate(), LHMatchBitMapPrivate(), and LHMatchColorsPrivate().

typedef CalcProcPtr CalcProcUPP
 

Definition at line 69 of file lh_core/runtime.c.

typedef struct ColorSpaceInfo ColorSpaceInfo
 


Function Documentation

CMError AllocBufferCheckCM CMCalcParamPtr  calcParam,
ColorSpaceInfo info
 

Definition at line 2101 of file lh_core/runtime.c.

References cm8PerChannelPacking, CMError, cmGraySpace, CMCalcParam::cmLineCount, CMCalcParam::cmOutputBytesPerLine, CMCalcParam::cmOutputColorSpace, CMCalcParam::cmOutputPixelOffset, CMCalcParam::cmPixelPerLine, kMaxTempBlock, LH_END_PROC, LH_START_PROC, noErr, ColorSpaceInfo::origSizeOut, CMCalcParam::outputData, ColorSpaceInfo::processedLinesOut, Ptr, SINT16, SINT32, SmartNewPtr(), ColorSpaceInfo::tempOutBuffer, and ColorSpaceInfo::usedSizeOut.

02103 { 02104 CMError err = noErr; 02105 SINT32 newRowBytes; 02106 SINT32 bufferSize; 02107 SINT32 linesAtOnce; 02108 SINT16 iErr = noErr; 02109 02110 LH_START_PROC("AllocBufferCheckCM") 02111 newRowBytes = calcParam->cmPixelPerLine; /* TempBuffer -> 1 byte per pixel */ 02112 linesAtOnce = (kMaxTempBlock) / newRowBytes; 02113 if (linesAtOnce == 0) 02114 linesAtOnce = 1; 02115 else if (linesAtOnce > calcParam->cmLineCount) 02116 linesAtOnce = calcParam->cmLineCount; 02117 02118 bufferSize = newRowBytes * linesAtOnce; 02119 info->processedLinesOut = 0; 02120 info->origSizeOut = 1; 02121 info->usedSizeOut = 8; 02122 info->tempOutBuffer = (void*)SmartNewPtr(bufferSize, &iErr); 02123 if (iErr != noErr) 02124 { 02125 err = iErr; 02126 goto CleanupAndExit; 02127 } 02128 02129 calcParam->cmLineCount = linesAtOnce; 02130 calcParam->cmOutputColorSpace = cmGraySpace|cm8PerChannelPacking; 02131 calcParam->cmOutputBytesPerLine = newRowBytes; 02132 calcParam->outputData[0] = (Ptr)info->tempOutBuffer; 02133 calcParam->cmOutputPixelOffset = 1; 02134 02135 CleanupAndExit: 02136 LH_END_PROC("AllocBufferCheckCM") 02137 return err; 02138 }

CMError CheckInputColorSpace const CMBitmap bitMap,
CMCalcParamPtr  calcParam,
ColorSpaceInfo info,
OSType  inColorSpace,
long  colorLutInDim
 

Definition at line 716 of file lh_core/runtime.c.

References Byte_Factor, cm16PerChannelPacking, cm8PerChannelPacking, cmARGB32Space, cmAYCC32Space, cmBGR24Space, cmBGR32Space, cmBGRSpace, CMBitmapColorSpace, cmCMY24Space, cmCMYK32Space, cmCMYKSpace, CMError, cmGamutResult1Space, cmGamutResultSpace, cmGenericSpace, cmGrayASpace, cmGraySpace, cmHLS32Space, cmHLSSpace, cmHSV32Space, cmHSVSpace, CMCalcParam::cmInputBytesPerLine, CMCalcParam::cmInputColorSpace, CMCalcParam::cmInputPixelOffset, cmInvalidColorSpace, cmInvalidSrcMap, cmKYMC32Space, cmKYMCSpace, cmLAB24Space, cmLAB32Space, cmLABSpace, CMCalcParam::cmLineCount, cmLong10ColorPacking, cmLong8ColorPacking, cmLUV32Space, cmLUVSpace, cmMCEight8Space, cmMCEightSpace, cmMCFive8Space, cmMCFiveSpace, cmMCSeven8Space, cmMCSevenSpace, cmMCSix8Space, cmMCSixSpace, cmNamedIndexed32Space, cmNoSpace, CMCalcParam::cmPixelPerLine, cmRGB16_565Space, cmRGB16Space, cmRGB24Space, cmRGB32Space, cmRGBA32Space, cmRGBASpace, cmRGBSpace, cmWord565ColorPacking, cmWord5ColorPacking, cmXYZ32Space, cmXYZSpace, cmYCC24Space, cmYCC32Space, cmYCCA32Space, cmYCCASpace, cmYCCSpace, cmYXY32Space, cmYXYSpace, Do555To8Setup(), FALSE, icSigCmyData, icSigCmykData, icSigGrayData, icSigHlsData, icSigHsvData, icSigLabData, icSigLuvData, icSigMCH3Data, icSigMCH5Data, icSigMCH6Data, icSigMCH7Data, icSigMCH8Data, icSigNamedData, icSigRgbData, icSigXYZData, icSigYCbCrData, icSigYxyData, CMBitmap::image, CMCalcParam::inputData, ColorSpaceInfo::inputPixelSize, kMaxTempBlock, LH_END_PROC, LH_START_PROC, noErr, ColorSpaceInfo::origSizeIn, ColorSpaceInfo::processedLinesIn, Ptr, SINT16, SINT32, SmartNewPtr(), ColorSpaceInfo::tempInBuffer, UINT8, and ColorSpaceInfo::usedSizeIn.

00721 { 00722 CMError err = noErr; 00723 SINT32 newRowBytes; 00724 SINT32 bufferSize; 00725 SINT32 linesAtOnce; 00726 SINT32 loop; 00727 SINT16 iErr = noErr; 00728 CMBitmapColorSpace inputBitMapColorSpace = calcParam->cmInputColorSpace; 00729 #ifdef ALLOW_16BIT_DATA 00730 UINT8 Byte_Factor=1; 00731 #endif 00732 00733 LH_START_PROC("CheckInputColorSpace") 00734 colorLutInDim=colorLutInDim; 00735 00736 #ifdef ALLOW_16BIT_DATA 00737 if( inputBitMapColorSpace & cm16PerChannelPacking && (inputBitMapColorSpace & 31) != cmGraySpace){ 00738 Byte_Factor = 2; 00739 inputBitMapColorSpace &= ~cm16PerChannelPacking; 00740 inputBitMapColorSpace |= cm8PerChannelPacking; 00741 } 00742 #endif 00743 info->origSizeIn = Byte_Factor*8; 00744 info->usedSizeIn = Byte_Factor*8; 00745 switch ( inputBitMapColorSpace ) 00746 { 00747 case cmNoSpace: 00748 case cmRGBSpace: /* "... bitmap never uses this constant alone..." */ 00749 case cmHSVSpace: /* "... bitmap never uses this constant alone..." */ 00750 case cmHLSSpace: /* "... bitmap never uses this constant alone..." */ 00751 case cmYXYSpace: /* "... bitmap never uses this constant alone..." */ 00752 case cmXYZSpace: /* "... bitmap never uses this constant alone..." */ 00753 case cmLUVSpace: /* "... bitmap never uses this constant alone..." */ 00754 case cmLABSpace: /* "... bitmap never uses this constant alone..." */ 00755 case cmMCFiveSpace: /* "... bitmap never uses this constant alone..." */ 00756 case cmMCSixSpace: /* "... bitmap never uses this constant alone..." */ 00757 case cmMCSevenSpace: /* "... bitmap never uses this constant alone..." */ 00758 case cmMCEightSpace: /* "... bitmap never uses this constant alone..." */ 00759 case cmGamutResultSpace: /* "... bitmap never uses this constant alone..." */ 00760 case cmGamutResult1Space: /* not as colorspace for CMMatchBitmap */ 00761 #ifdef PI_Application_h 00762 case cmYCCSpace: /* "... bitmap never uses this constant alone..." */ 00763 case cmBGRSpace: /* "... bitmap never uses this constant alone..." */ 00764 #endif 00765 err = cmInvalidSrcMap; 00766 break; 00767 case cmCMYKSpace: /* "... bitmap never uses this constant alone..." */ 00768 case cmKYMCSpace: /* "... bitmap never uses this constant alone..." */ 00769 err = cmInvalidSrcMap; 00770 #if ! realThing 00771 if ( (inColorSpace != icSigCmykData) && (inColorSpace != icSigCmyData) ) 00772 err = cmInvalidColorSpace; 00773 else 00774 { 00775 err = noErr; 00776 calcParam->inputData[0] = &bitMap->image[0]; 00777 calcParam->inputData[1] = &bitMap->image[2]; 00778 calcParam->inputData[2] = &bitMap->image[4]; 00779 calcParam->inputData[3] = &bitMap->image[6]; 00780 calcParam->cmInputPixelOffset = 8; 00781 info->origSizeIn = 16; 00782 info->usedSizeIn = 16; 00783 } 00784 #endif 00785 break; 00786 case cmGraySpace: 00787 if (inColorSpace != icSigGrayData) 00788 err = cmInvalidColorSpace; 00789 else 00790 { 00791 calcParam->inputData[0] = &bitMap->image[0]; 00792 calcParam->cmInputPixelOffset = 2; 00793 info->origSizeIn = 16; 00794 info->usedSizeIn = 16; 00795 info->inputPixelSize = 16; 00796 } 00797 break; 00798 case cmGrayASpace: 00799 if (inColorSpace != icSigGrayData) 00800 err = cmInvalidColorSpace; 00801 else 00802 { 00803 calcParam->inputData[0] = &bitMap->image[0]; 00804 calcParam->inputData[1] = &bitMap->image[2]; 00805 calcParam->cmInputPixelOffset = 4; 00806 info->origSizeIn = 16; 00807 info->usedSizeIn = 16; 00808 info->inputPixelSize = 32; 00809 } 00810 break; 00811 case cmLAB24Space: 00812 if (inColorSpace != icSigLabData) 00813 err = cmInvalidColorSpace; 00814 else 00815 { 00816 calcParam->inputData[0] = &bitMap->image[Byte_Factor*0]; 00817 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 00818 calcParam->inputData[2] = &bitMap->image[Byte_Factor*2]; 00819 calcParam->cmInputPixelOffset = Byte_Factor*3; 00820 info->inputPixelSize = Byte_Factor*24; 00821 } 00822 break; 00823 00824 /* separated cmRGB24Space and cmRGB32Space to reflect the bitmap format definition changes. */ 00825 case cmRGB24Space: 00826 if (inColorSpace != icSigRgbData) 00827 err = cmInvalidColorSpace; 00828 else 00829 { 00830 calcParam->inputData[0] = &bitMap->image[Byte_Factor*0]; 00831 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 00832 calcParam->inputData[2] = &bitMap->image[Byte_Factor*2]; 00833 calcParam->cmInputPixelOffset = Byte_Factor*3; 00834 info->inputPixelSize = Byte_Factor*24; 00835 } 00836 break; 00837 case cmRGB32Space: 00838 if (inColorSpace != icSigRgbData) 00839 err = cmInvalidColorSpace; 00840 else 00841 { 00842 calcParam->inputData[0] = &bitMap->image[Byte_Factor*1]; 00843 calcParam->inputData[1] = &bitMap->image[Byte_Factor*2]; 00844 calcParam->inputData[2] = &bitMap->image[Byte_Factor*3]; 00845 calcParam->inputData[3] = &bitMap->image[Byte_Factor*0]; 00846 calcParam->cmInputPixelOffset = Byte_Factor*4; 00847 info->inputPixelSize = Byte_Factor*32; 00848 } 00849 break; 00850 00851 case cmRGBASpace: 00852 case cmRGBA32Space: 00853 if (inColorSpace != icSigRgbData) 00854 err = cmInvalidColorSpace; 00855 else 00856 { 00857 calcParam->inputData[0] = &bitMap->image[Byte_Factor*0]; 00858 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 00859 calcParam->inputData[2] = &bitMap->image[Byte_Factor*2]; 00860 calcParam->inputData[3] = &bitMap->image[Byte_Factor*3]; 00861 calcParam->cmInputPixelOffset = Byte_Factor*4; 00862 info->inputPixelSize = Byte_Factor*32; 00863 } 00864 break; 00865 00866 #ifdef PI_Application_h 00867 00868 case cmGraySpace|cm8PerChannelPacking: 00869 if (inColorSpace != icSigGrayData) 00870 err = cmInvalidColorSpace; 00871 else 00872 { 00873 calcParam->inputData[0] = &bitMap->image[0]; 00874 calcParam->cmInputPixelOffset = 1; 00875 info->origSizeIn = 8; 00876 info->usedSizeIn = 8; 00877 info->inputPixelSize = 8; 00878 } 00879 break; 00880 case cmGrayASpace|cm8PerChannelPacking: 00881 if (inColorSpace != icSigGrayData) 00882 err = cmInvalidColorSpace; 00883 else 00884 { 00885 calcParam->inputData[0] = &bitMap->image[0]; 00886 calcParam->inputData[1] = &bitMap->image[1]; 00887 calcParam->cmInputPixelOffset = 2; 00888 info->origSizeIn = 8; 00889 info->usedSizeIn = 8; 00890 info->inputPixelSize = 16; 00891 } 00892 break; 00893 00894 00895 case cmBGR24Space: 00896 if (inColorSpace != icSigRgbData) 00897 err = cmInvalidColorSpace; 00898 else 00899 { 00900 calcParam->inputData[0] = &bitMap->image[Byte_Factor*2]; 00901 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 00902 calcParam->inputData[2] = &bitMap->image[Byte_Factor*0]; 00903 calcParam->cmInputPixelOffset = Byte_Factor*3; 00904 info->inputPixelSize = Byte_Factor*24; 00905 } 00906 break; 00907 case cmBGR32Space: 00908 if (inColorSpace != icSigRgbData) 00909 err = cmInvalidColorSpace; 00910 else 00911 { 00912 calcParam->inputData[0] = &bitMap->image[Byte_Factor*2]; 00913 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 00914 calcParam->inputData[2] = &bitMap->image[Byte_Factor*0]; 00915 calcParam->inputData[3] = &bitMap->image[Byte_Factor*3]; 00916 calcParam->cmInputPixelOffset = Byte_Factor*4; 00917 info->inputPixelSize = Byte_Factor*32; 00918 } 00919 break; 00920 00921 case cmYCC32Space: 00922 if (inColorSpace != icSigYCbCrData) 00923 err = cmInvalidColorSpace; 00924 else 00925 { 00926 calcParam->inputData[0] = &bitMap->image[Byte_Factor*1]; 00927 calcParam->inputData[1] = &bitMap->image[Byte_Factor*2]; 00928 calcParam->inputData[2] = &bitMap->image[Byte_Factor*3]; 00929 calcParam->inputData[3] = &bitMap->image[Byte_Factor*0]; 00930 calcParam->cmInputPixelOffset = Byte_Factor*4; 00931 info->inputPixelSize = Byte_Factor*32; 00932 } 00933 break; 00934 case cmYCC24Space: 00935 if (inColorSpace != icSigYCbCrData) 00936 err = cmInvalidColorSpace; 00937 else 00938 { 00939 calcParam->inputData[0] = &bitMap->image[Byte_Factor*0]; 00940 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 00941 calcParam->inputData[2] = &bitMap->image[Byte_Factor*2]; 00942 calcParam->cmInputPixelOffset = Byte_Factor*3; 00943 info->inputPixelSize = Byte_Factor*24; 00944 } 00945 break; 00946 00947 case cmYCCASpace: 00948 case cmYCCA32Space: 00949 if (inColorSpace != icSigYCbCrData) 00950 err = cmInvalidColorSpace; 00951 else 00952 { 00953 calcParam->inputData[0] = &bitMap->image[Byte_Factor*0]; 00954 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 00955 calcParam->inputData[2] = &bitMap->image[Byte_Factor*2]; 00956 calcParam->inputData[3] = &bitMap->image[Byte_Factor*3]; 00957 calcParam->cmInputPixelOffset = Byte_Factor*4; 00958 info->inputPixelSize = Byte_Factor*32; 00959 } 00960 break; 00961 case cmAYCC32Space: 00962 if (inColorSpace != icSigYCbCrData) 00963 err = cmInvalidColorSpace; 00964 else 00965 { 00966 calcParam->inputData[0] = &bitMap->image[Byte_Factor*1]; 00967 calcParam->inputData[1] = &bitMap->image[Byte_Factor*2]; 00968 calcParam->inputData[2] = &bitMap->image[Byte_Factor*3]; 00969 calcParam->inputData[3] = &bitMap->image[Byte_Factor*0]; 00970 calcParam->cmInputPixelOffset = Byte_Factor*4; 00971 info->inputPixelSize = Byte_Factor*32; 00972 } 00973 break; 00974 case cmLong8ColorPacking + cmLABSpace: 00975 if (inColorSpace != icSigLabData) 00976 err = cmInvalidColorSpace; 00977 else 00978 { 00979 calcParam->inputData[0] = &bitMap->image[Byte_Factor*0]; 00980 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 00981 calcParam->inputData[2] = &bitMap->image[Byte_Factor*2]; 00982 calcParam->inputData[3] = &bitMap->image[Byte_Factor*3]; 00983 calcParam->cmInputPixelOffset = Byte_Factor*4; 00984 info->inputPixelSize = Byte_Factor*32; 00985 } 00986 break; 00987 case cmLong8ColorPacking + cmXYZSpace: 00988 if (inColorSpace != icSigXYZData) 00989 err = cmInvalidColorSpace; 00990 else 00991 { 00992 calcParam->inputData[0] = &bitMap->image[Byte_Factor*0]; 00993 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 00994 calcParam->inputData[2] = &bitMap->image[Byte_Factor*2]; 00995 calcParam->inputData[3] = &bitMap->image[Byte_Factor*3]; 00996 calcParam->cmInputPixelOffset = Byte_Factor*4; 00997 info->inputPixelSize = Byte_Factor*32; 00998 } 00999 break; 01000 case cmLong8ColorPacking + cmYXYSpace: 01001 if (inColorSpace != icSigYxyData) 01002 err = cmInvalidColorSpace; 01003 else 01004 { 01005 calcParam->inputData[0] = &bitMap->image[Byte_Factor*0]; 01006 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 01007 calcParam->inputData[2] = &bitMap->image[Byte_Factor*2]; 01008 calcParam->inputData[3] = &bitMap->image[Byte_Factor*3]; 01009 calcParam->cmInputPixelOffset = Byte_Factor*4; 01010 info->inputPixelSize = Byte_Factor*32; 01011 } 01012 break; 01013 case cmGenericSpace + cm8PerChannelPacking: 01014 { 01015 for (loop = 0; loop< colorLutInDim; loop++) 01016 calcParam->inputData[loop] = &bitMap->image[Byte_Factor*loop]; 01017 calcParam->cmInputPixelOffset = Byte_Factor*colorLutInDim; 01018 info->inputPixelSize = Byte_Factor*colorLutInDim*8; 01019 } 01020 break; 01021 case cmGenericSpace + cmLong8ColorPacking: 01022 { 01023 for (loop = 0; loop< (colorLutInDim+1); loop++) 01024 calcParam->inputData[loop] = &bitMap->image[Byte_Factor*loop]; 01025 calcParam->cmInputPixelOffset = Byte_Factor*(colorLutInDim+1); 01026 info->inputPixelSize = Byte_Factor*(colorLutInDim+1)*8; 01027 } 01028 break; 01029 case cmCMY24Space: 01030 if ( inColorSpace != icSigCmyData ) 01031 err = cmInvalidColorSpace; 01032 else 01033 { 01034 calcParam->inputData[0] = &bitMap->image[Byte_Factor*0]; 01035 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 01036 calcParam->inputData[2] = &bitMap->image[Byte_Factor*2]; 01037 calcParam->cmInputPixelOffset = Byte_Factor*3; 01038 info->inputPixelSize = Byte_Factor*24; 01039 } 01040 break; 01041 #endif 01042 01043 case cmCMYK32Space: 01044 if ( (inColorSpace != icSigCmykData) && (inColorSpace != icSigCmyData) ) 01045 err = cmInvalidColorSpace; 01046 else 01047 { 01048 calcParam->inputData[0] = &bitMap->image[Byte_Factor*0]; 01049 calcParam->inputData[1] = &bitMap->image[Byte_Factor*1]; 01050 calcParam->inputData[2] = &bitMap->image[Byte_Factor*2]; 01051 calcParam->inputData[3] = &bitMap->image[Byte_Factor*3]; 01052 calcParam->cmInputPixelOffset = Byte_Factor*4; 01053 info->inputPixelSize = Byte_Factor*32; 01054 } 01055 break; 01056 case cmKYMC32Space: 01057 if ( (inColorSpace != icSigCmykData) && (inColorSpace != icSigCmyData) ) 01058 err = cmInvalidColorSpace; 01059 else 01060 { 01061 calcParam->inputData[3] = &bitMap->image[Byte_Factor*0]; 01062 calcParam->inputData[2] = &bitMap->image[Byte_Factor*1]; 01063 calcParam->inputData[1] = &bitMap->image[Byte_Factor*2]; 01064 calcParam->inputData[0] = &bitMap->image[Byte_Factor*3]; 01065 calcParam->cmInputPixelOffset = Byte_Factor*4; 01066 info->inputPixelSize = Byte_Factor*32; 01067 } 01068 break; 01069 case cmARGB32Space: 01070 if (inColorSpace != icSigRgbData) 01071 err = cmInvalidColorSpace; 01072 else 01073 { 01074 calcParam->inputData[0] = &bitMap->image[Byte_Factor*1]; 01075 calcParam->inputData[1] = &bitMap->image[Byte_Factor*2]; 01076 calcParam->inputData[2] = &bitMap->image[Byte_Factor*3]; 01077 calcParam->inputData[3] = &bitMap->image[Byte_Factor*0]; 01078 calcParam->cmInputPixelOffset = Byte_Factor*4; 01079 info->inputPixelSize = Byte_Factor*32; 01080 } 01081 break; 01082 case cmMCFive8Space: 01083 if (inColorSpace != icSigMCH5Data) 01084 err = cmInvalidColorSpace; 01085 else 01086 { 01087 for (loop = 0; loop< 5; loop++) 01088 calcParam->inputData[loop] = &bitMap->image[Byte_Factor*loop]; 01089 calcParam->cmInputPixelOffset = Byte_Factor*5; 01090 info->inputPixelSize = Byte_Factor*40; 01091 } 01092 break; 01093 case cmMCSix8Space: 01094 if (inColorSpace != icSigMCH6Data) 01095 err = cmInvalidColorSpace; 01096 else 01097 { 01098 for (loop = 0; loop< 6; loop++) 01099 calcParam->inputData[loop] = &bitMap->image[Byte_Factor*loop]; 01100 calcParam->cmInputPixelOffset = Byte_Factor*6; 01101 info->inputPixelSize = Byte_Factor*48; 01102 } 01103 break; 01104 case cmMCSeven8Space: 01105 if (inColorSpace != icSigMCH7Data) 01106 err = cmInvalidColorSpace; 01107 else 01108 { 01109 for (loop = 0; loop< 7; loop++) 01110 calcParam->inputData[loop] = &bitMap->image[Byte_Factor*loop]; 01111 calcParam->cmInputPixelOffset = Byte_Factor*7; 01112 info->inputPixelSize = Byte_Factor*56; 01113 } 01114 break; 01115 case cmMCEight8Space: 01116 if (inColorSpace != icSigMCH8Data) 01117 err = cmInvalidColorSpace; 01118 else 01119 { 01120 for (loop = 0; loop< 8; loop++) 01121 calcParam->inputData[loop] = &bitMap->image[Byte_Factor*loop]; 01122 calcParam->cmInputPixelOffset = Byte_Factor*8; 01123 info->inputPixelSize = Byte_Factor*64; 01124 } 01125 break; 01126 #if ( CM_MAX_COLOR_CHANNELS == 15 ) 01127 case cmMC98Space: 01128 case cmMCa8Space: 01129 case cmMCb8Space: 01130 case cmMCc8Space: 01131 case cmMCd8Space: 01132 case cmMCe8Space: 01133 case cmMCf8Space: 01134 case cmMC28Space: 01135 if (inColorSpace != icSigMCH8Data) 01136 err = cmInvalidColorSpace; 01137 else 01138 { 01139 for (loop = 0; loop< 8; loop++) 01140 calcParam->inputData[loop] = &bitMap->image[Byte_Factor*loop]; 01141 calcParam->cmInputPixelOffset = Byte_Factor*8; 01142 info->inputPixelSize = Byte_Factor*64; 01143 } 01144 break; 01145 #endif 01146 #ifdef PI_Application_h 01147 case cmWord5ColorPacking + cmLABSpace: 01148 if (inColorSpace != icSigLabData) 01149 err = cmInvalidColorSpace; 01150 else{ 01151 newRowBytes = calcParam->cmInputBytesPerLine; 01152 err = Do555To8Setup( calcParam, info, &linesAtOnce, 0 ); 01153 if( err ) goto CleanupAndExit; 01154 } 01155 break; 01156 case cmWord5ColorPacking + cmXYZSpace: 01157 if (inColorSpace != icSigXYZData) 01158 err = cmInvalidColorSpace; 01159 else{ 01160 newRowBytes = calcParam->cmInputBytesPerLine; 01161 err = Do555To8Setup( calcParam, info, &linesAtOnce, 0 ); 01162 if( err ) goto CleanupAndExit; 01163 } 01164 break; 01165 case cmWord5ColorPacking + cmYXYSpace: 01166 if (inColorSpace != icSigYxyData) 01167 err = cmInvalidColorSpace; 01168 else{ 01169 newRowBytes = calcParam->cmInputBytesPerLine; 01170 err = Do555To8Setup( calcParam, info, &linesAtOnce, 0 ); 01171 if( err ) goto CleanupAndExit; 01172 } 01173 break; 01174 case cmWord5ColorPacking + cmGenericSpace: 01175 { 01176 newRowBytes = calcParam->cmInputBytesPerLine; 01177 err = Do555To8Setup( calcParam, info, &linesAtOnce, 0 ); 01178 if( err ) goto CleanupAndExit; 01179 } 01180 break; 01181 case cmWord565ColorPacking + cmGenericSpace: 01182 { 01183 newRowBytes = calcParam->cmInputBytesPerLine; 01184 err = Do555To8Setup( calcParam, info, &linesAtOnce, 0 ); 01185 if( err ) goto CleanupAndExit; 01186 info->origSizeIn = 6; 01187 } 01188 break; 01189 case cmWord5ColorPacking + cmBGRSpace: 01190 if (inColorSpace != icSigRgbData) 01191 err = cmInvalidColorSpace; 01192 else{ 01193 newRowBytes = calcParam->cmInputBytesPerLine; 01194 err = Do555To8Setup( calcParam, info, &linesAtOnce, 1 ); 01195 if( err ) goto CleanupAndExit; 01196 } 01197 break; 01198 case cmWord565ColorPacking + cmBGRSpace: 01199 if (inColorSpace != icSigRgbData) 01200 err = cmInvalidColorSpace; 01201 else{ 01202 newRowBytes = calcParam->cmInputBytesPerLine; 01203 err = Do555To8Setup( calcParam, info, &linesAtOnce, 1 ); 01204 if( err ) goto CleanupAndExit; 01205 info->origSizeIn = 6; 01206 } 01207 break; 01208 case cmRGB16_565Space: 01209 #endif 01210 case cmRGB16Space: 01211 if (inColorSpace != icSigRgbData) 01212 err = cmInvalidColorSpace; 01213 else{ 01214 newRowBytes = calcParam->cmInputBytesPerLine; 01215 err = Do555To8Setup( calcParam, info, &linesAtOnce, 0 ); 01216 if( err ) goto CleanupAndExit; 01217 #ifdef PI_Application_h 01218 if( inputBitMapColorSpace == cmRGB16_565Space ){ 01219 info->origSizeIn = 6; 01220 } 01221 #endif 01222 } 01223 break; 01224 case cmNamedIndexed32Space: 01225 if( (inputBitMapColorSpace == cmNamedIndexed32Space) && (inColorSpace != icSigNamedData)){ 01226 err = cmInvalidColorSpace; 01227 } 01228 else{ 01229 newRowBytes = calcParam->cmPixelPerLine * 3; /* TempBuffer -> 32 BIT */ 01230 linesAtOnce = (kMaxTempBlock) / newRowBytes; 01231 if (linesAtOnce == 0) 01232 linesAtOnce = 1; 01233 else if (linesAtOnce > calcParam->cmLineCount) 01234 linesAtOnce = calcParam->cmLineCount; 01235 01236 bufferSize = newRowBytes * linesAtOnce; 01237 info->processedLinesIn = 0; 01238 info->origSizeIn = 8; 01239 info->usedSizeIn = 8; 01240 info->tempInBuffer = (void*)SmartNewPtr(bufferSize, &iErr); 01241 info->inputPixelSize = 32; 01242 if (iErr != noErr) 01243 { 01244 err = iErr; 01245 goto CleanupAndExit; 01246 } 01247 01248 calcParam->cmLineCount = linesAtOnce; 01249 calcParam->cmInputColorSpace = cmLAB24Space; 01250 calcParam->inputData[0] = ((Ptr)info->tempInBuffer)+0; 01251 calcParam->inputData[1] = ((Ptr)info->tempInBuffer)+1; 01252 calcParam->inputData[2] = ((Ptr)info->tempInBuffer)+2; 01253 01254 calcParam->cmInputBytesPerLine = newRowBytes; 01255 calcParam->cmInputPixelOffset = 3; 01256 } 01257 break; 01258 case cmHSV32Space: 01259 case cmHLS32Space: 01260 case cmYXY32Space: 01261 case cmXYZ32Space: 01262 case cmLUV32Space: 01263 case cmLAB32Space: 01264 #ifdef PI_Application_h 01265 case cmBGRSpace + cmLong10ColorPacking: 01266 case cmRGBSpace + cmLong10ColorPacking: 01267 case cmGenericSpace + cmLong10ColorPacking: 01268 #endif 01269 if( ( ((inputBitMapColorSpace == cmHSV32Space) && (inColorSpace != icSigHsvData)) || 01270 ((inputBitMapColorSpace == cmHLS32Space) && (inColorSpace != icSigHlsData)) || 01271 ((inputBitMapColorSpace == cmYXY32Space) && (inColorSpace != icSigYxyData)) || 01272 ((inputBitMapColorSpace == cmXYZ32Space) && (inColorSpace != icSigXYZData)) || 01273 ((inputBitMapColorSpace == cmLUV32Space) && (inColorSpace != icSigLuvData)) || 01274 ((inputBitMapColorSpace == cmLAB32Space) && (inColorSpace != icSigLabData)) 01275 #ifdef PI_Application_h 01276 || ((inputBitMapColorSpace == cmBGRSpace + cmLong10ColorPacking) && (inColorSpace != icSigRgbData)) 01277 || ((inputBitMapColorSpace == cmRGBSpace + cmLong10ColorPacking) && (inColorSpace != icSigRgbData)) 01278 || ((inputBitMapColorSpace == cmGenericSpace + cmLong10ColorPacking) && (inColorSpace != icSigMCH3Data)) 01279 #endif 01280 ) 01281 #if ! realThing 01282 && FALSE 01283 #endif 01284 ) 01285 err = cmInvalidColorSpace; 01286 else{ 01287 newRowBytes = calcParam->cmPixelPerLine * 3 * sizeof(SINT16); /* TempBuffer -> cm16PerChannelPacking */ 01288 linesAtOnce = (kMaxTempBlock) / newRowBytes; 01289 if (linesAtOnce == 0) 01290 linesAtOnce = 1; 01291 else if (linesAtOnce > calcParam->cmLineCount) 01292 linesAtOnce = calcParam->cmLineCount; 01293 01294 bufferSize = newRowBytes * linesAtOnce; 01295 info->processedLinesIn = 0; 01296 info->origSizeIn = 10; 01297 info->usedSizeIn = 16; 01298 info->tempInBuffer = (void*)SmartNewPtr(bufferSize, &iErr); 01299 info->inputPixelSize = 32; 01300 if (iErr != noErr) 01301 { 01302 err = iErr; 01303 goto CleanupAndExit; 01304 } 01305 01306 calcParam->cmLineCount = linesAtOnce; 01307 if( inputBitMapColorSpace == cmBGRSpace + cmLong10ColorPacking ){ 01308 calcParam->cmInputColorSpace = cmBGRSpace; 01309 calcParam->inputData[0] = ((Ptr)info->tempInBuffer)+4; 01310 calcParam->inputData[1] = ((Ptr)info->tempInBuffer)+2; 01311 calcParam->inputData[2] = ((Ptr)info->tempInBuffer)+0; 01312 } 01313 else{ 01314 calcParam->cmInputColorSpace = cmRGBSpace; 01315 calcParam->inputData[0] = ((Ptr)info->tempInBuffer)+0; 01316 calcParam->inputData[1] = ((Ptr)info->tempInBuffer)+2; 01317 calcParam->inputData[2] = ((Ptr)info->tempInBuffer)+4; 01318 } 01319 calcParam->cmInputBytesPerLine = newRowBytes; 01320 calcParam->cmInputPixelOffset = 6; 01321 } 01322 break; 01323 default: 01324 err = cmInvalidSrcMap; 01325 break; 01326 } 01327 01328 CleanupAndExit: 01329 LH_END_PROC("CheckInputColorSpace") 01330 return err; 01331 }

CMError CheckOutputColorSpace const CMBitmap bitMap,
CMCalcParamPtr  calcParam,
ColorSpaceInfo info,
OSType  outColorSpace,
long  colorLutOutDim
 

Definition at line 1337 of file lh_core/runtime.c.

References Byte_Factor, CMCalcParam::clearMask, cm16PerChannelPacking, cm8PerChannelPacking, cmARGB32Space, cmAYCC32Space, cmBGR24Space, cmBGR32Space, cmBGRSpace, CMBitmapColorSpace, cmCMY24Space, cmCMYK32Space, cmCMYKSpace, CMError, cmGamutResult1Space, cmGamutResultSpace, cmGenericSpace, cmGrayASpace, cmGraySpace, cmHLS32Space, cmHLSSpace, cmHSV32Space, cmHSVSpace, cmInvalidColorSpace, cmInvalidDstMap, cmKYMC32Space, cmKYMCSpace, cmLAB24Space, cmLAB32Space, cmLABSpace, CMCalcParam::cmLineCount, cmLong10ColorPacking, cmLong8ColorPacking, cmLUV32Space, cmLUVSpace, cmMCEight8Space, cmMCEightSpace, cmMCFive8Space, cmMCFiveSpace, cmMCSeven8Space, cmMCSevenSpace, cmMCSix8Space, cmMCSixSpace, cmNamedIndexed32Space, cmNoSpace, CMCalcParam::cmOutputBytesPerLine, CMCalcParam::cmOutputColorSpace, CMCalcParam::cmOutputPixelOffset, CMCalcParam::cmPixelPerLine, cmRGB16_565Space, cmRGB16Space, cmRGB24Space, cmRGB32Space, cmRGBA32Space, cmRGBASpace, cmRGBSpace, cmWord565ColorPacking, cmWord5ColorPacking, cmXYZ32Space, cmXYZSpace, cmYCC24Space, cmYCC32Space, cmYCCA32Space, cmYCCASpace, cmYCCSpace, cmYXY32Space, cmYXYSpace, CMCalcParam::copyAlpha, Do8To555Setup(), FALSE, icSigCmyData, icSigCmykData, icSigGrayData, icSigHlsData, icSigHsvData, icSigLabData, icSigLuvData, icSigMCH3Data, icSigMCH5Data, icSigMCH6Data, icSigMCH7Data, icSigMCH8Data, icSigNamedData, icSigRgbData, icSigXYZData, icSigYCbCrData, icSigYxyData, CMBitmap::image, kMaxTempBlock, LH_END_PROC, LH_START_PROC, noErr, ColorSpaceInfo::origSizeOut, CMCalcParam::outputData, ColorSpaceInfo::outputPixelSize, ColorSpaceInfo::processedLinesOut, Ptr, SINT16, SINT32, SmartNewPtr(), ColorSpaceInfo::tempOutBuffer, TRUE, UINT8, and ColorSpaceInfo::usedSizeOut.

01342 { 01343 CMError err = noErr; 01344 SINT32 newRowBytes; 01345 SINT32 bufferSize; 01346 SINT32 linesAtOnce; 01347 SINT32 loop; 01348 SINT16 iErr = noErr; 01349 CMBitmapColorSpace outputBitMapColorSpace = calcParam->cmOutputColorSpace; 01350 #ifdef ALLOW_16BIT_DATA 01351 UINT8 Byte_Factor=1; 01352 #endif 01353 01354 LH_START_PROC("CheckOutputColorSpace") 01355 colorLutOutDim = colorLutOutDim; 01356 01357 #ifdef ALLOW_16BIT_DATA 01358 if( outputBitMapColorSpace & cm16PerChannelPacking && (outputBitMapColorSpace & 31) != cmGraySpace){ 01359 Byte_Factor = 2; 01360 outputBitMapColorSpace &= ~cm16PerChannelPacking; 01361 outputBitMapColorSpace |= cm8PerChannelPacking; 01362 } 01363 #endif 01364 info->origSizeOut = Byte_Factor*8; 01365 info->usedSizeOut = Byte_Factor*8; 01366 switch ( outputBitMapColorSpace ) 01367 { 01368 case cmNoSpace: 01369 case cmRGBSpace: /* "... bitmap never uses this constant alone..." */ 01370 case cmHSVSpace: /* "... bitmap never uses this constant alone..." */ 01371 case cmHLSSpace: /* "... bitmap never uses this constant alone..." */ 01372 case cmYXYSpace: /* "... bitmap never uses this constant alone..." */ 01373 case cmXYZSpace: /* "... bitmap never uses this constant alone..." */ 01374 case cmLUVSpace: /* "... bitmap never uses this constant alone..." */ 01375 case cmLABSpace: /* "... bitmap never uses this constant alone..." */ 01376 case cmMCFiveSpace: /* "... bitmap never uses this constant alone..." */ 01377 case cmMCSixSpace: /* "... bitmap never uses this constant alone..." */ 01378 case cmMCSevenSpace: /* "... bitmap never uses this constant alone..." */ 01379 case cmMCEightSpace: /* "... bitmap never uses this constant alone..." */ 01380 case cmGamutResultSpace: /* "... bitmap never uses this constant alone..." */ 01381 case cmGamutResult1Space: /* not as colorspace for CMMatchBitmap */ 01382 #ifdef PI_Application_h 01383 case cmYCCSpace: /* "... bitmap never uses this constant alone..." */ 01384 case cmBGRSpace: /* "... bitmap never uses this constant alone..." */ 01385 #endif 01386 err = cmInvalidDstMap; 01387 break; 01388 case cmCMYKSpace: /* "... bitmap never uses this constant alone..." */ 01389 case cmKYMCSpace: /* "... bitmap never uses this constant alone..." */ 01390 err = cmInvalidDstMap; 01391 #if ! realThing 01392 if ( (outColorSpace != icSigCmykData) && (outColorSpace != icSigCmyData) ) 01393 err = cmInvalidColorSpace; 01394 else 01395 { 01396 calcParam->outputData[0] = &bitMap->image[0]; 01397 calcParam->outputData[1] = &bitMap->image[2]; 01398 calcParam->outputData[2] = &bitMap->image[4]; 01399 calcParam->outputData[3] = &bitMap->image[6]; 01400 calcParam->cmOutputPixelOffset = 8; 01401 info->usedSizeOut = 16; 01402 } 01403 #endif 01404 break; 01405 case cmGraySpace: 01406 if (outColorSpace != icSigGrayData) 01407 err = cmInvalidColorSpace; 01408 else 01409 { 01410 calcParam->outputData[0] = &bitMap->image[0]; 01411 calcParam->cmOutputPixelOffset = 2; 01412 info->usedSizeOut = 16; 01413 info->outputPixelSize = 16; 01414 } 01415 break; 01416 case cmGrayASpace: 01417 if (outColorSpace != icSigGrayData) 01418 err = cmInvalidColorSpace; 01419 else 01420 { 01421 calcParam->outputData[0] = &bitMap->image[0]; 01422 calcParam->outputData[1] = &bitMap->image[2]; 01423 calcParam->cmOutputPixelOffset = 4; 01424 info->usedSizeOut = 16; 01425 info->outputPixelSize = 32; 01426 } 01427 break; 01428 case cmLAB24Space: 01429 if (outColorSpace != icSigLabData) 01430 err = cmInvalidColorSpace; 01431 else 01432 { 01433 calcParam->outputData[0] = &bitMap->image[Byte_Factor*0]; 01434 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01435 calcParam->outputData[2] = &bitMap->image[Byte_Factor*2]; 01436 calcParam->cmOutputPixelOffset = Byte_Factor*3; 01437 info->outputPixelSize = Byte_Factor*24; 01438 } 01439 break; 01440 01441 /* separated cmRGB24Space and cmRGB32Space to reflect the bitmap format definition changes. */ 01442 case cmRGB24Space: 01443 if (outColorSpace != icSigRgbData) 01444 err = cmInvalidColorSpace; 01445 else 01446 { 01447 calcParam->outputData[0] = &bitMap->image[Byte_Factor*0]; 01448 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01449 calcParam->outputData[2] = &bitMap->image[Byte_Factor*2]; 01450 calcParam->cmOutputPixelOffset = Byte_Factor*3; 01451 info->outputPixelSize = Byte_Factor*24; 01452 } 01453 break; 01454 case cmRGB32Space: 01455 if (outColorSpace != icSigRgbData) 01456 err = cmInvalidColorSpace; 01457 else 01458 { 01459 calcParam->outputData[0] = &bitMap->image[Byte_Factor*1]; 01460 calcParam->outputData[1] = &bitMap->image[Byte_Factor*2]; 01461 calcParam->outputData[2] = &bitMap->image[Byte_Factor*3]; 01462 calcParam->outputData[3] = &bitMap->image[Byte_Factor*0]; 01463 calcParam->cmOutputPixelOffset = Byte_Factor*4; 01464 calcParam->clearMask = TRUE; 01465 info->outputPixelSize = Byte_Factor*32; 01466 } 01467 break; 01468 01469 case cmRGBASpace: 01470 case cmRGBA32Space: 01471 if (outColorSpace != icSigRgbData) 01472 err = cmInvalidColorSpace; 01473 else 01474 { 01475 calcParam->outputData[0] = &bitMap->image[Byte_Factor*0]; 01476 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01477 calcParam->outputData[2] = &bitMap->image[Byte_Factor*2]; 01478 calcParam->outputData[3] = &bitMap->image[Byte_Factor*3]; 01479 calcParam->cmOutputPixelOffset = Byte_Factor*4; 01480 info->outputPixelSize = Byte_Factor*32; 01481 } 01482 break; 01483 01484 #ifdef PI_Application_h 01485 case cmGraySpace|cm8PerChannelPacking: 01486 if (outColorSpace != icSigGrayData) 01487 err = cmInvalidColorSpace; 01488 else 01489 { 01490 calcParam->outputData[0] = &bitMap->image[0]; 01491 calcParam->cmOutputPixelOffset = 1; 01492 info->usedSizeOut = 8; 01493 info->outputPixelSize = 8; 01494 } 01495 break; 01496 case cmGrayASpace|cm8PerChannelPacking: 01497 if (outColorSpace != icSigGrayData) 01498 err = cmInvalidColorSpace; 01499 else 01500 { 01501 calcParam->outputData[0] = &bitMap->image[0]; 01502 calcParam->outputData[1] = &bitMap->image[1]; 01503 calcParam->cmOutputPixelOffset = 2; 01504 info->usedSizeOut = 8; 01505 info->outputPixelSize = 16; 01506 } 01507 break; 01508 01509 case cmBGR24Space: 01510 if (outColorSpace != icSigRgbData) 01511 err = cmInvalidColorSpace; 01512 else 01513 { 01514 calcParam->outputData[0] = &bitMap->image[Byte_Factor*2]; 01515 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01516 calcParam->outputData[2] = &bitMap->image[Byte_Factor*0]; 01517 calcParam->cmOutputPixelOffset = Byte_Factor*3; 01518 info->outputPixelSize = Byte_Factor*24; 01519 } 01520 break; 01521 case cmBGR32Space: 01522 if (outColorSpace != icSigRgbData) 01523 err = cmInvalidColorSpace; 01524 else 01525 { 01526 calcParam->outputData[0] = &bitMap->image[Byte_Factor*2]; 01527 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01528 calcParam->outputData[2] = &bitMap->image[Byte_Factor*0]; 01529 calcParam->outputData[3] = &bitMap->image[Byte_Factor*3]; 01530 calcParam->cmOutputPixelOffset = Byte_Factor*4; 01531 calcParam->clearMask = FALSE; 01532 calcParam->copyAlpha = TRUE; 01533 info->outputPixelSize = Byte_Factor*32; 01534 } 01535 break; 01536 01537 case cmYCC24Space: /* cmYCC24Space and cmYCC32Space have the same value !!! */ 01538 if (outColorSpace != icSigYCbCrData) 01539 err = cmInvalidColorSpace; 01540 else 01541 { 01542 calcParam->outputData[0] = &bitMap->image[Byte_Factor*0]; 01543 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01544 calcParam->outputData[2] = &bitMap->image[Byte_Factor*2]; 01545 calcParam->cmOutputPixelOffset = Byte_Factor*3; 01546 info->outputPixelSize = Byte_Factor*24; 01547 } 01548 break; 01549 case cmYCC32Space: 01550 if (outColorSpace != icSigYCbCrData) 01551 err = cmInvalidColorSpace; 01552 else 01553 { 01554 calcParam->outputData[0] = &bitMap->image[Byte_Factor*1]; 01555 calcParam->outputData[1] = &bitMap->image[Byte_Factor*2]; 01556 calcParam->outputData[2] = &bitMap->image[Byte_Factor*3]; 01557 calcParam->outputData[3] = &bitMap->image[Byte_Factor*0]; 01558 calcParam->cmOutputPixelOffset = Byte_Factor*4; 01559 calcParam->clearMask = TRUE; 01560 info->outputPixelSize = Byte_Factor*32; 01561 } 01562 break; 01563 01564 case cmYCCASpace: 01565 case cmYCCA32Space: 01566 if (outColorSpace != icSigYCbCrData) 01567 err = cmInvalidColorSpace; 01568 else 01569 { 01570 calcParam->outputData[0] = &bitMap->image[Byte_Factor*0]; 01571 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01572 calcParam->outputData[2] = &bitMap->image[Byte_Factor*2]; 01573 calcParam->outputData[3] = &bitMap->image[Byte_Factor*3]; 01574 calcParam->cmOutputPixelOffset = Byte_Factor*4; 01575 info->outputPixelSize = Byte_Factor*32; 01576 } 01577 break; 01578 case cmAYCC32Space: 01579 if (outColorSpace != icSigYCbCrData) 01580 err = cmInvalidColorSpace; 01581 else 01582 { 01583 calcParam->outputData[0] = &bitMap->image[Byte_Factor*1]; 01584 calcParam->outputData[1] = &bitMap->image[Byte_Factor*2]; 01585 calcParam->outputData[2] = &bitMap->image[Byte_Factor*3]; 01586 calcParam->outputData[3] = &bitMap->image[Byte_Factor*0]; 01587 calcParam->cmOutputPixelOffset = Byte_Factor*4; 01588 info->outputPixelSize = Byte_Factor*32; 01589 } 01590 break; 01591 case cmLong8ColorPacking + cmLABSpace: 01592 if (outColorSpace != icSigLabData) 01593 err = cmInvalidColorSpace; 01594 else 01595 { 01596 calcParam->outputData[0] = &bitMap->image[Byte_Factor*0]; 01597 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01598 calcParam->outputData[2] = &bitMap->image[Byte_Factor*2]; 01599 calcParam->outputData[3] = &bitMap->image[Byte_Factor*3]; 01600 calcParam->cmOutputPixelOffset = Byte_Factor*4; 01601 info->outputPixelSize = Byte_Factor*32; 01602 } 01603 break; 01604 case cmLong8ColorPacking + cmXYZSpace: 01605 if (outColorSpace != icSigXYZData) 01606 err = cmInvalidColorSpace; 01607 else 01608 { 01609 calcParam->outputData[0] = &bitMap->image[Byte_Factor*0]; 01610 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01611 calcParam->outputData[2] = &bitMap->image[Byte_Factor*2]; 01612 calcParam->outputData[3] = &bitMap->image[Byte_Factor*3]; 01613 calcParam->cmOutputPixelOffset = Byte_Factor*4; 01614 info->outputPixelSize = Byte_Factor*32; 01615 } 01616 break; 01617 case cmLong8ColorPacking + cmYXYSpace: 01618 if (outColorSpace != icSigYxyData) 01619 err = cmInvalidColorSpace; 01620 else 01621 { 01622 calcParam->outputData[0] = &bitMap->image[Byte_Factor*0]; 01623 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01624 calcParam->outputData[2] = &bitMap->image[Byte_Factor*2]; 01625 calcParam->outputData[3] = &bitMap->image[Byte_Factor*3]; 01626 calcParam->cmOutputPixelOffset = Byte_Factor*4; 01627 info->outputPixelSize = Byte_Factor*32; 01628 } 01629 break; 01630 case cmGenericSpace + cm8PerChannelPacking: 01631 { 01632 for (loop = 0; loop< colorLutOutDim; loop++) 01633 calcParam->outputData[loop] = &bitMap->image[Byte_Factor*loop]; 01634 calcParam->cmOutputPixelOffset = Byte_Factor*colorLutOutDim; 01635 info->outputPixelSize = Byte_Factor*colorLutOutDim*8; 01636 } 01637 break; 01638 case cmGenericSpace + cmLong8ColorPacking: 01639 { 01640 for (loop = 0; loop< (colorLutOutDim+1); loop++) 01641 calcParam->outputData[loop] = &bitMap->image[Byte_Factor*loop]; 01642 calcParam->cmOutputPixelOffset = Byte_Factor*(colorLutOutDim+1); 01643 info->outputPixelSize = Byte_Factor*(colorLutOutDim+1)*8; 01644 } 01645 break; 01646 case cmCMY24Space: 01647 if ( outColorSpace != icSigCmyData ) 01648 err = cmInvalidColorSpace; 01649 else 01650 { 01651 calcParam->outputData[0] = &bitMap->image[Byte_Factor*0]; 01652 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01653 calcParam->outputData[2] = &bitMap->image[Byte_Factor*2]; 01654 calcParam->cmOutputPixelOffset = Byte_Factor*3; 01655 info->outputPixelSize = Byte_Factor*24; 01656 } 01657 break; 01658 #endif 01659 01660 case cmCMYK32Space: 01661 if ( (outColorSpace != icSigCmykData) && (outColorSpace != icSigCmyData) ) 01662 err = cmInvalidColorSpace; 01663 else 01664 { 01665 calcParam->outputData[0] = &bitMap->image[Byte_Factor*0]; 01666 calcParam->outputData[1] = &bitMap->image[Byte_Factor*1]; 01667 calcParam->outputData[2] = &bitMap->image[Byte_Factor*2]; 01668 calcParam->outputData[3] = &bitMap->image[Byte_Factor*3]; 01669 calcParam->cmOutputPixelOffset = Byte_Factor*4; 01670 if (outColorSpace == icSigCmyData) /* if we have CMY-Data - clear the k */ 01671 calcParam->clearMask = TRUE; 01672 info->outputPixelSize = Byte_Factor*32; 01673 } 01674 break; 01675 case cmKYMC32Space: 01676 if ( (outColorSpace != icSigCmykData) && (outColorSpace != icSigCmyData) ) 01677 err = cmInvalidColorSpace; 01678 else 01679 { 01680 calcParam->outputData[3] = &bitMap->image[Byte_Factor*0]; 01681 calcParam->outputData[2] = &bitMap->image[Byte_Factor*1]; 01682 calcParam->outputData[1] = &bitMap->image[Byte_Factor*2]; 01683 calcParam->outputData[0] = &bitMap->image[Byte_Factor*3]; 01684 calcParam->cmOutputPixelOffset = Byte_Factor*4; 01685 if (outColorSpace == icSigCmyData) /* if we have CMY-Data - clear the k */ 01686 calcParam->clearMask = TRUE; 01687 info->outputPixelSize = Byte_Factor*32; 01688 } 01689 break; 01690 case cmARGB32Space: 01691 if (outColorSpace != icSigRgbData) 01692 err = cmInvalidColorSpace; 01693 else 01694 { 01695 calcParam->outputData[0] = &bitMap->image[Byte_Factor*1]; 01696 calcParam->outputData[1] = &bitMap->image[Byte_Factor*2]; 01697 calcParam->outputData[2] = &bitMap->image[Byte_Factor*3]; 01698 calcParam->outputData[3] = &bitMap->image[Byte_Factor*0]; 01699 calcParam->cmOutputPixelOffset =Byte_Factor*4; 01700 info->outputPixelSize = Byte_Factor*32; 01701 } 01702 break; 01703 case cmMCFive8Space: 01704 if (outColorSpace != icSigMCH5Data) 01705 err = cmInvalidColorSpace; 01706 else 01707 { 01708 for (loop = 0; loop< 5; loop++) 01709 calcParam->outputData[loop] = &bitMap->image[Byte_Factor*loop]; 01710 calcParam->cmOutputPixelOffset = Byte_Factor*5; 01711 info->outputPixelSize = Byte_Factor*40; 01712 } 01713 break; 01714 case cmMCSix8Space: 01715 if (outColorSpace != icSigMCH6Data) 01716 err = cmInvalidColorSpace; 01717 else 01718 { 01719 for (loop = 0; loop< 6; loop++) 01720 calcParam->outputData[loop] = &bitMap->image[Byte_Factor*loop]; 01721 calcParam->cmOutputPixelOffset = Byte_Factor*6; 01722 info->outputPixelSize = Byte_Factor*48; 01723 } 01724 break; 01725 case cmMCSeven8Space: 01726 if (outColorSpace != icSigMCH7Data) 01727 err = cmInvalidColorSpace; 01728 else 01729 { 01730 for (loop = 0; loop< 7; loop++) 01731 calcParam->outputData[loop] = &bitMap->image[Byte_Factor*loop]; 01732 calcParam->cmOutputPixelOffset = Byte_Factor*7; 01733 info->outputPixelSize = Byte_Factor*56; 01734 } 01735 break; 01736 case cmMCEight8Space: 01737 if (outColorSpace != icSigMCH8Data) 01738 err = cmInvalidColorSpace; 01739 else 01740 { 01741 for (loop = 0; loop< 8; loop++) 01742 calcParam->outputData[loop] = &bitMap->image[Byte_Factor*loop]; 01743 calcParam->cmOutputPixelOffset = Byte_Factor*8; 01744 info->outputPixelSize = Byte_Factor*64; 01745 } 01746 break; 01747 #ifdef PI_Application_h 01748 case cmWord5ColorPacking + cmLABSpace: 01749 if (outColorSpace != icSigLabData) 01750 err = cmInvalidColorSpace; 01751 else{ 01752 err = Do8To555Setup( calcParam, info, &linesAtOnce, 0 ); 01753 if( err ) goto CleanupAndExit; 01754 } 01755 break; 01756 case cmWord5ColorPacking + cmXYZSpace: 01757 if (outColorSpace != icSigXYZData) 01758 err = cmInvalidColorSpace; 01759 else{ 01760 err = Do8To555Setup( calcParam, info, &linesAtOnce, 0 ); 01761 if( err ) goto CleanupAndExit; 01762 } 01763 break; 01764 case cmWord5ColorPacking + cmYXYSpace: 01765 if (outColorSpace != icSigYxyData) 01766 err = cmInvalidColorSpace; 01767 else{ 01768 err = Do8To555Setup( calcParam, info, &linesAtOnce, 0 ); 01769 if( err ) goto CleanupAndExit; 01770 } 01771 break; 01772 case cmWord5ColorPacking + cmGenericSpace: 01773 { 01774 err = Do8To555Setup( calcParam, info, &linesAtOnce, 0 ); 01775 if( err ) goto CleanupAndExit; 01776 } 01777 break; 01778 case cmWord565ColorPacking + cmGenericSpace: 01779 { 01780 err = Do8To555Setup( calcParam, info, &linesAtOnce, 0 ); 01781 if( err ) goto CleanupAndExit; 01782 info->origSizeOut = 6; 01783 } 01784 break; 01785 case cmWord5ColorPacking + cmBGRSpace: 01786 if (outColorSpace != icSigRgbData) 01787 err = cmInvalidColorSpace; 01788 else{ 01789 err = Do8To555Setup( calcParam, info, &linesAtOnce, 1 ); 01790 if( err ) goto CleanupAndExit; 01791 } 01792 break; 01793 case cmWord565ColorPacking + cmBGRSpace: 01794 if (outColorSpace != icSigRgbData) 01795 err = cmInvalidColorSpace; 01796 else{ 01797 err = Do8To555Setup( calcParam, info, &linesAtOnce, 1 ); 01798 if( err ) goto CleanupAndExit; 01799 info->origSizeOut = 6; 01800 } 01801 break; 01802 case cmRGB16_565Space: 01803 #endif 01804 case cmRGB16Space: 01805 if (outColorSpace != icSigRgbData) 01806 err = cmInvalidColorSpace; 01807 else{ 01808 err = Do8To555Setup( calcParam, info, &linesAtOnce, 0 ); 01809 if( err ) goto CleanupAndExit; 01810 #ifdef PI_Application_h 01811 if( outputBitMapColorSpace == cmRGB16_565Space ){ 01812 info->origSizeOut = 6; 01813 } 01814 #endif 01815 } 01816 break; 01817 case cmNamedIndexed32Space: 01818 if( (outColorSpace == cmNamedIndexed32Space) && (outColorSpace != icSigNamedData)){ 01819 err = cmInvalidColorSpace; 01820 } 01821 else{ 01822 calcParam->outputData[0] = &bitMap->image[0]; 01823 calcParam->outputData[1] = &bitMap->image[1]; 01824 calcParam->outputData[2] = &bitMap->image[2]; 01825 calcParam->outputData[3] = &bitMap->image[3]; 01826 calcParam->cmOutputPixelOffset = 4; 01827 info->outputPixelSize = 32; 01828 } 01829 break; 01830 case cmHSV32Space: 01831 case cmHLS32Space: 01832 case cmYXY32Space: 01833 case cmXYZ32Space: 01834 case cmLUV32Space: 01835 case cmLAB32Space: 01836 #ifdef PI_Application_h 01837 case cmBGRSpace + cmLong10ColorPacking: 01838 case cmRGBSpace + cmLong10ColorPacking: 01839 case cmGenericSpace + cmLong10ColorPacking: 01840 #endif 01841 if ( ( ((outputBitMapColorSpace == cmHSV32Space) && (outColorSpace != icSigHsvData)) || 01842 ((outputBitMapColorSpace == cmHLS32Space) && (outColorSpace != icSigHlsData)) || 01843 ((outputBitMapColorSpace == cmYXY32Space) && (outColorSpace != icSigYxyData)) || 01844 ((outputBitMapColorSpace == cmXYZ32Space) && (outColorSpace != icSigXYZData)) || 01845 ((outputBitMapColorSpace == cmLUV32Space) && (outColorSpace != icSigLuvData)) || 01846 ((outputBitMapColorSpace == cmLAB32Space) && (outColorSpace != icSigLabData)) 01847 #ifdef PI_Application_h 01848 || ((outputBitMapColorSpace == cmBGRSpace + cmLong10ColorPacking) && (outColorSpace != icSigRgbData)) 01849 || ((outputBitMapColorSpace == cmRGBSpace + cmLong10ColorPacking) && (outColorSpace != icSigRgbData)) 01850 || ((outputBitMapColorSpace == cmGenericSpace + cmLong10ColorPacking) && (outColorSpace != icSigMCH3Data)) 01851 #endif 01852 ) 01853 #if ! realThing 01854 && FALSE 01855 #endif 01856 ) 01857 err = cmInvalidColorSpace; 01858 else{ 01859 newRowBytes = calcParam->cmPixelPerLine * 3 * sizeof(SINT16); /* TempBuffer -> cm16PerChannelPacking */ 01860 linesAtOnce = (kMaxTempBlock) / newRowBytes; 01861 if (linesAtOnce == 0) 01862 linesAtOnce = 1; 01863 else if (linesAtOnce > calcParam->cmLineCount) 01864 linesAtOnce = calcParam->cmLineCount; 01865 01866 bufferSize = newRowBytes * linesAtOnce; 01867 info->processedLinesOut = 0; 01868 info->origSizeOut = 10; 01869 info->usedSizeOut = 16; 01870 info->tempOutBuffer = (void*)SmartNewPtr(bufferSize, &iErr); 01871 info->outputPixelSize = 32; 01872 if (iErr != noErr) 01873 { 01874 err = iErr; 01875 goto CleanupAndExit; 01876 } 01877 01878 calcParam->cmLineCount = linesAtOnce; 01879 calcParam->cmOutputBytesPerLine = newRowBytes; 01880 if( outputBitMapColorSpace == cmBGRSpace + cmLong10ColorPacking ){ 01881 calcParam->cmOutputColorSpace = cmBGRSpace; 01882 calcParam->outputData[0] = ((Ptr)info->tempOutBuffer)+4; 01883 calcParam->outputData[1] = ((Ptr)info->tempOutBuffer)+2; 01884 calcParam->outputData[2] = ((Ptr)info->tempOutBuffer)+0; 01885 } 01886 else{ 01887 calcParam->cmOutputColorSpace = cmRGBSpace; 01888 calcParam->outputData[0] = ((Ptr)info->tempOutBuffer)+0; 01889 calcParam->outputData[1] = ((Ptr)info->tempOutBuffer)+2; 01890 calcParam->outputData[2] = ((Ptr)info->tempOutBuffer)+4; 01891 } 01892 calcParam->cmOutputPixelOffset = 6; 01893 } 01894 break; 01895 default: 01896 err = cmInvalidDstMap; 01897 break; 01898 } 01899 01900 CleanupAndExit: 01901 LH_END_PROC("CheckOutputColorSpace") 01902 return err; 01903 }

CMError CheckOutputColorSpaceChk const CMBitmap bitMap,
CMCalcParamPtr  calcParam,
ColorSpaceInfo info
 

Definition at line 2030 of file lh_core/runtime.c.

References cm8PerChannelPacking, CMError, cmGamutResult1Space, cmGamutResultSpace, cmGraySpace, cmInvalidDstMap, CMCalcParam::cmLineCount, CMCalcParam::cmOutputBytesPerLine, CMCalcParam::cmOutputColorSpace, CMCalcParam::cmOutputPixelOffset, CMCalcParam::cmPixelPerLine, CMBitmap::image, kMaxTempBlock, LH_END_PROC, LH_START_PROC, noErr, ColorSpaceInfo::origSizeOut, CMCalcParam::outputData, ColorSpaceInfo::processedLinesOut, Ptr, SINT16, SINT32, SmartNewPtr(), CMBitmap::space, ColorSpaceInfo::tempOutBuffer, and ColorSpaceInfo::usedSizeOut.

02033 { 02034 CMError err = noErr; 02035 SINT32 newRowBytes; 02036 SINT32 bufferSize; 02037 SINT32 linesAtOnce; 02038 SINT16 iErr = noErr; 02039 02040 LH_START_PROC("CheckOutputColorSpaceChk") 02041 switch ( bitMap->space) 02042 { 02043 case cmGamutResult1Space: 02044 newRowBytes = calcParam->cmPixelPerLine; /* TempBuffer -> 1 byte per pixel */ 02045 linesAtOnce = (kMaxTempBlock) / newRowBytes; 02046 if (linesAtOnce == 0) 02047 linesAtOnce = 1; 02048 else if (linesAtOnce > calcParam->cmLineCount) 02049 linesAtOnce = calcParam->cmLineCount; 02050 02051 bufferSize = newRowBytes * linesAtOnce; 02052 info->processedLinesOut = 0; 02053 info->origSizeOut = 1; 02054 info->usedSizeOut = 8; /* ACHTUNG !!!!! bufferSize*info->usedSizeOut */ 02055 info->tempOutBuffer = (void*)SmartNewPtr(bufferSize*info->usedSizeOut, &iErr); 02056 if (iErr != noErr) 02057 { 02058 err = iErr; 02059 goto CleanupAndExit; 02060 } 02061 02062 calcParam->cmLineCount = linesAtOnce; 02063 calcParam->cmOutputColorSpace = cmGraySpace|cm8PerChannelPacking; 02064 calcParam->cmOutputBytesPerLine = newRowBytes; 02065 calcParam->outputData[0] = (Ptr)info->tempOutBuffer; 02066 calcParam->cmOutputPixelOffset = 1; 02067 break; 02068 case cmGamutResultSpace: 02069 newRowBytes = calcParam->cmPixelPerLine; /* TempBuffer -> 1 byte per pixel */ 02070 linesAtOnce = (kMaxTempBlock) / newRowBytes; 02071 if (linesAtOnce == 0) 02072 linesAtOnce = 1; 02073 else if (linesAtOnce > calcParam->cmLineCount) 02074 linesAtOnce = calcParam->cmLineCount; 02075 02076 bufferSize = newRowBytes * linesAtOnce; 02077 info->processedLinesOut = 0; 02078 info->origSizeOut = 8; 02079 info->usedSizeOut = 8; 02080 info->tempOutBuffer = 0; 02081 02082 calcParam->cmLineCount = linesAtOnce; 02083 calcParam->cmOutputColorSpace = cmGraySpace|cm8PerChannelPacking; 02084 calcParam->cmOutputBytesPerLine = newRowBytes; 02085 calcParam->cmOutputPixelOffset = 1; 02086 calcParam->outputData[0] = &bitMap->image[0]; 02087 break; 02088 default: 02089 err = cmInvalidDstMap; 02090 break; 02091 } 02092 CleanupAndExit: 02093 LH_END_PROC("CheckOutputColorSpaceChk") 02094 return err; 02095 }

CMError CMConvertNamedIndexToColors CMWorldRef  cw,
CMColor theData,
unsigned long  pixCnt
 

Definition at line 4851 of file lh_core/runtime.c.

References CMError, CMMModelPtr, ConvertNamedIndexToColors(), and SINT32.

04852 { 04853 return ConvertNamedIndexToColors( (CMMModelPtr)cw, theData, (SINT32)pixCnt ); 04854 }

CMError CMConvertNamedIndexToPCS CMWorldRef  cw,
CMColor theData,
unsigned long  pixCnt
 

Definition at line 4861 of file lh_core/runtime.c.

References CMError, CMMModelPtr, ConvertNamedIndexToPCS(), and SINT32.

04862 { 04863 return ConvertNamedIndexToPCS( (CMMModelPtr)cw, theData, (SINT32)pixCnt ); 04864 }

CMError CMConvIndexToName icNamedColor2Type Data,
unsigned long *  Arr2Indices,
pCMColorName  Ptr2Name,
unsigned long  count
 

Definition at line 5168 of file lh_core/runtime.c.

References CMError, cmNamedColorNotFound, cmparamErr, icNamedColor2::count, icNamedColor2::data, LH_END_PROC, LH_START_PROC, icNamedColor2Type::ncolor, icNamedColor2::nDeviceCoords, noErr, NULL, OSErr, Ptr, SINT16, and UINT32.

05169 { 05170 Ptr tagTbl = NULL; 05171 OSErr err = noErr; 05172 UINT32 i,index; 05173 char *colorPtr=NULL; 05174 long elemSz,deviceChannelCount,countNamesInProfile; 05175 05176 LH_START_PROC("CMConvIndexToName") 05177 05178 if( Data == 0 || count == 0 )return cmparamErr; 05179 tagTbl = &Data->ncolor.data[0]; 05180 05181 /* find out how many bytes to skip per element. div'ed 2 for indexing purpose */ 05182 countNamesInProfile = Data->ncolor.count; 05183 deviceChannelCount = Data->ncolor.nDeviceCoords; 05184 if (deviceChannelCount==3){ 05185 elemSz = 32+(3+3)*sizeof(SINT16); 05186 } 05187 else if (deviceChannelCount == 4){ 05188 elemSz = 32+(3+4)*sizeof(SINT16); 05189 } 05190 else if (deviceChannelCount == 0){ 05191 elemSz = 32+(3+0)*sizeof(SINT16); 05192 } 05193 else{ 05194 err = cmparamErr; 05195 goto CleanUp; 05196 } 05197 05198 /* doing the actual */ 05199 for (i=0; i<(UINT32)count; i++){ 05200 /* go to the index'th element*/ 05201 index = Arr2Indices[i]; 05202 if (index > (UINT32)countNamesInProfile || index == 0 ) 05203 { 05204 err = cmNamedColorNotFound; 05205 goto CleanUp; 05206 } 05207 colorPtr = tagTbl + (index-1)*elemSz; 05208 /* put in all the info */ 05209 strcpy( Ptr2Name[i], colorPtr ); 05210 } 05211 05212 CleanUp: 05213 LH_END_PROC("CMConvIndexToName") 05214 return err; 05215 }

CMError CMConvIndexToNameCW CMWorldRef Storage,
unsigned long *  Arr2Indices,
pCMColorName  Ptr2Name,
unsigned long  count
 

Definition at line 5218 of file lh_core/runtime.c.

References CMConvIndexToName(), CMError, CMMModelPtr, cmparamErr, DATA_2_PTR, LH_END_PROC, LH_START_PROC, LOCK_DATA, LUT_DATA_TYPE, noErr, NoNamedColorProfile, NULL, Ptr, and UNLOCK_DATA.

05219 { 05220 Ptr tagTbl = NULL; 05221 LUT_DATA_TYPE tagH = NULL; 05222 CMError err = noErr; 05223 char *colorPtr=NULL; 05224 CMMModelPtr modelingData; 05225 icNamedColor2Type *namedData; 05226 05227 LH_START_PROC("CMConvIndexToNameCW") 05228 05229 if( Storage == 0 )return cmparamErr; 05230 LOCK_DATA( Storage ); 05231 modelingData = (CMMModelPtr)(DATA_2_PTR( Storage )); 05232 if ( modelingData->hasNamedColorProf!=NoNamedColorProfile) 05233 { 05234 /* prepare the tag table */ 05235 tagH = modelingData->theNamedColorTagData ; 05236 if (tagH==NULL){ 05237 err = cmparamErr; 05238 goto CleanUp; 05239 } 05240 LOCK_DATA(tagH); 05241 05242 namedData = (icNamedColor2Type *)DATA_2_PTR(tagH); 05243 err = CMConvIndexToName( namedData, Arr2Indices, Ptr2Name, count ); 05244 UNLOCK_DATA(tagH); 05245 } 05246 CleanUp: 05247 UNLOCK_DATA( Storage ); 05248 LH_END_PROC("CMConvIndexToNameCW") 05249 return err; 05250 }

CMError CMConvIndexToNameProfile CMProfileRef  aProf,
unsigned long *  Arr2Indices,
pCMColorName  Ptr2Name,
unsigned long  count
 

Definition at line 5252 of file lh_core/runtime.c.

References CMConvIndexToName(), CMError, CMGetPartialProfileElement(), cmparamErr, DisposeIfPtr(), icSigNamedColor2Tag, LH_END_PROC, LH_START_PROC, Ptr, and SmartNewPtr().

05253 { 05254 CMError err; 05255 short aOSerr; 05256 icNamedColor2Type *aName = 0; 05257 unsigned long byteCount; 05258 05259 LH_START_PROC("CMConvIndexToNameProfile") 05260 05261 if( aProf == 0 )return cmparamErr; 05262 err = CMGetPartialProfileElement( aProf, 05263 icSigNamedColor2Tag, 05264 0, 05265 &byteCount, 05266 0 ); 05267 if (err) 05268 goto CleanupAndExit; 05269 aName = (icNamedColor2Type *)SmartNewPtr( byteCount, &aOSerr ); 05270 err = aOSerr; 05271 if (err) 05272 goto CleanupAndExit; 05273 err = CMGetPartialProfileElement( aProf, 05274 icSigNamedColor2Tag, 05275 0, 05276 &byteCount, 05277 (Ptr)aName ); 05278 if (err){ 05279 goto CleanupAndExit; 05280 } 05281 05282 #ifdef IntelMode 05283 SwapLongOffset( &aName->ncolor.count, 0, 4 ); 05284 SwapLongOffset( &aName->ncolor.nDeviceCoords, 0, 4 ); 05285 #endif 05286 err = CMConvIndexToName( aName, Arr2Indices, Ptr2Name, count ); 05287 05288 CleanupAndExit: 05289 DisposeIfPtr( (Ptr)aName ); 05290 LH_END_PROC("CMConvIndexToNameProfile") 05291 return err; 05292 }

CMError CMConvNameToIndex icNamedColor2Type Data,
pcCMColorName  Ptr2Name,
unsigned long *  Arr2Indices,
unsigned long  count
 

Definition at line 5032 of file lh_core/runtime.c.

References CMError, cmNamedColorNotFound, cmparamErr, icNamedColor2::count, icNamedColor2::data, LH_END_PROC, LH_START_PROC, icNamedColor2Type::ncolor, icNamedColor2::nDeviceCoords, noErr, NULL, OSErr, Ptr, SINT16, strlen(), and UINT32.

05033 { 05034 OSErr err = noErr; 05035 UINT32 i,index,l,len; 05036 char *colorPtr=NULL; 05037 long elemSz,deviceChannelCount,countNamesInProfile; 05038 const char *aPtr; 05039 Ptr tagTbl; 05040 05041 LH_START_PROC("CMConvNameToIndex") 05042 05043 if( Data == 0 || count == 0 )return cmparamErr; 05044 05045 tagTbl = &Data->ncolor.data[0]; 05046 /* find out how many bytes to skip per element. div'ed 2 for indexing purpose */ 05047 countNamesInProfile = Data->ncolor.count; 05048 deviceChannelCount = Data->ncolor.nDeviceCoords; 05049 if (deviceChannelCount==3){ 05050 elemSz = 32+(3+3)*sizeof(SINT16); 05051 } 05052 else if (deviceChannelCount == 4){ 05053 elemSz = 32+(3+4)*sizeof(SINT16); 05054 } 05055 else if (deviceChannelCount == 0){ 05056 elemSz = 32+(3+0)*sizeof(SINT16); 05057 } 05058 else{ 05059 err = cmparamErr; 05060 goto CleanUp; 05061 } 05062 05063 for (i=0; i<(UINT32)count; i++){ 05064 colorPtr = tagTbl; 05065 len = strlen( Ptr2Name[i] ); 05066 aPtr = Ptr2Name[i]; 05067 for( index = 0; index < (UINT32)countNamesInProfile; index++ ){ 05068 for( l = 0; l<len; l++ ){ 05069 if( colorPtr[l] != aPtr[l] )break; 05070 if( colorPtr[l] == 0 )break; 05071 } 05072 if( l >= len )break; 05073 colorPtr += elemSz; 05074 } 05075 if( l < len )index = 0; /* not found */ 05076 else index++; /* Indices are 1 based */ 05077 05078 /* put in all the info */ 05079 if( index == 0 ){ 05080 err = cmNamedColorNotFound; 05081 goto CleanUp; 05082 } 05083 Arr2Indices[i] = index; 05084 } 05085 CleanUp: 05086 LH_END_PROC("CMConvNameToIndex") 05087 return err; 05088 }

CMError CMConvNameToIndexCW CMWorldRef Storage,
pcCMColorName  Ptr2Name,
unsigned long *  Arr2Indices,
unsigned long  count
 

Definition at line 5091 of file lh_core/runtime.c.

References CMConvNameToIndex(), CMError, CMMModelPtr, cmparamErr, DATA_2_PTR, LH_END_PROC, LH_START_PROC, LOCK_DATA, LUT_DATA_TYPE, noErr, NoNamedColorProfile, NULL, Ptr, and UNLOCK_DATA.

05092 { 05093 Ptr tagTbl = NULL; 05094 LUT_DATA_TYPE tagH = NULL; 05095 CMError err = noErr; 05096 char *colorPtr=NULL; 05097 CMMModelPtr modelingData; 05098 icNamedColor2Type *namedData; 05099 05100 LH_START_PROC("CMConvNameToIndexCW") 05101 05102 if( Storage == 0 )return cmparamErr; 05103 LOCK_DATA( Storage ); 05104 modelingData = (CMMModelPtr)(DATA_2_PTR( Storage )); 05105 if ( modelingData->hasNamedColorProf!=NoNamedColorProfile) 05106 { 05107 /* prepare the tag table */ 05108 tagH = modelingData->theNamedColorTagData; 05109 if (tagH==NULL){ 05110 err = cmparamErr; 05111 goto CleanUp; 05112 } 05113 LOCK_DATA(tagH); 05114 05115 namedData = (icNamedColor2Type *)DATA_2_PTR(tagH); 05116 err = CMConvNameToIndex( namedData, Ptr2Name, Arr2Indices, count ); 05117 UNLOCK_DATA(tagH); 05118 } 05119 CleanUp: 05120 UNLOCK_DATA( Storage ); 05121 LH_END_PROC("CMConvNameToIndexCW") 05122 return err; 05123 }

CMError CMConvNameToIndexProfile CMProfileRef  aProf,
pcCMColorName  Ptr2Name,
unsigned long *  Arr2Indices,
unsigned long  count
 

Definition at line 5125 of file lh_core/runtime.c.

References CMConvNameToIndex(), CMError, CMGetPartialProfileElement(), cmparamErr, DisposeIfPtr(), icSigNamedColor2Tag, LH_END_PROC, LH_START_PROC, Ptr, and SmartNewPtr().

05126 { 05127 CMError err; 05128 short aOSerr; 05129 icNamedColor2Type *aName = 0; 05130 unsigned long byteCount; 05131 05132 LH_START_PROC("CMConvNameToIndexProfile") 05133 05134 if( aProf == 0 )return cmparamErr; 05135 err = CMGetPartialProfileElement( aProf, 05136 icSigNamedColor2Tag, 05137 0, 05138 &byteCount, 05139 0 ); 05140 if (err) 05141 goto CleanupAndExit; 05142 aName = (icNamedColor2Type *)SmartNewPtr( byteCount, &aOSerr ); 05143 err = aOSerr; 05144 if (err) 05145 goto CleanupAndExit; 05146 err = CMGetPartialProfileElement( aProf, 05147 icSigNamedColor2Tag, 05148 0, 05149 &byteCount, 05150 (Ptr)aName ); 05151 if (err){ 05152 goto CleanupAndExit; 05153 } 05154 05155 #ifdef IntelMode 05156 SwapLongOffset( &aName->ncolor.count, 0, 4 ); 05157 SwapLongOffset( &aName->ncolor.nDeviceCoords, 0, 4 ); 05158 #endif 05159 err = CMConvNameToIndex( aName, Ptr2Name, Arr2Indices, count ); 05160 05161 CleanupAndExit: 05162 DisposeIfPtr( (Ptr)aName ); 05163 LH_END_PROC("CMConvNameToIndexProfile") 05164 return err; 05165 }

CMError CMGetNamedProfileInfoCW CMWorldRef Storage,
pCMNamedProfileInfo  Info
 

Definition at line 5344 of file lh_core/runtime.c.

References CMError, CMMModelPtr, cmparamErr, DATA_2_PTR, LH_END_PROC, LH_START_PROC, LOCK_DATA, LUT_DATA_TYPE, noErr, NoNamedColorProfile, NULL, OSErr, Ptr, and UNLOCK_DATA.

05345 { 05346 LUT_DATA_TYPE tagH = NULL; 05347 OSErr err = noErr; 05348 CMMModelPtr modelingData; 05349 Ptr tagTbl; 05350 05351 LH_START_PROC("CMGetNamedProfileInfoCW") 05352 05353 if( Storage == 0 )return cmparamErr; 05354 LOCK_DATA( Storage ); 05355 modelingData = (CMMModelPtr)(DATA_2_PTR( Storage )); 05356 if( modelingData->hasNamedColorProf != NoNamedColorProfile ){ 05357 /* prepare the tag table */ 05358 tagH = modelingData->theNamedColorTagData; 05359 if (tagH==NULL){ 05360 err = cmparamErr; 05361 goto CleanUp; 05362 } 05363 LOCK_DATA(tagH); 05364 05365 /* tagTbl should now point to beginning of first device data */ 05366 /* = CMNamedColor2Type_header(84) + firstName(32) + PCSSize(3*2) */ 05367 tagTbl = (Ptr)DATA_2_PTR(tagH) + 8; 05368 05369 memcpy( Info, tagTbl, sizeof( CMNamedProfileInfo )); 05370 UNLOCK_DATA(tagH); 05371 } 05372 CleanUp: 05373 UNLOCK_DATA( Storage ); 05374 LH_END_PROC("CMGetNamedProfileInfoCW") 05375 return err; 05376 }

CMError CMGetNamedProfileInfoProfile CMProfileRef  aProf,
pCMNamedProfileInfo  Info
 

Definition at line 5295 of file lh_core/runtime.c.

References CMError, CMGetPartialProfileElement(), cmparamErr, DisposeIfPtr(), icSigNamedColor2Tag, LH_END_PROC, LH_START_PROC, noErr, Ptr, and SmartNewPtr().

05296 { 05297 CMError err = noErr; 05298 Ptr tagTbl; 05299 short aOSerr; 05300 icNamedColor2Type *aName = 0; 05301 unsigned long byteCount; 05302 05303 LH_START_PROC("CMGetNamedProfileInfoProfile") 05304 05305 if( aProf == 0 )return cmparamErr; 05306 err = CMGetPartialProfileElement( aProf, 05307 icSigNamedColor2Tag, 05308 0, 05309 &byteCount, 05310 0 ); 05311 if (err) 05312 goto CleanupAndExit; 05313 aName = (icNamedColor2Type *)SmartNewPtr( byteCount, &aOSerr ); 05314 err = aOSerr; 05315 if (err) 05316 goto CleanupAndExit; 05317 err = CMGetPartialProfileElement( aProf, 05318 icSigNamedColor2Tag, 05319 0, 05320 &byteCount, 05321 (Ptr)aName ); 05322 if (err){ 05323 goto CleanupAndExit; 05324 } 05325 05326 05327 /* = CMNamedColor2Type_header(84) + firstName(32) + PCSSize(3*2) */ 05328 tagTbl = (Ptr)aName + 8; 05329 05330 #ifdef IntelMode 05331 SwapLongOffset( &aName->ncolor.count, 0, 4 ); 05332 SwapLongOffset( &aName->ncolor.nDeviceCoords, 0, 4 ); 05333 SwapLongOffset( &aName->ncolor.vendorFlag, 0, 4 ); 05334 #endif 05335 memcpy( Info, tagTbl, sizeof( CMNamedProfileInfo )); 05336 CleanupAndExit: 05337 05338 /* Clean up allocated storage */ 05339 DisposeIfPtr((Ptr) aName); 05340 LH_END_PROC("CMGetNamedProfileInfoProfile") 05341 return err; 05342 }

OSErr Convert10To16 Ptr  dataPtr10,
Ptr  dataPtr16,
SINT32  startLine,
SINT32  height,
SINT32  width,
SINT32  rowBytes10
 

Definition at line 415 of file lh_core/runtime.c.

References LH_END_PROC, LH_START_PROC, noErr, OSErr, SINT32, UINT16, and UINT32.

00421 { 00422 UINT16 data16; 00423 UINT32 data32; 00424 UINT32* srcPtr32; 00425 UINT16* destPtr16 = (UINT16*)dataPtr16; 00426 SINT32 lineLoop; 00427 SINT32 pixelLoop; 00428 OSErr err = noErr; 00429 00430 LH_START_PROC("Convert10To16") 00431 for (lineLoop = startLine; lineLoop < startLine + height; lineLoop++) 00432 { 00433 srcPtr32 = (UINT32*)( dataPtr10 + (lineLoop * rowBytes10)); 00434 for (pixelLoop = 0; pixelLoop < width; pixelLoop++) 00435 { 00436 data32 = *srcPtr32++; 00437 data16 = (UINT16)(data32>>14) & 0x0FFC0; 00438 *destPtr16++ = data16 | data16>>10; 00439 data16 = (UINT16)(data32>>4) & 0x0FFC0; 00440 *destPtr16++ = data16 | data16>>10; 00441 data16 = (UINT16)(data32<<6); 00442 *destPtr16++ = data16 | data16>>10; 00443 } 00444 } 00445 LH_END_PROC("Convert10To16") 00446 return err; 00447 }

OSErr Convert16To10 Ptr  dataPtr16,
Ptr  dataPtr10,
SINT32  startLine,
SINT32  height,
SINT32  width,
SINT32  rowBytes10
 

Definition at line 379 of file lh_core/runtime.c.

References LH_END_PROC, LH_START_PROC, noErr, OSErr, SINT32, UINT16, and UINT32.

00385 { 00386 UINT32 data16_1; 00387 UINT32 data16_2; 00388 UINT32 data16_3; 00389 UINT16* srcPtr16 = (UINT16*)dataPtr16; 00390 UINT32* destPtr32; 00391 SINT32 lineLoop; 00392 SINT32 pixelLoop; 00393 OSErr err = noErr; 00394 00395 LH_START_PROC("Convert16To10") 00396 for (lineLoop = startLine; lineLoop < startLine + height; lineLoop++) 00397 { 00398 destPtr32 = (UINT32*)( dataPtr10 + (lineLoop * rowBytes10)); 00399 for (pixelLoop = 0; pixelLoop < width; pixelLoop++) 00400 { 00401 data16_1 = ((UINT32)*srcPtr16++ & 0x0000FFC0) << 14; 00402 data16_2 = ((UINT32)*srcPtr16++ & 0x0000FFC0) << 4; 00403 data16_3 = ((UINT32)*srcPtr16++ & 0x0000FFC0) >> 6; 00404 *destPtr32++ = data16_1 | data16_2 | data16_3; 00405 } 00406 } 00407 LH_END_PROC("Convert16To10") 00408 return err; 00409 }

OSErr Convert5To8 Ptr  dataPtr5,
Ptr  dataPtr8,
SINT32  startLine,
SINT32  height,
SINT32  width,
SINT32  rowBytes5
 

Definition at line 166 of file lh_core/runtime.c.

References LH_END_PROC, LH_START_PROC, noErr, OSErr, SINT32, UINT16, and UINT8.

00172 { 00173 UINT16* srcPtr16; 00174 UINT8* destPtr8 = (UINT8*)dataPtr8; 00175 UINT8 data8; 00176 UINT16 three5Bits; 00177 SINT32 lineLoop; 00178 SINT32 pixelLoop; 00179 OSErr err = noErr; 00180 00181 LH_START_PROC("Convert5To8") 00182 for (lineLoop = startLine; lineLoop < startLine + height; lineLoop++) 00183 { 00184 srcPtr16 = (UINT16*)(dataPtr5 + (lineLoop*rowBytes5)); 00185 for (pixelLoop = 0; pixelLoop < width; pixelLoop++) 00186 { 00187 three5Bits = *srcPtr16++; 00188 00189 data8 = (three5Bits >> 10) & 0x001F; 00190 *destPtr8++ = (data8 << 3) | (data8 >>2); 00191 00192 data8 = (three5Bits >> 5) & 0x001F; 00193 *destPtr8++ = (data8 << 3) | (data8 >>2); 00194 00195 data8 = three5Bits & 0x001F; 00196 *destPtr8++ = (data8 << 3) | (data8 >>2); 00197 } 00198 } 00199 LH_END_PROC("Convert5To8") 00200 return err; 00201 }

OSErr Convert8To1 Ptr  dataPtr8,
Ptr  dataPtr5,
SINT32  startLine,
SINT32  height,
SINT32  width,
SINT32  rowBytes5
 

Definition at line 336 of file lh_core/runtime.c.

References LH_END_PROC, LH_START_PROC, noErr, OSErr, SINT32, and UINT8.

00342 { 00343 UINT8* destPtr8; 00344 UINT8* srcPtr8 = (UINT8*)dataPtr8; 00345 UINT8 theWord = 0; 00346 SINT32 lineLoop; 00347 SINT32 pixelLoop; 00348 OSErr err = noErr; 00349 00350 LH_START_PROC("Convert8To1") 00351 for (lineLoop = startLine; lineLoop < startLine + height; lineLoop++) 00352 { 00353 destPtr8 = (UINT8*)(dataPtr1 + (lineLoop*rowBytes1)); 00354 for ( pixelLoop = 0; pixelLoop < width; pixelLoop++ ) 00355 { 00356 if (*srcPtr8) 00357 theWord |= (1<< (7- ( pixelLoop & 7))); 00358 if ( (pixelLoop & 7) == 7) 00359 { 00360 *destPtr8++ = theWord; 00361 theWord = 0; 00362 } 00363 srcPtr8 ++; 00364 } 00365 if (width % 8) 00366 { 00367 *destPtr8 = theWord | ( ((unsigned char)255 >> (width % 8))); 00368 theWord = 0; 00369 } 00370 } 00371 LH_END_PROC("Convert8To1") 00372 return err; 00373 }

OSErr Convert8To5 Ptr  dataPtr8,
Ptr  dataPtr5,
SINT32  startLine,
SINT32  height,
SINT32  width,
SINT32  rowBytes5
 

Definition at line 207 of file lh_core/runtime.c.

References LH_END_PROC, LH_START_PROC, noErr, OSErr, SINT32, UINT16, and UINT8.

00213 { 00214 UINT16* destPtr16; 00215 UINT8* srcPtr8 = (UINT8*)dataPtr8; 00216 UINT16 three5Bits; 00217 SINT32 lineLoop; 00218 SINT32 pixelLoop; 00219 OSErr err = noErr; 00220 00221 LH_START_PROC("Convert8To5") 00222 for (lineLoop = startLine; lineLoop < startLine + height; lineLoop++) 00223 { 00224 destPtr16 = (UINT16*)(dataPtr5 + (lineLoop*rowBytes5)); 00225 for (pixelLoop = 0; pixelLoop < width; pixelLoop++) 00226 { 00227 three5Bits = (((UINT16)*srcPtr8 & 0x00F8) << 7); 00228 srcPtr8++; 00229 three5Bits |= (((UINT16)*srcPtr8 & 0x00F8) << 2); 00230 srcPtr8++; 00231 three5Bits |= (((UINT16)*srcPtr8 & 0x00F8) >> 3); 00232 srcPtr8++; 00233 00234 *destPtr16++ = three5Bits; 00235 } 00236 } 00237 LH_END_PROC("Convert8To5") 00238 return err; 00239 }

CMError ConvertIndexToLabBitmap CMMModelPtr  modelingData,
Ptr  InBuffer,
Ptr  OutBuffer,
UINT32  processedLinesIn,
UINT32  lineCount,
UINT32  inWidth,
UINT32  inRowBytes,
UINT32  outRowBytes,
UINT32  outputSize
 

Definition at line 4948 of file lh_core/runtime.c.

04957 { 04958 OSErr err = noErr; 04959 LUT_DATA_TYPE tagH=NULL; 04960 UINT16 *tagTbl = NULL,*ColorPtr = NULL; 04961 UINT32 *imgIn=NULL; 04962 UINT8 *imgOut=NULL; 04963 int deviceChannelCount,elemSz; 04964 UINT32 i,j,index,countNamesInProfile; 04965 04966 LH_START_PROC("ConvertIndexToLabBitmap") 04967 /* set up the table for indexing */ 04968 tagH = modelingData->theNamedColorTagData; 04969 if (tagH==NULL) { 04970 err = cmparamErr; 04971 goto CleanUp; 04972 } 04973 04974 LOCK_DATA(tagH); 04975 tagTbl = (UINT16 *)DATA_2_PTR(tagH) + 58; /* points to PCS */ 04976 deviceChannelCount = ((icNamedColor2Type *)DATA_2_PTR(tagH))->ncolor.nDeviceCoords; 04977 countNamesInProfile = ((icNamedColor2Type *)DATA_2_PTR(tagH))->ncolor.count; 04978 if (deviceChannelCount==3) { 04979 elemSz = 32+(3+3)*sizeof(UINT16); 04980 } else if (deviceChannelCount==4) { 04981 elemSz = 32+(3+4)*sizeof(UINT16); 04982 } else if (deviceChannelCount==0) { 04983 elemSz = 32+(3+0)*sizeof(UINT16); 04984 } else { 04985 err = cmparamErr; 04986 goto CleanUp; 04987 } 04988 elemSz/=2; 04989 04990 /* ...and convert the data from index to PCS values */ 04991 for( i=processedLinesIn; i<processedLinesIn+lineCount; i++ ){ 04992 imgIn = (UINT32 *)(InBuffer + i * inRowBytes); 04993 imgOut = (UINT8*)OutBuffer + (i-processedLinesIn) * outRowBytes; 04994 if( outputSize == 24 ){ 04995 for (j=0;j<inWidth;j++) { 04996 index = *imgIn++; 04997 if( index == 0 || index > countNamesInProfile ){ 04998 err = cmNamedColorNotFound; 04999 goto CleanUp; 05000 } 05001 05002 ColorPtr = tagTbl + (index-1)*elemSz; 05003 *imgOut++ = (*ColorPtr++)>>8; 05004 *imgOut++ = (*ColorPtr++)>>8; 05005 *imgOut++ = (*ColorPtr++)>>8; 05006 } 05007 } 05008 else if( outputSize == 32 ){ 05009 for (j=0;j<inWidth;j++) { 05010 index = *imgIn++; 05011 if( index == 0 || index > countNamesInProfile ){ 05012 err = cmNamedColorNotFound; 05013 goto CleanUp; 05014 } 05015 05016 ColorPtr = tagTbl + (index-1)*elemSz; 05017 *imgOut++ = (*ColorPtr++)>>8; 05018 *imgOut++ = (*ColorPtr++)>>8; 05019 *imgOut = (*ColorPtr++)>>8; 05020 imgOut += 2; 05021 } 05022 } 05023 } 05024 CleanUp: 05025 UNLOCK_DATA(tagH); 05026 LH_END_PROC("ConvertIndexToLabBitmap") 05027 return err; 05028 }

CMError ConvertLabToIndexBitmap CMMModelPtr  modelingData,
Ptr  InBuffer,
UINT32  processedLinesIn,
UINT32  inLineCount,
UINT32  width,
UINT32  rowBytes
 

Definition at line 4865 of file lh_core/runtime.c.

04871 { 04872 OSErr err = noErr; 04873 LUT_DATA_TYPE tagH=NULL; 04874 UINT16 *tagTbl = NULL,*colorPtr = NULL; 04875 int deviceChannelCount,elemSz,count; 04876 UINT32 i,j,k,index,dE,dEnow; 04877 UINT16 LL,aa,bb; 04878 UINT8 *imgIn=NULL,*imgOut=NULL; 04879 UINT32 *imgInPtr=NULL; 04880 UINT8 *imgInPtr8=NULL; 04881 UINT8 *imgOutPtr8=NULL; 04882 04883 LH_START_PROC("ConvertLabToIndexBitmap") 04884 /* prepare the tag table */ 04885 tagH = modelingData->theNamedColorTagData; 04886 if (tagH==NULL){ 04887 err = cmparamErr; 04888 goto CleanUp; 04889 } 04890 LOCK_DATA(tagH); 04891 tagTbl = (UINT16 *)DATA_2_PTR(tagH) + 58; 04892 count = ((icNamedColor2Type *)DATA_2_PTR(tagH))->ncolor.count; 04893 deviceChannelCount = ((icNamedColor2Type *)DATA_2_PTR(tagH))->ncolor.nDeviceCoords; 04894 if (deviceChannelCount == 3){ 04895 elemSz = 32+(3+3)*sizeof(SINT16); 04896 } 04897 else if (deviceChannelCount == 4){ 04898 elemSz = 32+(3+4)*sizeof(SINT16); 04899 } 04900 else if (deviceChannelCount == 0){ 04901 elemSz = 32+(3+0)*sizeof(SINT16); 04902 } 04903 else{ 04904 err = cmparamErr; 04905 goto CleanUp; 04906 } 04907 elemSz /= 2; 04908 04909 /* search for index */ 04910 imgIn = (UINT8*)InBuffer + processedLinesIn * rowBytes; 04911 imgInPtr8=((UINT8 *)imgIn); 04912 LL = *(imgInPtr8+0)+1; /* do not use cache for first pixel */ 04913 for (i = 0; i < inLineCount; i++){ 04914 for (j = 0; j < width; j++){ 04915 imgInPtr8=((UINT8 *)imgIn+j*4); 04916 if( LL == *(imgInPtr8+0) ){ 04917 if( aa == *(imgInPtr8+1) && bb == *(imgInPtr8+2) ){ 04918 *((UINT32 *)imgIn+j) = index+1; 04919 continue; 04920 } 04921 } 04922 LL = *(imgInPtr8+0); 04923 aa = *(imgInPtr8+1); 04924 bb = *(imgInPtr8+2); 04925 /* go through the whole table to find the closest one*/ 04926 dEnow = 0x40000; /* just arbitrarily high = 256*256*4 */ 04927 index =(UINT32)-1; 04928 colorPtr = tagTbl; 04929 for (k = 0; k < (UINT32)count; k++){ 04930 dE = POS((long)aa - (*(colorPtr+1)>>8)); 04931 dE = dE + POS((long)bb - (*(colorPtr+2)>>8)); 04932 dE = 2*dE + (dE>>1) + POS((long)LL - (*(colorPtr)>>8)); /* Quantization L = 2.55 * (a|b) */ 04933 if (dE < dEnow){ 04934 index = k; 04935 dEnow = dE; 04936 } 04937 colorPtr += elemSz; 04938 } 04939 *((UINT32 *)imgIn+j) = index+1; 04940 } 04941 imgIn+=rowBytes; 04942 } 04943 CleanUp: 04944 UNLOCK_DATA(tagH); 04945 LH_END_PROC("ConvertLabToIndexBitmap") 04946 return err; 04947 }

OSErr ConvertNamedIndexToColors CMMModelPtr  modelingData,
CMColor theData,
SINT32  pixCnt
 

Definition at line 4605 of file lh_core/runtime.c.

References PI_CMYKCOLOR::black, PI_RGBCOLOR::blue, cmNamedColorNotFound, cmparamErr, CMColor::cmyk, PI_CMYKCOLOR::cyan, DATA_2_PTR, PI_RGBCOLOR::green, LH_END_PROC, LH_START_PROC, LOCK_DATA, LUT_DATA_TYPE, PI_CMYKCOLOR::magenta, CMColor::namedColor, PI_NAMEDCOLOR::namedColorIndex, noErr, NoNamedColorProfile, NULL, OSErr, PI_RGBCOLOR::red, CMColor::rgb, SINT16, UINT16, UINT32, UNLOCK_DATA, and PI_CMYKCOLOR::yellow.

04608 { 04609 UINT16 *tagTbl = NULL; 04610 LUT_DATA_TYPE tagH = NULL; 04611 OSErr err = noErr; 04612 UINT32 i,index; 04613 UINT16 *colorPtr=NULL; 04614 int elemSz,deviceChannelCount,count; 04615 04616 LH_START_PROC("ConvertNamedIndexToColors") 04617 04618 if ( modelingData->hasNamedColorProf!=NoNamedColorProfile) 04619 { 04620 /* prepare the tag table */ 04621 tagH = modelingData->theNamedColorTagData; 04622 if (tagH==NULL) 04623 { 04624 err = cmparamErr; 04625 goto CleanUp; 04626 } 04627 LOCK_DATA(tagH); 04628 04629 /* tagTbl should now point to beginning of first device data */ 04630 /* = CMNamedColor2Type_header(84) + firstName(32) + PCSSize(3*2) */ 04631 tagTbl = (UINT16 *)DATA_2_PTR(tagH) + 61; 04632 04633 /* find out how many bytes to skip per element. div'ed 2 for indexing purpose */ 04634 count = ((icNamedColor2Type *)DATA_2_PTR(tagH))->ncolor.count; 04635 deviceChannelCount = ((icNamedColor2Type *)DATA_2_PTR(tagH))->ncolor.nDeviceCoords; 04636 if (deviceChannelCount==3) 04637 { 04638 elemSz = 32+(3+3)*sizeof(SINT16); 04639 } else if (deviceChannelCount == 4) 04640 { 04641 elemSz = 32+(3+4)*sizeof(SINT16); 04642 } else if (deviceChannelCount == 0) 04643 { 04644 elemSz = 32+(3+0)*sizeof(SINT16); 04645 } else 04646 { 04647 err = cmparamErr; 04648 goto CleanUp; 04649 } 04650 elemSz/=2; 04651 04652 /* doing the actual */ 04653 for (i=0; i<(UINT32)pixCnt; i++) 04654 { 04655 /* go to the index'th element*/ 04656 index = theData->namedColor.namedColorIndex; 04657 if (index > (UINT32)count || index == 0 ) 04658 { 04659 err = cmNamedColorNotFound; 04660 goto CleanUp; 04661 } 04662 colorPtr = tagTbl + (index-1)*elemSz; 04663 /* put in all the info */ 04664 if (deviceChannelCount==3) 04665 { 04666 theData->rgb.red = *colorPtr++; 04667 theData->rgb.green = *colorPtr++; 04668 theData->rgb.blue = *colorPtr++; 04669 } else if (deviceChannelCount==4) 04670 { 04671 theData->cmyk.cyan = *colorPtr++; 04672 theData->cmyk.magenta = *colorPtr++; 04673 theData->cmyk.yellow = *colorPtr++; 04674 theData->cmyk.black = *colorPtr++; 04675 } 04676 theData++; 04677 } 04678 UNLOCK_DATA(tagH); 04679 } 04680 CleanUp: 04681 LH_END_PROC("ConvertNamedIndexToColors") 04682 return err; 04683 }

OSErr ConvertNamedIndexToPCS CMMModelPtr  cw,
CMColor theData,
SINT32  pixCnt
 

Definition at line 4690 of file lh_core/runtime.c.

04693 { 04694 UINT16 *tagTbl = NULL; 04695 LUT_DATA_TYPE tagH = NULL; 04696 OSErr err = noErr; 04697 UINT32 i,index; 04698 UINT16 *colorPtr=NULL; 04699 int elemSz,deviceChannelCount,count; 04700 CMMModelPtr modelingData = (CMMModelPtr)cw; 04701 04702 04703 LH_START_PROC("ConvertNamedIndexToPCS") 04704 if( cw == 0 )return cmparamErr; 04705 { 04706 /* prepare the tag table */ 04707 tagH = modelingData->theNamedColorTagData; 04708 if (tagH == NULL) 04709 { 04710 err = cmparamErr; 04711 goto CleanUp; 04712 } 04713 LOCK_DATA(tagH); 04714 04715 /* tagTbl should now point to beginning of first PCS data */ 04716 /* = CMNamedColor2Type_header(84) + firstName(32) */ 04717 tagTbl = (UINT16 *)DATA_2_PTR(tagH) + 58; 04718 04719 /* find out how many bytes to skip per element. div'ed 2 for indexing purpose */ 04720 count = ((icNamedColor2Type *)DATA_2_PTR(tagH))->ncolor.count; 04721 deviceChannelCount = ((icNamedColor2Type *)DATA_2_PTR(tagH))->ncolor.nDeviceCoords; 04722 if (deviceChannelCount == 3) 04723 { 04724 elemSz = 32+(3+3)*sizeof(SINT16); 04725 } else if (deviceChannelCount == 4) 04726 { 04727 elemSz = 32+(3+4)*sizeof(SINT16); 04728 } else if (deviceChannelCount == 0) 04729 { 04730 elemSz = 32+(3+0)*sizeof(SINT16); 04731 } else 04732 { 04733 err = cmparamErr; 04734 goto CleanUp; 04735 } 04736 elemSz /= 2; 04737 04738 /* doing the actual */ 04739 for (i=0; i<(UINT32)pixCnt; i++) 04740 { 04741 /* go to the index'th element*/ 04742 index = theData->namedColor.namedColorIndex; 04743 if (index > (UINT32)count || index == 0 ) 04744 { 04745 err = cmNamedColorNotFound; 04746 goto CleanUp; 04747 } 04748 colorPtr = tagTbl + (index-1)*elemSz; 04749 /* put in all the info */ 04750 theData->Lab.L = *colorPtr++; 04751 theData->Lab.a = *colorPtr++; 04752 theData->Lab.b = *colorPtr++; 04753 theData++; 04754 } 04755 UNLOCK_DATA(tagH); 04756 } 04757 CleanUp: 04758 LH_END_PROC("ConvertNamedIndexToPCS") 04759 return err; 04760 }

OSErr ConvertPCSToNamedIndex CMMModelPtr  modelingData,
CMColor theData,
SINT32  pixCnt
 

Definition at line 4770 of file lh_core/runtime.c.

References PI_LabCOLOR::a, PI_LabCOLOR::b, cmparamErr, DATA_2_PTR, PI_LabCOLOR::L, CMColor::Lab, LH_END_PROC, LH_START_PROC, LOCK_DATA, LUT_DATA_TYPE, CMColor::namedColor, PI_NAMEDCOLOR::namedColorIndex, NamedColorProfileAtEnd, noErr, NULL, OSErr, POS, SINT16, UINT16, UINT32, and UNLOCK_DATA.

04773 { 04774 UINT16 *tagTbl = NULL; 04775 LUT_DATA_TYPE tagH = NULL; 04776 OSErr err = noErr; 04777 UINT32 i,j,index,dE,dEnow; 04778 UINT16 *colorPtr=NULL; 04779 int elemSz,deviceChannelCount,count; 04780 04781 LH_START_PROC("ConvertPCSToNamedIndex") 04782 if (modelingData->hasNamedColorProf == NamedColorProfileAtEnd) 04783 { 04784 /* prepare the tag table */ 04785 tagH = modelingData->theNamedColorTagData; 04786 if (tagH==NULL) 04787 { 04788 err = cmparamErr; 04789 goto CleanUp; 04790 } 04791 LOCK_DATA(tagH); 04792 04793 /* tagTbl should now point to beginning of first PCS data */ 04794 /* = CMNamedColor2Type_header(84) + firstName(32) */ 04795 tagTbl = (UINT16 *)DATA_2_PTR(tagH) + 58; 04796 04797 /* find out how many bytes to skip per element. div'ed 2 for indexing purpose */ 04798 count = ((icNamedColor2Type *)DATA_2_PTR(tagH))->ncolor.count; 04799 deviceChannelCount = ((icNamedColor2Type *)DATA_2_PTR(tagH))->ncolor.nDeviceCoords; 04800 if (deviceChannelCount == 3) 04801 { 04802 elemSz = 32+(3+3)*sizeof(SINT16); 04803 } else if (deviceChannelCount == 4) 04804 { 04805 elemSz = 32+(3+4)*sizeof(SINT16); 04806 } else if (deviceChannelCount == 0) 04807 { 04808 elemSz = 32+(3+0)*sizeof(SINT16); 04809 } else 04810 { 04811 err = cmparamErr; 04812 goto CleanUp; 04813 } 04814 elemSz/=2; 04815 04816 /* doing the actual */ 04817 for (i=0; i < (UINT32)pixCnt; i++) 04818 { 04819 /* go through the whole table to find the closest one*/ 04820 dEnow = 0x40000; /* just arbitrarily high = 256*256*4 */ 04821 index = (UINT32)-1; 04822 colorPtr = tagTbl; 04823 for (j=0; j < (UINT32)count; j++) 04824 { 04825 dE = POS((long)theData->Lab.a - *(colorPtr+1)); 04826 dE = dE + POS((long)theData->Lab.b - *(colorPtr+2)); 04827 dE = 2*dE + (dE>>1) + POS((long)theData->Lab.L - *(colorPtr)); 04828 if (dE < dEnow) 04829 { 04830 index = j; 04831 dEnow = dE; 04832 } 04833 colorPtr += elemSz; 04834 } 04835 theData->namedColor.namedColorIndex = index+1; 04836 theData++; 04837 } 04838 UNLOCK_DATA(tagH); 04839 } 04840 CleanUp: 04841 LH_END_PROC("ConvertPCSToNamedIndex") 04842 return err; 04843 }

void CopyIndexData CMBitmap bitMapIn,
CMBitmap bitMapOut,
ColorSpaceInfo info
 

Definition at line 3933 of file lh_core/runtime.c.

References CMError, CMBitmap::height, CMBitmap::image, ColorSpaceInfo::inputPixelSize, LH_END_PROC, LH_START_PROC, NULL, ColorSpaceInfo::outputPixelSize, Ptr, CMBitmap::rowBytes, SINT32, and CMBitmap::width.

03934 { 03935 Ptr imgIn=NULL; 03936 Ptr imgOut=NULL; 03937 SINT32 i,j; 03938 #ifdef DEBUG_OUTPUT 03939 CMError err = -1; 03940 #endif 03941 LH_START_PROC("CopyIndexData") 03942 03943 for( i=0; i<bitMapIn->height; i++ ){ 03944 imgIn = bitMapIn->image + i * bitMapIn->rowBytes; 03945 imgOut = bitMapOut->image + i * bitMapOut->rowBytes; 03946 if( info->inputPixelSize == 24 ){ 03947 if( info->outputPixelSize == 24 ){ 03948 for (j=0;j<bitMapIn->width;j++) { 03949 *imgOut++ = *imgIn++; 03950 *imgOut++ = *imgIn++; 03951 *imgOut++ = *imgIn++; 03952 } 03953 } 03954 else if( info->outputPixelSize == 32 ){ 03955 for (j=0;j<bitMapIn->width;j++) { 03956 *imgOut++ = *imgIn++; 03957 *imgOut++ = *imgIn++; 03958 *imgOut++ = *imgIn++; 03959 imgOut++; 03960 } 03961 } 03962 } 03963 else if( info->inputPixelSize == 32 ){ 03964 if( info->outputPixelSize == 24 ){ 03965 for (j=0;j<bitMapIn->width;j++) { 03966 *imgOut++ = *imgIn++; 03967 *imgOut++ = *imgIn++; 03968 *imgOut++ = *imgIn++; 03969 imgIn++; 03970 } 03971 } 03972 else if( info->outputPixelSize == 32 ){ 03973 for (j=0;j<bitMapIn->width;j++) { 03974 *imgOut++ = *imgIn++; 03975 *imgOut++ = *imgIn++; 03976 *imgOut++ = *imgIn++; 03977 imgOut++; 03978 imgIn++; 03979 } 03980 } 03981 } 03982 } 03983 LH_END_PROC("CopyIndexData") 03984 return; 03985 }

CMError Do555To8Setup CMCalcParamPtr  calcParam,
ColorSpaceInfo info,
SINT32 theLinesAtOnce,
long  reverseOrder
 

Definition at line 672 of file lh_core/runtime.c.

References CMError, CMCalcParam::cmInputBytesPerLine, CMCalcParam::cmInputColorSpace, CMCalcParam::cmInputPixelOffset, CMCalcParam::cmLineCount, CMCalcParam::cmPixelPerLine, cmRGB24Space, CMCalcParam::inputData, ColorSpaceInfo::inputPixelSize, kMaxTempBlock, noErr, ColorSpaceInfo::origSizeIn, ColorSpaceInfo::processedLinesIn, Ptr, SINT16, SINT32, SmartNewPtr(), ColorSpaceInfo::tempInBuffer, and ColorSpaceInfo::usedSizeIn.

00673 { 00674 SINT32 newRowBytes,linesAtOnce,bufferSize; 00675 SINT16 iErr = noErr; 00676 00677 *theLinesAtOnce = 0; 00678 newRowBytes = calcParam->cmPixelPerLine * 3; /* TempBuffer -> cmRGB24Space */ 00679 linesAtOnce = (kMaxTempBlock) / newRowBytes; 00680 if (linesAtOnce == 0) 00681 linesAtOnce = 1; 00682 else if (linesAtOnce > calcParam->cmLineCount) 00683 linesAtOnce = calcParam->cmLineCount; 00684 00685 bufferSize = newRowBytes * linesAtOnce; 00686 info->processedLinesIn = 0; 00687 info->origSizeIn = 5; 00688 info->usedSizeIn = 8; 00689 info->tempInBuffer = (void*)SmartNewPtr(bufferSize, &iErr); 00690 info->inputPixelSize = 16; 00691 if (iErr != noErr) 00692 { 00693 return iErr; 00694 } 00695 calcParam->cmLineCount = linesAtOnce; 00696 calcParam->cmInputColorSpace = cmRGB24Space; 00697 calcParam->cmInputBytesPerLine = newRowBytes; 00698 if( reverseOrder ){ 00699 calcParam->inputData[2] = (Ptr)info->tempInBuffer; 00700 calcParam->inputData[1] = ((Ptr)info->tempInBuffer)+1; 00701 calcParam->inputData[0] = ((Ptr)info->tempInBuffer)+2; 00702 } 00703 else{ 00704 calcParam->inputData[0] = (Ptr)info->tempInBuffer; 00705 calcParam->inputData[1] = ((Ptr)info->tempInBuffer)+1; 00706 calcParam->inputData[2] = ((Ptr)info->tempInBuffer)+2; 00707 } 00708 calcParam->cmInputPixelOffset = 3; 00709 *theLinesAtOnce = linesAtOnce; 00710 return noErr; 00711 }

CMError Do8To555Setup CMCalcParamPtr  calcParam,
ColorSpaceInfo info,
SINT32 theLinesAtOnce,
long  reverseOrder
 

Definition at line 629 of file lh_core/runtime.c.

References CMError, CMCalcParam::cmLineCount, CMCalcParam::cmOutputBytesPerLine, CMCalcParam::cmOutputColorSpace, CMCalcParam::cmOutputPixelOffset, CMCalcParam::cmPixelPerLine, cmRGB24Space, kMaxTempBlock, noErr, ColorSpaceInfo::origSizeOut, CMCalcParam::outputData, ColorSpaceInfo::outputPixelSize, ColorSpaceInfo::processedLinesOut, Ptr, SINT16, SINT32, SmartNewPtr(), ColorSpaceInfo::tempOutBuffer, and ColorSpaceInfo::usedSizeOut.

00630 { 00631 SINT32 newRowBytes,linesAtOnce,bufferSize; 00632 SINT16 iErr = noErr; 00633 00634 *theLinesAtOnce = 0; 00635 newRowBytes = calcParam->cmPixelPerLine * 3; /* TempBuffer -> cmRGB24Space */ 00636 linesAtOnce = (kMaxTempBlock) / newRowBytes; 00637 if (linesAtOnce == 0) 00638 linesAtOnce = 1; 00639 else if (linesAtOnce > calcParam->cmLineCount) 00640 linesAtOnce = calcParam->cmLineCount; 00641 00642 bufferSize = newRowBytes * linesAtOnce; 00643 info->processedLinesOut = 0; 00644 info->origSizeOut = 5; 00645 info->usedSizeOut = 8; 00646 info->tempOutBuffer = (void*)SmartNewPtr(bufferSize, &iErr); 00647 info->outputPixelSize = 16; 00648 if (iErr != noErr) 00649 { 00650 return iErr; 00651 } 00652 00653 calcParam->cmLineCount = linesAtOnce; 00654 calcParam->cmOutputColorSpace = cmRGB24Space; 00655 calcParam->cmOutputBytesPerLine = newRowBytes; 00656 if( reverseOrder ){ 00657 calcParam->outputData[2] = (Ptr)info->tempOutBuffer; 00658 calcParam->outputData[1] = ((Ptr)info->tempOutBuffer)+1; 00659 calcParam->outputData[0] = ((Ptr)info->tempOutBuffer)+2; 00660 } 00661 else{ 00662 calcParam->outputData[0] = (Ptr)info->tempOutBuffer; 00663 calcParam->outputData[1] = ((Ptr)info->tempOutBuffer)+1; 00664 calcParam->outputData[2] = ((Ptr)info->tempOutBuffer)+2; 00665 } 00666 calcParam->cmOutputPixelOffset = 3; 00667 *theLinesAtOnce = linesAtOnce; 00668 return 0; 00669 }

CMError FillCalcParam CMCalcParamPtr  calcParam,
const CMBitmap bitMap,
const CMBitmap matchedBitMap
 

Definition at line 497 of file lh_core/runtime.c.

References CMError, CMCalcParam::cmInputBytesPerLine, CMCalcParam::cmInputColorSpace, CMCalcParam::cmLineCount, CMCalcParam::cmOutputBytesPerLine, CMCalcParam::cmOutputColorSpace, CMCalcParam::cmPixelPerLine, CMBitmap::height, LH_END_PROC, LH_START_PROC, noErr, CMBitmap::rowBytes, CMBitmap::space, and CMBitmap::width.

00500 { 00501 CMError err = noErr; 00502 00503 LH_START_PROC("FillCalcParam") 00504 00505 calcParam->cmInputColorSpace = bitMap->space; 00506 calcParam->cmOutputColorSpace = matchedBitMap->space; 00507 calcParam->cmPixelPerLine = bitMap->width; 00508 calcParam->cmInputBytesPerLine = bitMap->rowBytes; 00509 calcParam->cmOutputBytesPerLine = matchedBitMap->rowBytes; 00510 calcParam->cmLineCount = bitMap->height; 00511 00512 LH_END_PROC("FillCalcParam") 00513 return err; 00514 }

CMError FillCalcParamCM CMCalcParamPtr  calcParam,
CMLutParamPtr  lutParam,
CMColor myColors,
SINT32  count
 

Definition at line 520 of file lh_core/runtime.c.

References cm16PerChannelPacking, cm8PerChannelPacking, cmCMYKSpace, CMError, cmGraySpace, CMCalcParam::cmInputBytesPerLine, CMCalcParam::cmInputColorSpace, CMCalcParam::cmInputPixelOffset, CMCalcParam::cmLineCount, cmMCFiveSpace, CMCalcParam::cmOutputBytesPerLine, CMCalcParam::cmOutputColorSpace, CMCalcParam::cmOutputPixelOffset, CMCalcParam::cmPixelPerLine, cmRGBSpace, CMLutParam::colorLutInDim, CMLutParam::colorLutOutDim, CMCalcParam::inputData, LH_END_PROC, LH_START_PROC, noErr, CMCalcParam::outputData, Ptr, and SINT32.

00524 { 00525 SINT32 loop; 00526 CMError err = noErr; 00527 00528 LH_START_PROC("FillCalcParamCM") 00529 00530 calcParam->cmInputPixelOffset = sizeof(CMColor); 00531 calcParam->cmOutputPixelOffset = sizeof(CMColor); 00532 00533 /* ---------------------------------------------------------- handle input */ 00534 switch (lutParam->colorLutInDim) 00535 { 00536 case 1: 00537 calcParam->cmInputColorSpace = cmGraySpace; /* cmGraySpace is 16 bit */ 00538 calcParam->inputData[0] = (Ptr)myColors; 00539 break; 00540 case 3: 00541 calcParam->cmInputColorSpace = cmRGBSpace|cm16PerChannelPacking; 00542 calcParam->inputData[0] = ((Ptr)myColors); 00543 calcParam->inputData[1] = ((Ptr)myColors) + 2; 00544 calcParam->inputData[2] = ((Ptr)myColors) + 4; 00545 break; 00546 case 4: 00547 calcParam->cmInputColorSpace = cmCMYKSpace|cm16PerChannelPacking; 00548 calcParam->inputData[0] = ((Ptr)myColors); 00549 calcParam->inputData[1] = ((Ptr)myColors) + 2; 00550 calcParam->inputData[2] = ((Ptr)myColors) + 4; 00551 calcParam->inputData[3] = ((Ptr)myColors) + 6; 00552 break; 00553 case 5: 00554 case 6: 00555 case 7: 00556 case 8: 00557 #if ( CM_MAX_COLOR_CHANNELS == 15 ) 00558 case 2: 00559 case 9: 00560 case 10: 00561 case 11: 00562 case 12: 00563 case 13: 00564 case 14: 00565 case 15: 00566 #endif 00567 calcParam->cmInputColorSpace = cmMCFiveSpace + lutParam->colorLutInDim-5; 00568 calcParam->cmInputColorSpace |= cm8PerChannelPacking; 00569 for (loop = 0; loop<lutParam->colorLutInDim; loop++) 00570 calcParam->inputData[loop] = ((Ptr)myColors) + loop; 00571 break; 00572 } 00573 00574 /* ---------------------------------------------------------- handle output */ 00575 switch (lutParam->colorLutOutDim) 00576 { 00577 case 1: 00578 calcParam->cmOutputColorSpace = cmGraySpace; /* cmGraySpace is 16 bit */ 00579 calcParam->outputData[0] = (Ptr)myColors; 00580 break; 00581 case 3: 00582 calcParam->cmOutputColorSpace = cmRGBSpace|cm16PerChannelPacking; 00583 calcParam->outputData[0] = ((Ptr)myColors); 00584 calcParam->outputData[1] = ((Ptr)myColors) + 2; 00585 calcParam->outputData[2] = ((Ptr)myColors) + 4; 00586 break; 00587 case 4: 00588 calcParam->cmOutputColorSpace = cmCMYKSpace|cm16PerChannelPacking; 00589 calcParam->outputData[0] = ((Ptr)myColors); 00590 calcParam->outputData[1] = ((Ptr)myColors) + 2; 00591 calcParam->outputData[2] = ((Ptr)myColors) + 4; 00592 calcParam->outputData[3] = ((Ptr)myColors) + 6; 00593 break; 00594 case 5: 00595 case 6: 00596 case 7: 00597 case 8: 00598 #if ( CM_MAX_COLOR_CHANNELS == 15 ) 00599 case 2: 00600 case 9: 00601 case 10: 00602 case 11: 00603 case 12: 00604 case 13: 00605 case 14: 00606 case 15: 00607 #endif 00608 calcParam->cmOutputColorSpace = cmMCFiveSpace + lutParam->colorLutOutDim - 5; 00609 calcParam->cmOutputColorSpace |= cm8PerChannelPacking; 00610 for (loop = 0; loop<lutParam->colorLutOutDim; loop++) 00611 calcParam->outputData[loop] = ((Ptr)myColors) + loop; 00612 break; 00613 } 00614 calcParam->cmPixelPerLine = count; 00615 calcParam->cmInputBytesPerLine = count*sizeof(CMColor); 00616 calcParam->cmOutputBytesPerLine = count*sizeof(CMColor); 00617 calcParam->cmLineCount = 1; 00618 LH_END_PROC("FillCalcParamCM") 00619 return err; 00620 }

CMError FillLutParam CMLutParamPtr  lutParam,
CMMModelPtr  modelingData
 

Definition at line 457 of file lh_core/runtime.c.

References CMError, CMLutParam::colorLut, DATA_2_PTR, CMLutParam::inputLut, LH_END_PROC, LH_START_PROC, noErr, and CMLutParam::outputLut.

00459 { 00460 CMError err = noErr; 00461 00462 LH_START_PROC("FillLutParam") 00463 *lutParam = (modelingData)->lutParam; 00464 #if ! LUTS_ARE_PTR_BASED 00465 lutParam->inputLut = DATA_2_PTR(modelingData)->lutParam.inputLut; 00466 lutParam->outputLut = DATA_2_PTR(modelingData)->lutParam.outputLut; 00467 lutParam->colorLut = DATA_2_PTR(modelingData)->lutParam.colorLut; 00468 #endif 00469 LH_END_PROC("FillLutParam") 00470 return err; 00471 }

CMError FillLutParamChk CMLutParamPtr  lutParam,
CMMModelPtr  modelingData
 

Definition at line 477 of file lh_core/runtime.c.

References CMError, CMLutParam::colorLut, DATA_2_PTR, CMLutParam::inputLut, LH_END_PROC, LH_START_PROC, noErr, and CMLutParam::outputLut.

00479 { 00480 CMError err = noErr; 00481 00482 LH_START_PROC("FillLutParamChk") 00483 *lutParam = (modelingData)->gamutLutParam; 00484 #if ! LUTS_ARE_PTR_BASED 00485 lutParam->inputLut = DATA_2_PTR(modelingData)->gamutLutParam.inputLut; 00486 lutParam->outputLut = DATA_2_PTR(modelingData)->gamutLutParam.outputLut; 00487 lutParam->colorLut = DATA_2_PTR(modelingData)->gamutLutParam.colorLut; 00488 #endif 00489 LH_END_PROC("FillLutParamChk") 00490 return err; 00491 }

CalcProcPtr FindCalcRoutine const CMCalcParam calcParam,
const CMLutParam lutParam,
const ColorSpaceInfo info,
const Boolean  lookupOnly
 

Definition at line 2767 of file lh_core/runtime.c.

References CalcNDim_Data16To16_Lut16(), CalcNDim_Data16To16_Lut8(), CalcNDim_Data16To8_Lut16(), CalcNDim_Data16To8_Lut8(), CalcNDim_Data8To16_Lut16(), CalcNDim_Data8To16_Lut8(), CalcNDim_Data8To8_Lut16(), CalcNDim_Data8To8_Lut8(), CalcProcPtr, CMError, CMLutParam::colorLutGridPoints, CMLutParam::colorLutInDim, CMLutParam::colorLutOutDim, CMLutParam::colorLutWordSize, DebugPrint, FindLookupRoutine(), ColorSpaceInfo::inPlace, LH_END_PROC, LH_START_PROC, LHCalc1toX_Di16_Do16_Lut16_G128(), LHCalc1toX_Di16_Do16_Lut8_G128(), LHCalc1toX_Di16_Do8_Lut16_G128(), LHCalc1toX_Di16_Do8_Lut8_G128(), LHCalc1toX_Di8_Do16_Lut16_G128(), LHCalc1toX_Di8_Do16_Lut8_G128(), LHCalc1toX_Di8_Do8_Lut16_G128(), LHCalc1toX_Di8_Do8_Lut8_G128(), LHCalc3to3_Di16_Do16_Lut16_G16(), LHCalc3to3_Di16_Do16_Lut16_G32(), LHCalc3to3_Di16_Do16_Lut8_G16(), LHCalc3to3_Di16_Do16_Lut8_G32(), LHCalc3to3_Di16_Do8_Lut16_G16(), LHCalc3to3_Di16_Do8_Lut16_G32(), LHCalc3to3_Di16_Do8_Lut8_G16(), LHCalc3to3_Di16_Do8_Lut8_G32(), LHCalc3to3_Di8_Do16_Lut16_G16(), LHCalc3to3_Di8_Do16_Lut16_G32(), LHCalc3to3_Di8_Do16_Lut8_G16(), LHCalc3to3_Di8_Do16_Lut8_G32(), LHCalc3to3_Di8_Do8_Lut16_G16(), LHCalc3to3_Di8_Do8_Lut16_G32(), LHCalc3to3_Di8_Do8_Lut8_G16(), LHCalc3to3_Di8_Do8_Lut8_G16_F(), LHCalc3to3_Di8_Do8_Lut8_G32(), LHCalc3to3_Di8_Do8_Lut8_G32_F(), LHCalc3to4_Di16_Do16_Lut16_G16(), LHCalc3to4_Di16_Do16_Lut16_G32(), LHCalc3to4_Di16_Do16_Lut8_G16(), LHCalc3to4_Di16_Do16_Lut8_G32(), LHCalc3to4_Di16_Do8_Lut16_G16(), LHCalc3to4_Di16_Do8_Lut16_G32(), LHCalc3to4_Di16_Do8_Lut8_G16(), LHCalc3to4_Di16_Do8_Lut8_G32(), LHCalc3to4_Di8_Do16_Lut16_G16(), LHCalc3to4_Di8_Do16_Lut16_G32(), LHCalc3to4_Di8_Do16_Lut8_G16(), LHCalc3to4_Di8_Do16_Lut8_G32(), LHCalc3to4_Di8_Do8_Lut16_G16(), LHCalc3to4_Di8_Do8_Lut16_G32(), LHCalc3to4_Di8_Do8_Lut8_G16(), LHCalc3to4_Di8_Do8_Lut8_G16_F(), LHCalc3to4_Di8_Do8_Lut8_G32(), LHCalc3to4_Di8_Do8_Lut8_G32_F(), LHCalc4to3_Di16_Do16_Lut16_G16(), LHCalc4to3_Di16_Do16_Lut16_G8(), LHCalc4to3_Di16_Do16_Lut8_G16(), LHCalc4to3_Di16_Do16_Lut8_G8(), LHCalc4to3_Di16_Do8_Lut16_G16(), LHCalc4to3_Di16_Do8_Lut16_G8(), LHCalc4to3_Di16_Do8_Lut8_G16(), LHCalc4to3_Di16_Do8_Lut8_G8(), LHCalc4to3_Di8_Do16_Lut16_G16(), LHCalc4to3_Di8_Do16_Lut16_G8(), LHCalc4to3_Di8_Do16_Lut8_G16(), LHCalc4to3_Di8_Do16_Lut8_G8(), LHCalc4to3_Di8_Do8_Lut16_G16(), LHCalc4to3_Di8_Do8_Lut16_G8(), LHCalc4to3_Di8_Do8_Lut8_G16(), LHCalc4to3_Di8_Do8_Lut8_G16_F(), LHCalc4to3_Di8_Do8_Lut8_G8(), LHCalc4to3_Di8_Do8_Lut8_G8_F(), LHCalc4to4_Di16_Do16_Lut16_G16(), LHCalc4to4_Di16_Do16_Lut16_G8(), LHCalc4to4_Di16_Do16_Lut8_G16(), LHCalc4to4_Di16_Do16_Lut8_G8(), LHCalc4to4_Di16_Do8_Lut16_G16(), LHCalc4to4_Di16_Do8_Lut16_G8(), LHCalc4to4_Di16_Do8_Lut8_G16(), LHCalc4to4_Di16_Do8_Lut8_G8(), LHCalc4to4_Di8_Do16_Lut16_G16(), LHCalc4to4_Di8_Do16_Lut16_G8(), LHCalc4to4_Di8_Do16_Lut8_G16(), LHCalc4to4_Di8_Do16_Lut8_G8(), LHCalc4to4_Di8_Do8_Lut16_G16(), LHCalc4to4_Di8_Do8_Lut16_G8(), LHCalc4to4_Di8_Do8_Lut8_G16(), LHCalc4to4_Di8_Do8_Lut8_G16_F(), LHCalc4to4_Di8_Do8_Lut8_G8(), LHCalc4to4_Di8_Do8_Lut8_G8_F(), NewCalcProc, nil, noErr, SINT32, ColorSpaceInfo::usedSizeIn, and ColorSpaceInfo::usedSizeOut.

02771 { 02772 SINT32 index = 0; 02773 CalcProcPtr proc2call = nil; 02774 #ifdef DEBUG_OUTPUT 02775 CMError err = noErr; 02776 #endif 02777 02778 LH_START_PROC("FindCalcRoutine") 02779 02780 calcParam = calcParam; 02781 /* to reduce the code size change the next line to 0 - this will call DoNDim instead of the optimized functions */ 02782 #if 1 02783 if (lookupOnly) 02784 proc2call = FindLookupRoutine(lutParam, info); 02785 if (proc2call == nil) 02786 { 02787 switch ( lutParam->colorLutInDim ) 02788 { 02789 case 1: /* 1 -> */ 02790 switch ( lutParam->colorLutOutDim ) 02791 { 02792 case 1: /* 1 -> 1,3,4 */ 02793 case 3: /* 1 -> 1,3,4 */ 02794 case 4: /* 1 -> 1,3,4 */ 02795 switch (info->usedSizeIn) 02796 { 02797 case 8: /* 1 -> 1,3,4 Di 8 */ 02798 switch (info->usedSizeOut) 02799 { 02800 case 8: /* 1 -> 1,3,4 Di 8 Do 8 */ 02801 switch (lutParam->colorLutWordSize) 02802 { 02803 case 8: /* 1 -> 1,3,4 Di 8 Do 8 Lut 8 */ 02804 switch (lutParam->colorLutGridPoints) 02805 { 02806 #if LH_Calc1toX_Di8_Do8_Lut8_G128 != LH_CALC_USE_DO_N_DIM 02807 case 128: /* 1 -> 1,3,4 Di 8 Do 8 Lut 8 Grid 16 */ 02808 proc2call = NewCalcProc(LHCalc1toX_Di8_Do8_Lut8_G128); 02809 break; 02810 #endif 02811 } 02812 break; 02813 case 16: /* 1 -> 1,3,4 Di 8 Do 8 Lut 16 */ 02814 switch (lutParam->colorLutGridPoints) 02815 { 02816 #if LH_Calc1toX_Di8_Do8_Lut16_G128 != LH_CALC_USE_DO_N_DIM 02817 case 128: /* 1 -> 1,3,4 Di 8 Do 8 Lut 16 Grid 16 */ 02818 proc2call = NewCalcProc(LHCalc1toX_Di8_Do8_Lut16_G128); 02819 break; 02820 #endif 02821 } 02822 break; 02823 } 02824 break; 02825 case 16: /* 1 -> 1,3,4 Di 8 Do 16 */ 02826 switch (lutParam->colorLutWordSize) 02827 { 02828 case 8: /* 1 -> 1,3,4 Di 8 Do 8 Lut 8 */ 02829 switch (lutParam->colorLutGridPoints) 02830 { 02831 #if LH_Calc1toX_Di8_Do16_Lut8_G128 != LH_CALC_USE_DO_N_DIM 02832 case 128: /* 1 -> 1,3,4 Di 8 Do 8 Lut 8 Grid 16 */ 02833 proc2call = NewCalcProc(LHCalc1toX_Di8_Do16_Lut8_G128); 02834 break; 02835 #endif 02836 } 02837 break; 02838 case 16: /* 1 -> 1,3,4 Di 8 Do 8 Lut 16 */ 02839 switch (lutParam->colorLutGridPoints) 02840 { 02841 #if LH_Calc1toX_Di8_Do16_Lut16_G128 != LH_CALC_USE_DO_N_DIM 02842 case 128: /* 1 -> 1,3,4 Di 8 Do 8 Lut 16 Grid 16 */ 02843 proc2call = NewCalcProc(LHCalc1toX_Di8_Do16_Lut16_G128); 02844 break; 02845 #endif 02846 } 02847 break; 02848 } 02849 break; 02850 } 02851 break; 02852 case 16: /* 1 -> 1,3,4 Di 16 */ 02853 switch (info->usedSizeOut) 02854 { 02855 case 8: /* 1 -> 1,3,4 Di 8 Do 8 */ 02856 switch (lutParam->colorLutWordSize) 02857 { 02858 case 8: /* 1 -> 1,3,4 Di 8 Do 8 Lut 8 */ 02859 switch (lutParam->colorLutGridPoints) 02860 { 02861 #if LH_Calc1toX_Di16_Do8_Lut8_G128 != LH_CALC_USE_DO_N_DIM 02862 case 128: /* 1 -> 1,3,4 Di 8 Do 8 Lut 8 Grid 16 */ 02863 proc2call = NewCalcProc(LHCalc1toX_Di16_Do8_Lut8_G128); 02864 break; 02865 #endif 02866 } 02867 break; 02868 case 16: /* 1 -> 1,3,4 Di 8 Do 8 Lut 16 */ 02869 switch (lutParam->colorLutGridPoints) 02870 { 02871 #if LH_Calc1toX_Di16_Do8_Lut16_G128 != LH_CALC_USE_DO_N_DIM 02872 case 128: /* 1 -> 1,3,4 Di 8 Do 8 Lut 16 Grid 16 */ 02873 proc2call = NewCalcProc(LHCalc1toX_Di16_Do8_Lut16_G128); 02874 break; 02875 #endif 02876 } 02877 break; 02878 } 02879 break; 02880 case 16: /* 1 -> 1,3,4 Di 8 Do 16 */ 02881 switch (lutParam->colorLutWordSize) 02882 { 02883 case 8: /* 1 -> 1,3,4 Di 8 Do 8 Lut 8 */ 02884 switch (lutParam->colorLutGridPoints) 02885 { 02886 #if LH_Calc1toX_Di16_Do16_Lut8_G128 != LH_CALC_USE_DO_N_DIM 02887 case 128: /* 1 -> 1,3,4 Di 8 Do 8 Lut 8 Grid 16 */ 02888 proc2call = NewCalcProc(LHCalc1toX_Di16_Do16_Lut8_G128); 02889 break; 02890 #endif 02891 } 02892 break; 02893 case 16: /* 1 -> 1,3,4 Di 8 Do 8 Lut 16 */ 02894 switch (lutParam->colorLutGridPoints) 02895 { 02896 #if LH_Calc1toX_Di16_Do16_Lut16_G128 != LH_CALC_USE_DO_N_DIM 02897 case 128: /* 1 -> 1,3,4 Di 8 Do 8 Lut 16 Grid 16 */ 02898 proc2call = NewCalcProc(LHCalc1toX_Di16_Do16_Lut16_G128); 02899 break; 02900 #endif 02901 } 02902 break; 02903 } 02904 break; 02905 } 02906 break; 02907 } 02908 break; 02909 } 02910 break; 02911 case 3: /* 3 -> */ 02912 switch ( lutParam->colorLutOutDim ) 02913 { 02914 case 3: /* 3 -> 3 */ 02915 switch (info->usedSizeIn) 02916 { 02917 case 8: /* 3 -> 3 Di 8 */ 02918 switch (info->usedSizeOut) 02919 { 02920 case 8: /* 3 -> 3 Di 8 Do 8 */ 02921 switch (lutParam->colorLutWordSize) 02922 { 02923 case 8: /* 3 -> 3 Di 8 Do 8 Lut 8 */ 02924 switch (lutParam->colorLutGridPoints) 02925 { 02926 #if LH_Calc3to3_Di8_Do8_Lut8_G16 != LH_CALC_USE_DO_N_DIM 02927 case 16: /* 3 -> 3 Di 8 Do 8 Lut 8 Grid 16 */ 02928 #ifdef ALLOW_MMX 02929 if (DetectMMX()) { 02930 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut8_G16_F); 02931 } 02932 else 02933 #endif 02934 #if LH_CALC_USE_ADDITIONAL_OLD_CODE 02935 if( !info->inPlace ){ 02936 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut8_G16_Old); 02937 } 02938 else 02939 #endif 02940 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut8_G16); 02941 break; 02942 #endif 02943 #if LH_Calc3to3_Di8_Do8_Lut8_G32 != LH_CALC_USE_DO_N_DIM 02944 case 32: /* 3 -> 3 Di 8 Do 8 Lut 8 Grid 32 */ 02945 #ifdef ALLOW_MMX 02946 if (DetectMMX()) { 02947 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut8_G32_F); 02948 } 02949 else 02950 #endif 02951 #if LH_CALC_USE_ADDITIONAL_OLD_CODE 02952 if( !info->inPlace ){ 02953 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut8_G32_Old); 02954 } 02955 else 02956 #endif 02957 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut8_G32); 02958 break; 02959 #endif 02960 } 02961 break; 02962 case 16: /* 3 -> 3 Di 8 Do 8 Lut 16 */ 02963 switch (lutParam->colorLutGridPoints) 02964 { 02965 #if LH_Calc3to3_Di8_Do8_Lut16_G16 != LH_CALC_USE_DO_N_DIM 02966 case 16: /* 3 -> 3 Di 8 Do 8 Lut 16 Grid 16 */ 02967 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut16_G16); 02968 break; 02969 #endif 02970 #if LH_Calc3to3_Di8_Do8_Lut16_G32 != LH_CALC_USE_DO_N_DIM 02971 case 32: /* 3 -> 3 Di 8 Do 8 Lut 16 Grid 32 */ 02972 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut16_G32); 02973 break; 02974 #endif 02975 } 02976 break; 02977 } 02978 break; 02979 case 16: /* 3 -> 3 Di 8 Do 16 */ 02980 switch (lutParam->colorLutWordSize) 02981 { 02982 case 8: /* 3 -> 3 Di 8 Do 16 Lut 8 */ 02983 switch (lutParam->colorLutGridPoints) 02984 { 02985 #if LH_Calc3to3_Di8_Do16_Lut8_G16 != LH_CALC_USE_DO_N_DIM 02986 case 16: /* 3 -> 3 Di 8 Do 16 Lut 8 Grid 16 */ 02987 proc2call = NewCalcProc(LHCalc3to3_Di8_Do16_Lut8_G16); 02988 break; 02989 #endif 02990 #if LH_Calc3to3_Di8_Do16_Lut8_G32 != LH_CALC_USE_DO_N_DIM 02991 case 32: /* 3 -> 3 Di 8 Do 16 Lut 8 Grid 32 */ 02992 proc2call = NewCalcProc(LHCalc3to3_Di8_Do16_Lut8_G32); 02993 break; 02994 #endif 02995 } 02996 break; 02997 case 16: /* 3 -> 3 Di 8 Do 16 Lut 16 */ 02998 switch (lutParam->colorLutGridPoints) 02999 { 03000 #if LH_Calc3to3_Di8_Do16_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03001 case 16: /* 3 -> 3 Di 8 Do 16 Lut 16 Grid 16 */ 03002 proc2call = NewCalcProc(LHCalc3to3_Di8_Do16_Lut16_G16); 03003 break; 03004 #endif 03005 #if LH_Calc3to3_Di8_Do16_Lut16_G32 != LH_CALC_USE_DO_N_DIM 03006 case 32: /* 3 -> 3 Di 8 Do 16 Lut 16 Grid 32 */ 03007 proc2call = NewCalcProc(LHCalc3to3_Di8_Do16_Lut16_G32); 03008 break; 03009 #endif 03010 } 03011 break; 03012 } 03013 break; 03014 } 03015 break; 03016 case 16: /* 3 -> 3 Di 16 */ 03017 switch (info->usedSizeOut) 03018 { 03019 case 8: /* 3 -> 3 Di 16 Do 8 */ 03020 switch (lutParam->colorLutWordSize) 03021 { 03022 case 8: /* 3 -> 3 Di 16 Do 8 Lut 8 */ 03023 switch (lutParam->colorLutGridPoints) 03024 { 03025 #if LH_Calc3to3_Di16_Do8_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03026 case 16: /* 3 -> 3 Di 16 Do 8 Lut 8 Grid 16 */ 03027 proc2call = NewCalcProc(LHCalc3to3_Di16_Do8_Lut8_G16); 03028 break; 03029 #endif 03030 #if LH_Calc3to3_Di16_Do8_Lut8_G32 != LH_CALC_USE_DO_N_DIM 03031 case 32: /* 3 -> 3 Di 16 Do 8 Lut 8 Grid 32 */ 03032 proc2call = NewCalcProc(LHCalc3to3_Di16_Do8_Lut8_G32); 03033 break; 03034 #endif 03035 } 03036 break; 03037 case 16: /* 3 -> 3 Di 16 Do 8 Lut 16 */ 03038 switch (lutParam->colorLutGridPoints) 03039 { 03040 #if LH_Calc3to3_Di16_Do8_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03041 case 16: /* 3 -> 3 Di 16 Do 8 Lut 16 Grid 16 */ 03042 proc2call = NewCalcProc(LHCalc3to3_Di16_Do8_Lut16_G16); 03043 break; 03044 #endif 03045 #if LH_Calc3to3_Di16_Do8_Lut16_G32 != LH_CALC_USE_DO_N_DIM 03046 case 32: /* 3 -> 3 Di 16 Do 8 Lut 16 Grid 32 */ 03047 proc2call = NewCalcProc(LHCalc3to3_Di16_Do8_Lut16_G32); 03048 break; 03049 #endif 03050 } 03051 break; 03052 } 03053 break; 03054 case 16: /* 3 -> 3 Di 16 Do 16 */ 03055 switch (lutParam->colorLutWordSize) 03056 { 03057 case 8: /* 3 -> 3 Di 16 Do 16 Lut 8 */ 03058 switch (lutParam->colorLutGridPoints) 03059 { 03060 #if LH_Calc3to3_Di16_Do16_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03061 case 16: /* 3 -> 3 Di 16 Do 16 Lut 8 Grid 16 */ 03062 proc2call = NewCalcProc(LHCalc3to3_Di16_Do16_Lut8_G16); 03063 break; 03064 #endif 03065 #if LH_Calc3to3_Di16_Do16_Lut8_G32 != LH_CALC_USE_DO_N_DIM 03066 case 32: /* 3 -> 3 Di 16 Do 16 Lut 8 Grid 32 */ 03067 proc2call = NewCalcProc(LHCalc3to3_Di16_Do16_Lut8_G32); 03068 break; 03069 #endif 03070 } 03071 break; 03072 case 16: /* 3 -> 3 Di 16 Do 16 Lut 16 */ 03073 switch (lutParam->colorLutGridPoints) 03074 { 03075 #if LH_Calc3to3_Di16_Do16_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03076 case 16: /* 3 -> 3 Di 16 Do 16 Lut 16 Grid 16 */ 03077 proc2call = NewCalcProc(LHCalc3to3_Di16_Do16_Lut16_G16); 03078 break; 03079 #endif 03080 #if LH_Calc3to3_Di16_Do16_Lut16_G32 != LH_CALC_USE_DO_N_DIM 03081 case 32: /* 3 -> 3 Di 16 Do 16 Lut 16 Grid 32 */ 03082 proc2call = NewCalcProc(LHCalc3to3_Di16_Do16_Lut16_G32); 03083 break; 03084 #endif 03085 } 03086 break; 03087 } 03088 break; 03089 } 03090 break; 03091 } 03092 break; 03093 case 4: /* 3 -> 4 */ 03094 switch (info->usedSizeIn) 03095 { 03096 case 8: /* 3 -> 4 Di 8 */ 03097 switch (info->usedSizeOut) 03098 { 03099 case 8: /* 3 -> 4 Di 8 Do 8 */ 03100 switch (lutParam->colorLutWordSize) 03101 { 03102 case 8: /* 3 -> 4 Di 8 Do 8 Lut 8 */ 03103 switch (lutParam->colorLutGridPoints) 03104 { 03105 #if LH_Calc3to4_Di8_Do8_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03106 case 16: /* 3 -> 4 Di 8 Do 8 Lut 8 Grid 16 */ 03107 #ifdef ALLOW_MMX 03108 if (DetectMMX()) { 03109 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut8_G16_F); 03110 } 03111 else 03112 #endif 03113 #if LH_CALC_USE_ADDITIONAL_OLD_CODE 03114 if( !info->inPlace ){ 03115 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut8_G16_Old); 03116 } 03117 else 03118 #endif 03119 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut8_G16); 03120 break; 03121 #endif 03122 #if LH_Calc3to4_Di8_Do8_Lut8_G32 != LH_CALC_USE_DO_N_DIM 03123 case 32: /* 3 -> 4 Di 8 Do 8 Lut 8 Grid 32 */ 03124 #ifdef ALLOW_MMX 03125 if (DetectMMX()) { 03126 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut8_G32_F); 03127 } 03128 else 03129 #endif 03130 #if LH_CALC_USE_ADDITIONAL_OLD_CODE 03131 if( !info->inPlace ){ 03132 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut8_G32_Old); 03133 } 03134 else 03135 #endif 03136 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut8_G32); 03137 break; 03138 #endif 03139 } 03140 break; 03141 case 16: /* 3 -> 4 Di 8 Do 8 Lut 16 */ 03142 switch (lutParam->colorLutGridPoints) 03143 { 03144 #if LH_Calc3to4_Di8_Do8_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03145 case 16: /* 3 -> 4 Di 8 Do 8 Lut 16 Grid 16 */ 03146 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut16_G16); 03147 break; 03148 #endif 03149 #if LH_Calc3to4_Di8_Do8_Lut16_G32 != LH_CALC_USE_DO_N_DIM 03150 case 32: /* 3 -> 4 Di 8 Do 8 Lut 16 Grid 32 */ 03151 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut16_G32); 03152 break; 03153 #endif 03154 } 03155 break; 03156 } 03157 break; 03158 case 16: /* 3 -> 4 Di 8 Do 16 */ 03159 switch (lutParam->colorLutWordSize) 03160 { 03161 case 8: /* 3 -> 4 Di 8 Do 16 Lut 8 */ 03162 switch (lutParam->colorLutGridPoints) 03163 { 03164 #if LH_Calc3to4_Di8_Do16_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03165 case 16: /* 3 -> 4 Di 8 Do 16 Lut 8 Grid 16 */ 03166 proc2call = NewCalcProc(LHCalc3to4_Di8_Do16_Lut8_G16); 03167 break; 03168 #endif 03169 #if LH_Calc3to4_Di8_Do16_Lut8_G32 != LH_CALC_USE_DO_N_DIM 03170 case 32: /* 3 -> 4 Di 8 Do 16 Lut 8 Grid 32 */ 03171 proc2call = NewCalcProc(LHCalc3to4_Di8_Do16_Lut8_G32); 03172 break; 03173 #endif 03174 } 03175 break; 03176 case 16: /* 3 -> 4 Di 8 Do 16 Lut 16 */ 03177 switch (lutParam->colorLutGridPoints) 03178 { 03179 #if LH_Calc3to4_Di8_Do16_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03180 case 16: /* 3 -> 4 Di 8 Do 16 Lut 16 Grid 16 */ 03181 proc2call = NewCalcProc(LHCalc3to4_Di8_Do16_Lut16_G16); 03182 break; 03183 #endif 03184 #if LH_Calc3to4_Di8_Do16_Lut16_G32 != LH_CALC_USE_DO_N_DIM 03185 case 32: /* 3 -> 4 Di 8 Do 16 Lut 16 Grid 32 */ 03186 proc2call = NewCalcProc(LHCalc3to4_Di8_Do16_Lut16_G32); 03187 break; 03188 #endif 03189 } 03190 break; 03191 } 03192 break; 03193 } 03194 break; 03195 case 16: /* 3 -> 4 Di 16 */ 03196 switch (info->usedSizeOut) 03197 { 03198 case 8: /* 3 -> 4 Di 16 Do 8 */ 03199 switch (lutParam->colorLutWordSize) 03200 { 03201 case 8: /* 3 -> 4 Di 16 Do 8 Lut 8 */ 03202 switch (lutParam->colorLutGridPoints) 03203 { 03204 #if LH_Calc3to4_Di16_Do8_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03205 case 16: /* 3 -> 4 Di 16 Do 8 Lut 8 Grid 16 */ 03206 proc2call = NewCalcProc(LHCalc3to4_Di16_Do8_Lut8_G16); 03207 break; 03208 #endif 03209 #if LH_Calc3to4_Di16_Do8_Lut8_G32 != LH_CALC_USE_DO_N_DIM 03210 case 32: /* 3 -> 4 Di 16 Do 8 Lut 8 Grid 32 */ 03211 proc2call = NewCalcProc(LHCalc3to4_Di16_Do8_Lut8_G32); 03212 break; 03213 #endif 03214 } 03215 break; 03216 case 16: /* 3 -> 4 Di 16 Do 8 Lut 16 */ 03217 switch (lutParam->colorLutGridPoints) 03218 { 03219 #if LH_Calc3to4_Di16_Do8_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03220 case 16: /* 3 -> 4 Di 16 Do 8 Lut 16 Grid 16 */ 03221 proc2call = NewCalcProc(LHCalc3to4_Di16_Do8_Lut16_G16); 03222 break; 03223 #endif 03224 #if LH_Calc3to4_Di16_Do8_Lut16_G32 != LH_CALC_USE_DO_N_DIM 03225 case 32: /* 3 -> 4 Di 16 Do 8 Lut 16 Grid 32 */ 03226 proc2call = NewCalcProc(LHCalc3to4_Di16_Do8_Lut16_G32); 03227 break; 03228 #endif 03229 } 03230 break; 03231 } 03232 break; 03233 case 16: /* 3 -> 4 Di 16 Do 16 */ 03234 switch (lutParam->colorLutWordSize) 03235 { 03236 case 8: /* 3 -> 4 Di 16 Do 16 Lut 8 */ 03237 switch (lutParam->colorLutGridPoints) 03238 { 03239 #if LH_Calc3to4_Di16_Do16_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03240 case 16: /* 3 -> 4 Di 16 Do 16 Lut 8 Grid 16 */ 03241 proc2call = NewCalcProc(LHCalc3to4_Di16_Do16_Lut8_G16); 03242 break; 03243 #endif 03244 #if LH_Calc3to4_Di16_Do16_Lut8_G32 != LH_CALC_USE_DO_N_DIM 03245 case 32: /* 3 -> 4 Di 16 Do 16 Lut 8 Grid 32 */ 03246 proc2call = NewCalcProc(LHCalc3to4_Di16_Do16_Lut8_G32); 03247 break; 03248 #endif 03249 } 03250 break; 03251 case 16: /* 3 -> 4 Di 16 Do 16 Lut 16 */ 03252 switch (lutParam->colorLutGridPoints) 03253 { 03254 #if LH_Calc3to4_Di16_Do16_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03255 case 16: /* 3 -> 4 Di 16 Do 16 Lut 16 Grid 16 */ 03256 proc2call = NewCalcProc(LHCalc3to4_Di16_Do16_Lut16_G16); 03257 break; 03258 #endif 03259 #if LH_Calc3to4_Di16_Do16_Lut16_G32 != LH_CALC_USE_DO_N_DIM 03260 case 32: /* 3 -> 4 Di 16 Do 16 Lut 16 Grid 32 */ 03261 proc2call = NewCalcProc(LHCalc3to4_Di16_Do16_Lut16_G32); 03262 break; 03263 #endif 03264 } 03265 break; 03266 } 03267 break; 03268 } 03269 break; 03270 } 03271 break; 03272 } 03273 break; 03274 case 4: /* 4 -> */ 03275 switch ( lutParam->colorLutOutDim ) 03276 { 03277 case 3: /* 4 -> 3 */ 03278 switch (info->usedSizeIn) 03279 { 03280 case 8: /* 4 -> 3 Di 8 */ 03281 switch (info->usedSizeOut) 03282 { 03283 case 8: /* 4 -> 3 Di 8 Do 8 */ 03284 switch (lutParam->colorLutWordSize) 03285 { 03286 case 8: /* 4 -> 3 Di 8 Do 8 Lut 8 */ 03287 switch (lutParam->colorLutGridPoints) 03288 { 03289 #if LH_Calc4to3_Di8_Do8_Lut8_G8 != LH_CALC_USE_DO_N_DIM 03290 case 8: /* 4 -> 3 Di 8 Do 8 Lut 8 Grid 8 */ 03291 #ifdef ALLOW_MMX 03292 if (DetectMMX()) { 03293 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut8_G8_F); 03294 } 03295 else 03296 #endif 03297 #if LH_CALC_USE_ADDITIONAL_OLD_CODE_4DIM 03298 if( !info->inPlace ){ 03299 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut8_G8_Old); 03300 } 03301 else 03302 #endif 03303 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut8_G8); 03304 break; 03305 #endif 03306 #if LH_Calc4to3_Di8_Do8_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03307 case 16: /* 4 -> 3 Di 8 Do 8 Lut 8 Grid 16 */ 03308 #ifdef ALLOW_MMX 03309 if (DetectMMX()) { 03310 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut8_G16_F); 03311 } 03312 else 03313 #endif 03314 #if LH_CALC_USE_ADDITIONAL_OLD_CODE_4DIM 03315 if( !info->inPlace ){ 03316 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut8_G16_Old); 03317 } 03318 else 03319 #endif 03320 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut8_G16); 03321 break; 03322 #endif 03323 } 03324 break; 03325 case 16: /* 4 -> 3 Di 8 Do 8 Lut 16 */ 03326 switch (lutParam->colorLutGridPoints) 03327 { 03328 #if LH_Calc4to3_Di8_Do8_Lut16_G8 != LH_CALC_USE_DO_N_DIM 03329 case 8: /* 4 -> 3 Di 8 Do 8 Lut 16 Grid 8 */ 03330 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut16_G8); 03331 break; 03332 #endif 03333 #if LH_Calc4to3_Di8_Do8_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03334 case 16: /* 4 -> 3 Di 8 Do 8 Lut 16 Grid 16 */ 03335 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut16_G16); 03336 break; 03337 #endif 03338 } 03339 break; 03340 } 03341 break; 03342 case 16: /* 4 -> 3 Di 8 Do 16 */ 03343 switch (lutParam->colorLutWordSize) 03344 { 03345 case 8: /* 4 -> 3 Di 8 Do 16 Lut 8 */ 03346 switch (lutParam->colorLutGridPoints) 03347 { 03348 #if LH_Calc4to3_Di8_Do16_Lut8_G8 != LH_CALC_USE_DO_N_DIM 03349 case 8: /* 4 -> 3 Di 8 Do 16 Lut 8 Grid 8 */ 03350 proc2call = NewCalcProc(LHCalc4to3_Di8_Do16_Lut8_G8); 03351 break; 03352 #endif 03353 #if LH_Calc4to3_Di8_Do16_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03354 case 16: /* 4 -> 3 Di 8 Do 16 Lut 8 Grid 16 */ 03355 proc2call = NewCalcProc(LHCalc4to3_Di8_Do16_Lut8_G16); 03356 break; 03357 #endif 03358 } 03359 break; 03360 case 16: /* 4 -> 3 Di 8 Do 16 Lut 16 */ 03361 switch (lutParam->colorLutGridPoints) 03362 { 03363 #if LH_Calc4to3_Di8_Do16_Lut16_G8 != LH_CALC_USE_DO_N_DIM 03364 case 8: /* 4 -> 3 Di 8 Do 16 Lut 16 Grid 8 */ 03365 proc2call = NewCalcProc(LHCalc4to3_Di8_Do16_Lut16_G8); 03366 break; 03367 #endif 03368 #if LH_Calc4to3_Di8_Do16_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03369 case 16: /* 4 -> 3 Di 8 Do 16 Lut 16 Grid 16 */ 03370 proc2call = NewCalcProc(LHCalc4to3_Di8_Do16_Lut16_G16); 03371 break; 03372 #endif 03373 } 03374 break; 03375 } 03376 break; 03377 } 03378 break; 03379 case 16: /* 4 -> 3 Di 16 */ 03380 switch (info->usedSizeOut) 03381 { 03382 case 8: /* 4 -> 3 Di 16 Do 8 */ 03383 switch (lutParam->colorLutWordSize) 03384 { 03385 case 8: /* 4 -> 3 Di 16 Do 8 Lut 8 */ 03386 switch (lutParam->colorLutGridPoints) 03387 { 03388 #if LH_Calc4to3_Di16_Do8_Lut8_G8 != LH_CALC_USE_DO_N_DIM 03389 case 8: /* 4 -> 3 Di 16 Do 8 Lut 8 Grid 8 */ 03390 proc2call = NewCalcProc(LHCalc4to3_Di16_Do8_Lut8_G8); 03391 break; 03392 #endif 03393 #if LH_Calc4to3_Di16_Do8_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03394 case 16: /* 4 -> 3 Di 16 Do 8 Lut 8 Grid 16 */ 03395 proc2call = NewCalcProc(LHCalc4to3_Di16_Do8_Lut8_G16); 03396 break; 03397 #endif 03398 } 03399 break; 03400 case 16: /* 4 -> 3 Di 16 Do 8 Lut 16 */ 03401 switch (lutParam->colorLutGridPoints) 03402 { 03403 #if LH_Calc4to3_Di16_Do8_Lut16_G8 != LH_CALC_USE_DO_N_DIM 03404 case 8: /* 4 -> 3 Di 16 Do 8 Lut 16 Grid 8 */ 03405 proc2call = NewCalcProc(LHCalc4to3_Di16_Do8_Lut16_G8); 03406 break; 03407 #endif 03408 #if LH_Calc4to3_Di16_Do8_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03409 case 16: /* 4 -> 3 Di 16 Do 8 Lut 16 Grid 16 */ 03410 proc2call = NewCalcProc(LHCalc4to3_Di16_Do8_Lut16_G16); 03411 break; 03412 #endif 03413 } 03414 break; 03415 } 03416 break; 03417 case 16: /* 4 -> 3 Di 16 Do 16 */ 03418 switch (lutParam->colorLutWordSize) 03419 { 03420 case 8: /* 4 -> 3 Di 16 Do 16 Lut 8 */ 03421 switch (lutParam->colorLutGridPoints) 03422 { 03423 #if LH_Calc4to3_Di16_Do16_Lut8_G8 != LH_CALC_USE_DO_N_DIM 03424 case 8: /* 4 -> 3 Di 16 Do 16 Lut 8 Grid 8 */ 03425 proc2call = NewCalcProc(LHCalc4to3_Di16_Do16_Lut8_G8); 03426 break; 03427 #endif 03428 #if LH_Calc4to3_Di16_Do16_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03429 case 16: /* 4 -> 3 Di 16 Do 16 Lut 8 Grid 16 */ 03430 proc2call = NewCalcProc(LHCalc4to3_Di16_Do16_Lut8_G16); 03431 break; 03432 #endif 03433 } 03434 break; 03435 case 16: /* 4 -> 3 Di 16 Do 16 Lut 16 */ 03436 switch (lutParam->colorLutGridPoints) 03437 { 03438 #if LH_Calc4to3_Di16_Do16_Lut16_G8 != LH_CALC_USE_DO_N_DIM 03439 case 8: /* 4 -> 3 Di 16 Do 16 Lut 16 Grid 8 */ 03440 proc2call = NewCalcProc(LHCalc4to3_Di16_Do16_Lut16_G8); 03441 break; 03442 #endif 03443 #if LH_Calc4to3_Di16_Do16_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03444 case 16: /* 4 -> 3 Di 16 Do 16 Lut 16 Grid 16 */ 03445 proc2call = NewCalcProc(LHCalc4to3_Di16_Do16_Lut16_G16); 03446 break; 03447 #endif 03448 } 03449 break; 03450 } 03451 break; 03452 } 03453 break; 03454 } 03455 break; 03456 case 4: /* 4 -> 4 */ 03457 switch (info->usedSizeIn) 03458 { 03459 case 8: /* 4 -> 4 Di 8 */ 03460 switch (info->usedSizeOut) 03461 { 03462 case 8: /* 4 -> 4 Di 8 Do 8 */ 03463 switch (lutParam->colorLutWordSize) 03464 { 03465 case 8: /* 4 -> 4 Di 8 Do 8 Lut 8 */ 03466 switch (lutParam->colorLutGridPoints) 03467 { 03468 #if LH_Calc4to4_Di8_Do8_Lut8_G8 != LH_CALC_USE_DO_N_DIM 03469 case 8: /* 4 -> 4 Di 8 Do 8 Lut 8 Grid 8 */ 03470 #ifdef ALLOW_MMX 03471 if (DetectMMX()) { 03472 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut8_G8_F); 03473 } 03474 else 03475 #endif 03476 #if LH_CALC_USE_ADDITIONAL_OLD_CODE_4DIM 03477 if( !info->inPlace ){ 03478 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut8_G8_Old); 03479 } 03480 else 03481 #endif 03482 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut8_G8); 03483 break; 03484 #endif 03485 #if LH_Calc4to4_Di8_Do8_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03486 case 16: /* 4 -> 4 Di 8 Do 8 Lut 8 Grid 16 */ 03487 #ifdef ALLOW_MMX 03488 if (DetectMMX()) { 03489 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut8_G16_F); 03490 } 03491 else 03492 #endif 03493 #if LH_CALC_USE_ADDITIONAL_OLD_CODE_4DIM 03494 if( !info->inPlace ){ 03495 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut8_G16_Old); 03496 } 03497 else 03498 #endif 03499 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut8_G16); 03500 break; 03501 #endif 03502 } 03503 break; 03504 case 16: /* 4 -> 4 Di 8 Do 8 Lut 16 */ 03505 switch (lutParam->colorLutGridPoints) 03506 { 03507 #if LH_Calc4to4_Di8_Do8_Lut16_G8 != LH_CALC_USE_DO_N_DIM 03508 case 8: /* 4 -> 4 Di 8 Do 8 Lut 16 Grid 8 */ 03509 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut16_G8); 03510 break; 03511 #endif 03512 #if LH_Calc4to4_Di8_Do8_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03513 case 16: /* 4 -> 4 Di 8 Do 8 Lut 16 Grid 16 */ 03514 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut16_G16); 03515 break; 03516 #endif 03517 } 03518 break; 03519 } 03520 break; 03521 case 16: /* 4 -> 4 Di 8 Do 16 */ 03522 switch (lutParam->colorLutWordSize) 03523 { 03524 case 8: /* 4 -> 4 Di 8 Do 16 Lut 8 */ 03525 switch (lutParam->colorLutGridPoints) 03526 { 03527 #if LH_Calc4to4_Di8_Do16_Lut8_G8 != LH_CALC_USE_DO_N_DIM 03528 case 8: /* 4 -> 4 Di 8 Do 16 Lut 8 Grid 8 */ 03529 proc2call = NewCalcProc(LHCalc4to4_Di8_Do16_Lut8_G8); 03530 break; 03531 #endif 03532 #if LH_Calc4to4_Di8_Do16_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03533 case 16: /* 4 -> 4 Di 8 Do 16 Lut 8 Grid 16 */ 03534 proc2call = NewCalcProc(LHCalc4to4_Di8_Do16_Lut8_G16); 03535 break; 03536 #endif 03537 } 03538 break; 03539 case 16: /* 4 -> 4 Di 8 Do 16 Lut 16 */ 03540 switch (lutParam->colorLutGridPoints) 03541 { 03542 #if LH_Calc4to4_Di8_Do16_Lut16_G8 != LH_CALC_USE_DO_N_DIM 03543 case 8: /* 4 -> 4 Di 8 Do 16 Lut 16 Grid 8 */ 03544 proc2call = NewCalcProc(LHCalc4to4_Di8_Do16_Lut16_G8); 03545 break; 03546 #endif 03547 #if LH_Calc4to4_Di8_Do16_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03548 case 16: /* 4 -> 4 Di 8 Do 16 Lut 16 Grid 16 */ 03549 proc2call = NewCalcProc(LHCalc4to4_Di8_Do16_Lut16_G16); 03550 break; 03551 #endif 03552 } 03553 break; 03554 } 03555 break; 03556 } 03557 break; 03558 case 16: /* 4 -> 4 Di 16 */ 03559 switch (info->usedSizeOut) 03560 { 03561 case 8: /* 4 -> 4 Di 16 Do 8 */ 03562 switch (lutParam->colorLutWordSize) 03563 { 03564 case 8: /* 4 -> 4 Di 16 Do 8 Lut 8 */ 03565 switch (lutParam->colorLutGridPoints) 03566 { 03567 #if LH_Calc4to4_Di16_Do8_Lut8_G8 != LH_CALC_USE_DO_N_DIM 03568 case 8: /* 4 -> 4 Di 16 Do 8 Lut 8 Grid 8 */ 03569 proc2call = NewCalcProc(LHCalc4to4_Di16_Do8_Lut8_G8); 03570 break; 03571 #endif 03572 #if LH_Calc4to4_Di16_Do8_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03573 case 16: /* 4 -> 4 Di 16 Do 8 Lut 8 Grid 16 */ 03574 proc2call = NewCalcProc(LHCalc4to4_Di16_Do8_Lut8_G16); 03575 break; 03576 #endif 03577 } 03578 break; 03579 case 16: /* 4 -> 4 Di 16 Do 8 Lut 16 */ 03580 switch (lutParam->colorLutGridPoints) 03581 { 03582 #if LH_Calc4to4_Di16_Do8_Lut16_G8 != LH_CALC_USE_DO_N_DIM 03583 case 8: /* 4 -> 4 Di 16 Do 8 Lut 16 Grid 8 */ 03584 proc2call = NewCalcProc(LHCalc4to4_Di16_Do8_Lut16_G8); 03585 break; 03586 #endif 03587 #if LH_Calc4to4_Di16_Do8_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03588 case 16: /* 4 -> 4 Di 16 Do 8 Lut 16 Grid 16 */ 03589 proc2call = NewCalcProc(LHCalc4to4_Di16_Do8_Lut16_G16); 03590 break; 03591 #endif 03592 } 03593 break; 03594 } 03595 break; 03596 case 16: /* 4 -> 4 Di 16 Do 16 */ 03597 switch (lutParam->colorLutWordSize) 03598 { 03599 case 8: /* 4 -> 4 Di 16 Do 16 Lut 8 */ 03600 switch (lutParam->colorLutGridPoints) 03601 { 03602 #if LH_Calc4to4_Di16_Do16_Lut8_G8 != LH_CALC_USE_DO_N_DIM 03603 case 8: /* 4 -> 4 Di 16 Do 16 Lut 8 Grid 8 */ 03604 proc2call = NewCalcProc(LHCalc4to4_Di16_Do16_Lut8_G8); 03605 break; 03606 #endif 03607 #if LH_Calc4to4_Di16_Do16_Lut8_G16 != LH_CALC_USE_DO_N_DIM 03608 case 16: /* 4 -> 4 Di 16 Do 16 Lut 8 Grid 16 */ 03609 proc2call = NewCalcProc(LHCalc4to4_Di16_Do16_Lut8_G16); 03610 break; 03611 #endif 03612 } 03613 break; 03614 case 16: /* 4 -> 4 Di 16 Do 16 Lut 16 */ 03615 switch (lutParam->colorLutGridPoints) 03616 { 03617 #if LH_Calc4to4_Di16_Do16_Lut16_G8 != LH_CALC_USE_DO_N_DIM 03618 case 8: /* 4 -> 4 Di 16 Do 16 Lut 16 Grid 8 */ 03619 proc2call = NewCalcProc(LHCalc4to4_Di16_Do16_Lut16_G8); 03620 break; 03621 #endif 03622 #if LH_Calc4to4_Di16_Do16_Lut16_G16 != LH_CALC_USE_DO_N_DIM 03623 case 16: /* 4 -> 4 Di 16 Do 16 Lut 16 Grid 16 */ 03624 proc2call = NewCalcProc(LHCalc4to4_Di16_Do16_Lut16_G16); 03625 break; 03626 #endif 03627 } 03628 break; 03629 } 03630 break; 03631 } 03632 break; 03633 } 03634 break; 03635 } 03636 break; 03637 } 03638 } 03639 #endif 03640 03641 if ( ( proc2call == nil ) 03642 #ifdef DEBUG_OUTPUT 03643 || ( gUSE_NDIM_FOR_BITMAP ) 03644 #endif 03645 ) 03646 { 03647 switch (info->usedSizeIn) 03648 { 03649 case 8: /* Di 8 */ 03650 switch (info->usedSizeOut) 03651 { 03652 case 8: /* Di 8 Do 8 */ 03653 switch (lutParam->colorLutWordSize) 03654 { 03655 case 8: /* Di 8 Do 8 Lut 8 */ 03656 proc2call = NewCalcProc(CalcNDim_Data8To8_Lut8); 03657 break; 03658 case 16: /* Di 8 Do 8 Lut 16 */ 03659 proc2call = NewCalcProc(CalcNDim_Data8To8_Lut16); 03660 break; 03661 } 03662 break; 03663 case 16: /* Di 8 Do 16 */ 03664 switch (lutParam->colorLutWordSize) 03665 { 03666 case 8: /* Di 8 Do 16 Lut 8 */ 03667 proc2call = NewCalcProc(CalcNDim_Data8To16_Lut8); 03668 break; 03669 case 16: /* Di 8 Do 16 Lut 16 */ 03670 proc2call = NewCalcProc(CalcNDim_Data8To16_Lut16); 03671 break; 03672 } 03673 break; 03674 } 03675 break; 03676 case 16: /* Di 16 */ 03677 switch (info->usedSizeOut) 03678 { 03679 case 8: /* Di 16 Do 8 */ 03680 switch (lutParam->colorLutWordSize) 03681 { 03682 case 8: /* Di 16 Do 8 Lut 8 */ 03683 proc2call = NewCalcProc(CalcNDim_Data16To8_Lut8); 03684 break; 03685 case 16: /* Di 16 Do 8 Lut 16 */ 03686 proc2call = NewCalcProc(CalcNDim_Data16To8_Lut16); 03687 break; 03688 } 03689 break; 03690 case 16: /* Di 16 Do 16 */ 03691 switch (lutParam->colorLutWordSize) 03692 { 03693 case 8: /* Di 16 Do 16 Lut 8 */ 03694 proc2call = NewCalcProc(CalcNDim_Data16To16_Lut8); 03695 break; 03696 case 16: /* Di 16 Do 16 Lut 16 */ 03697 proc2call = NewCalcProc(CalcNDim_Data16To16_Lut16); 03698 break; 03699 } 03700 break; 03701 } 03702 break; 03703 } 03704 } 03705 03706 #ifdef DEBUG_OUTPUT 03707 if ( DebugCheck(kThisFile, kDebugMiscInfo) ) 03708 { 03709 if ( gUSE_NDIM_FOR_BITMAP ) 03710 DebugPrint("DoNDIM: %1d->%1d Di %2d Do %2d Grid %2d Lut %2d\n", lutParam->colorLutInDim, lutParam->colorLutOutDim, 03711 info->usedSizeIn, info->usedSizeOut, 03712 lutParam->colorLutGridPoints, lutParam->colorLutWordSize); 03713 else 03714 DebugPrint("OPTIMIZED: %1d->%1d Di %2d Do %2d Grid %2d Lut %2d\n", lutParam->colorLutInDim, lutParam->colorLutOutDim, 03715 info->usedSizeIn, info->usedSizeOut, 03716 lutParam->colorLutGridPoints, lutParam->colorLutWordSize); 03717 } 03718 if (proc2call == nil) 03719 DebugPrint("� ERROR: FindCalcRoutine is nil !!!\n"); 03720 #endif 03721 LH_END_PROC("FindCalcRoutine") 03722 return proc2call; 03723 }

CalcProcPtr FindLookupRoutine const CMLutParam lutParam,
const ColorSpaceInfo info
 

Definition at line 2144 of file lh_core/runtime.c.

References CalcProcPtr, CMError, CMLutParam::colorLutGridPoints, CMLutParam::colorLutInDim, CMLutParam::colorLutOutDim, CMLutParam::colorLutWordSize, LH_END_PROC, LH_START_PROC, LHCalc3to3_Di16_Do16_Lut16_G16_LO(), LHCalc3to3_Di16_Do16_Lut16_G32_LO(), LHCalc3to3_Di16_Do16_Lut8_G16_LO(), LHCalc3to3_Di16_Do16_Lut8_G32_LO(), LHCalc3to3_Di16_Do8_Lut16_G16_LO(), LHCalc3to3_Di16_Do8_Lut16_G32_LO(), LHCalc3to3_Di16_Do8_Lut8_G16_LO(), LHCalc3to3_Di16_Do8_Lut8_G32_LO(), LHCalc3to3_Di8_Do16_Lut16_G16_LO(), LHCalc3to3_Di8_Do16_Lut16_G32_LO(), LHCalc3to3_Di8_Do16_Lut8_G16_LO(), LHCalc3to3_Di8_Do16_Lut8_G32_LO(), LHCalc3to3_Di8_Do8_Lut16_G16_LO(), LHCalc3to3_Di8_Do8_Lut16_G32_LO(), LHCalc3to3_Di8_Do8_Lut8_G16_LO(), LHCalc3to3_Di8_Do8_Lut8_G32_LO(), LHCalc3to4_Di16_Do16_Lut16_G16_LO(), LHCalc3to4_Di16_Do16_Lut16_G32_LO(), LHCalc3to4_Di16_Do16_Lut8_G16_LO(), LHCalc3to4_Di16_Do16_Lut8_G32_LO(), LHCalc3to4_Di16_Do8_Lut16_G16_LO(), LHCalc3to4_Di16_Do8_Lut16_G32_LO(), LHCalc3to4_Di16_Do8_Lut8_G16_LO(), LHCalc3to4_Di16_Do8_Lut8_G32_LO(), LHCalc3to4_Di8_Do16_Lut16_G16_LO(), LHCalc3to4_Di8_Do16_Lut16_G32_LO(), LHCalc3to4_Di8_Do16_Lut8_G16_LO(), LHCalc3to4_Di8_Do16_Lut8_G32_LO(), LHCalc3to4_Di8_Do8_Lut16_G16_LO(), LHCalc3to4_Di8_Do8_Lut16_G32_LO(), LHCalc3to4_Di8_Do8_Lut8_G16_LO(), LHCalc3to4_Di8_Do8_Lut8_G32_LO(), LHCalc4to3_Di16_Do16_Lut16_G16_LO(), LHCalc4to3_Di16_Do16_Lut16_G8_LO(), LHCalc4to3_Di16_Do16_Lut8_G16_LO(), LHCalc4to3_Di16_Do16_Lut8_G8_LO(), LHCalc4to3_Di16_Do8_Lut16_G16_LO(), LHCalc4to3_Di16_Do8_Lut16_G8_LO(), LHCalc4to3_Di16_Do8_Lut8_G16_LO(), LHCalc4to3_Di16_Do8_Lut8_G8_LO(), LHCalc4to3_Di8_Do16_Lut16_G16_LO(), LHCalc4to3_Di8_Do16_Lut16_G8_LO(), LHCalc4to3_Di8_Do16_Lut8_G16_LO(), LHCalc4to3_Di8_Do16_Lut8_G8_LO(), LHCalc4to3_Di8_Do8_Lut16_G16_LO(), LHCalc4to3_Di8_Do8_Lut16_G8_LO(), LHCalc4to3_Di8_Do8_Lut8_G16_LO(), LHCalc4to3_Di8_Do8_Lut8_G8_LO(), LHCalc4to4_Di16_Do16_Lut16_G16_LO(), LHCalc4to4_Di16_Do16_Lut16_G8_LO(), LHCalc4to4_Di16_Do16_Lut8_G16_LO(), LHCalc4to4_Di16_Do16_Lut8_G8_LO(), LHCalc4to4_Di16_Do8_Lut16_G16_LO(), LHCalc4to4_Di16_Do8_Lut16_G8_LO(), LHCalc4to4_Di16_Do8_Lut8_G16_LO(), LHCalc4to4_Di16_Do8_Lut8_G8_LO(), LHCalc4to4_Di8_Do16_Lut16_G16_LO(), LHCalc4to4_Di8_Do16_Lut16_G8_LO(), LHCalc4to4_Di8_Do16_Lut8_G16_LO(), LHCalc4to4_Di8_Do16_Lut8_G8_LO(), LHCalc4to4_Di8_Do8_Lut16_G16_LO(), LHCalc4to4_Di8_Do8_Lut16_G8_LO(), LHCalc4to4_Di8_Do8_Lut8_G16_LO(), LHCalc4to4_Di8_Do8_Lut8_G8_LO(), NewCalcProc, nil, noErr, ColorSpaceInfo::usedSizeIn, and ColorSpaceInfo::usedSizeOut.

02146 { 02147 CalcProcPtr proc2call = nil; 02148 #ifdef DEBUG_OUTPUT 02149 CMError err = noErr; 02150 #endif 02151 LH_START_PROC("FindLookupRoutine") 02152 02153 switch ( lutParam->colorLutInDim ) 02154 { 02155 case 3: /* 3 -> */ 02156 switch ( lutParam->colorLutOutDim ) 02157 { 02158 case 3: /* 3 -> 3 */ 02159 switch (info->usedSizeIn) 02160 { 02161 case 8: /* 3 -> 3 Di 8 */ 02162 switch (info->usedSizeOut) 02163 { 02164 case 8: /* 3 -> 3 Di 8 Do 8 */ 02165 switch (lutParam->colorLutWordSize) 02166 { 02167 case 8: /* 3 -> 3 Di 8 Do 8 Lut 8 */ 02168 switch (lutParam->colorLutGridPoints) 02169 { 02170 #if LH_CALC_ENGINE_ALL_FORMATS_LO 02171 case 16: /* 3 -> 3 Di 8 Do 8 Lut 8 Grid 16 */ 02172 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut8_G16_LO); 02173 break; 02174 #endif 02175 case 32: /* 3 -> 3 Di 8 Do 8 Lut 8 Grid 32 */ 02176 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut8_G32_LO); 02177 break; 02178 } 02179 break; 02180 #if LH_CALC_ENGINE_ALL_FORMATS_LO 02181 case 16: /* 3 -> 3 Di 8 Do 8 Lut 16 */ 02182 switch (lutParam->colorLutGridPoints) 02183 { 02184 case 16: /* 3 -> 3 Di 8 Do 8 Lut 16 Grid 16 */ 02185 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut16_G16_LO); 02186 break; 02187 case 32: /* 3 -> 3 Di 8 Do 8 Lut 16 Grid 32 */ 02188 proc2call = NewCalcProc(LHCalc3to3_Di8_Do8_Lut16_G32_LO); 02189 break; 02190 } 02191 break; 02192 #endif 02193 } 02194 break; 02195 #if LH_CALC_ENGINE_ALL_FORMATS_LO 02196 case 16: /* 3 -> 3 Di 8 Do 16 */ 02197 #if LH_CALC_ENGINE_MIXED_DATAFORMAT 02198 switch (lutParam->colorLutWordSize) 02199 { 02200 case 8: /* 3 -> 3 Di 8 Do 16 Lut 8 */ 02201 switch (lutParam->colorLutGridPoints) 02202 { 02203 case 16: /* 3 -> 3 Di 8 Do 16 Lut 8 Grid 16 */ 02204 proc2call = NewCalcProc(LHCalc3to3_Di8_Do16_Lut8_G16_LO); 02205 break; 02206 case 32: /* 3 -> 3 Di 8 Do 16 Lut 8 Grid 32 */ 02207 proc2call = NewCalcProc(LHCalc3to3_Di8_Do16_Lut8_G32_LO); 02208 break; 02209 } 02210 break; 02211 case 16: /* 3 -> 3 Di 8 Do 16 Lut 16 */ 02212 switch (lutParam->colorLutGridPoints) 02213 { 02214 case 16: /* 3 -> 3 Di 8 Do 16 Lut 16 Grid 16 */ 02215 proc2call = NewCalcProc(LHCalc3to3_Di8_Do16_Lut16_G16_LO); 02216 break; 02217 case 32: /* 3 -> 3 Di 8 Do 16 Lut 16 Grid 32 */ 02218 proc2call = NewCalcProc(LHCalc3to3_Di8_Do16_Lut16_G32_LO); 02219 break; 02220 } 02221 break; 02222 } 02223 #endif 02224 break; 02225 #endif 02226 } 02227 02228 break; 02229 #if LH_CALC_ENGINE_ALL_FORMATS_LO 02230 case 16: /* 3 -> 3 Di 16 */ 02231 switch (info->usedSizeOut) 02232 { 02233 case 8: /* 3 -> 3 Di 16 Do 8 */ 02234 #if LH_CALC_ENGINE_MIXED_DATAFORMAT 02235 switch (lutParam->colorLutWordSize) 02236 { 02237 case 8: /* 3 -> 3 Di 16 Do 8 Lut 8 */ 02238 switch (lutParam->colorLutGridPoints) 02239 { 02240 case 16: /* 3 -> 3 Di 16 Do 8 Lut 8 Grid 16 */ 02241 proc2call = NewCalcProc(LHCalc3to3_Di16_Do8_Lut8_G16_LO); 02242 break; 02243 case 32: /* 3 -> 3 Di 16 Do 8 Lut 8 Grid 32 */ 02244 proc2call = NewCalcProc(LHCalc3to3_Di16_Do8_Lut8_G32_LO); 02245 break; 02246 } 02247 break; 02248 case 16: /* 3 -> 3 Di 16 Do 8 Lut 16 */ 02249 switch (lutParam->colorLutGridPoints) 02250 { 02251 case 16: /* 3 -> 3 Di 16 Do 8 Lut 16 Grid 16 */ 02252 proc2call = NewCalcProc(LHCalc3to3_Di16_Do8_Lut16_G16_LO); 02253 break; 02254 case 32: /* 3 -> 3 Di 16 Do 8 Lut 16 Grid 32 */ 02255 proc2call = NewCalcProc(LHCalc3to3_Di16_Do8_Lut16_G32_LO); 02256 break; 02257 } 02258 break; 02259 } 02260 #endif 02261 break; 02262 case 16: /* 3 -> 3 Di 16 Do 16 */ 02263 #if LH_CALC_ENGINE_16_BIT_LO 02264 switch (lutParam->colorLutWordSize) 02265 { 02266 case 8: /* 3 -> 3 Di 16 Do 16 Lut 8 */ 02267 switch (lutParam->colorLutGridPoints) 02268 { 02269 case 16: /* 3 -> 3 Di 16 Do 16 Lut 8 Grid 16 */ 02270 proc2call = NewCalcProc(LHCalc3to3_Di16_Do16_Lut8_G16_LO); 02271 break; 02272 case 32: /* 3 -> 3 Di 16 Do 16 Lut 8 Grid 32 */ 02273 proc2call = NewCalcProc(LHCalc3to3_Di16_Do16_Lut8_G32_LO); 02274 break; 02275 } 02276 break; 02277 case 16: /* 3 -> 3 Di 16 Do 16 Lut 16 */ 02278 switch (lutParam->colorLutGridPoints) 02279 { 02280 case 16: /* 3 -> 3 Di 16 Do 16 Lut 16 Grid 16 */ 02281 proc2call = NewCalcProc(LHCalc3to3_Di16_Do16_Lut16_G16_LO); 02282 break; 02283 case 32: /* 3 -> 3 Di 16 Do 16 Lut 16 Grid 32 */ 02284 proc2call = NewCalcProc(LHCalc3to3_Di16_Do16_Lut16_G32_LO); 02285 break; 02286 } 02287 break; 02288 } 02289 #endif 02290 break; 02291 } 02292 break; 02293 #endif 02294 } 02295 break; 02296 #if LH_CALC_ENGINE_ALL_FORMATS_LO 02297 case 4: /* 3 -> 4 */ 02298 switch (info->usedSizeIn) 02299 { 02300 case 8: /* 3 -> 4 Di 8 */ 02301 switch (info->usedSizeOut) 02302 { 02303 case 8: /* 3 -> 4 Di 8 Do 8 */ 02304 switch (lutParam->colorLutWordSize) 02305 { 02306 case 8: /* 3 -> 4 Di 8 Do 8 Lut 8 */ 02307 switch (lutParam->colorLutGridPoints) 02308 { 02309 case 16: /* 3 -> 4 Di 8 Do 8 Lut 8 Grid 16 */ 02310 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut8_G16_LO); 02311 break; 02312 case 32: /* 3 -> 4 Di 8 Do 8 Lut 8 Grid 32 */ 02313 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut8_G32_LO); 02314 break; 02315 } 02316 break; 02317 case 16: /* 3 -> 4 Di 8 Do 8 Lut 16 */ 02318 switch (lutParam->colorLutGridPoints) 02319 { 02320 case 16: /* 3 -> 4 Di 8 Do 8 Lut 16 Grid 16 */ 02321 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut16_G16_LO); 02322 break; 02323 case 32: /* 3 -> 4 Di 8 Do 8 Lut 16 Grid 32 */ 02324 proc2call = NewCalcProc(LHCalc3to4_Di8_Do8_Lut16_G32_LO); 02325 break; 02326 } 02327 break; 02328 } 02329 break; 02330 case 16: /* 3 -> 4 Di 8 Do 16 */ 02331 #if LH_CALC_ENGINE_MIXED_DATAFORMAT 02332 switch (lutParam->colorLutWordSize) 02333 { 02334 case 8: /* 3 -> 4 Di 8 Do 16 Lut 8 */ 02335 switch (lutParam->colorLutGridPoints) 02336 { 02337 case 16: /* 3 -> 4 Di 8 Do 16 Lut 8 Grid 16 */ 02338 proc2call = NewCalcProc(LHCalc3to4_Di8_Do16_Lut8_G16_LO); 02339 break; 02340 case 32: /* 3 -> 4 Di 8 Do 16 Lut 8 Grid 32 */ 02341 proc2call = NewCalcProc(LHCalc3to4_Di8_Do16_Lut8_G32_LO); 02342 break; 02343 } 02344 break; 02345 case 16: /* 3 -> 4 Di 8 Do 16 Lut 16 */ 02346 switch (lutParam->colorLutGridPoints) 02347 { 02348 case 16: /* 3 -> 4 Di 8 Do 16 Lut 16 Grid 16 */ 02349 proc2call = NewCalcProc(LHCalc3to4_Di8_Do16_Lut16_G16_LO); 02350 break; 02351 case 32: /* 3 -> 4 Di 8 Do 16 Lut 16 Grid 32 */ 02352 proc2call = NewCalcProc(LHCalc3to4_Di8_Do16_Lut16_G32_LO); 02353 break; 02354 } 02355 break; 02356 } 02357 #endif 02358 break; 02359 } 02360 break; 02361 case 16: /* 3 -> 4 Di 16 */ 02362 switch (info->usedSizeOut) 02363 { 02364 case 8: /* 3 -> 4 Di 16 Do 8 */ 02365 #if LH_CALC_ENGINE_MIXED_DATAFORMAT 02366 switch (lutParam->colorLutWordSize) 02367 { 02368 case 8: /* 3 -> 4 Di 16 Do 8 Lut 8 */ 02369 switch (lutParam->colorLutGridPoints) 02370 { 02371 case 16: /* 3 -> 4 Di 16 Do 8 Lut 8 Grid 16 */ 02372 proc2call = NewCalcProc(LHCalc3to4_Di16_Do8_Lut8_G16_LO); 02373 break; 02374 case 32: /* 3 -> 4 Di 16 Do 8 Lut 8 Grid 32 */ 02375 proc2call = NewCalcProc(LHCalc3to4_Di16_Do8_Lut8_G32_LO); 02376 break; 02377 } 02378 break; 02379 case 16: /* 3 -> 4 Di 16 Do 8 Lut 16 */ 02380 switch (lutParam->colorLutGridPoints) 02381 { 02382 case 16: /* 3 -> 4 Di 16 Do 8 Lut 16 Grid 16 */ 02383 proc2call = NewCalcProc(LHCalc3to4_Di16_Do8_Lut16_G16_LO); 02384 break; 02385 case 32: /* 3 -> 4 Di 16 Do 8 Lut 16 Grid 32 */ 02386 proc2call = NewCalcProc(LHCalc3to4_Di16_Do8_Lut16_G32_LO); 02387 break; 02388 } 02389 break; 02390 } 02391 #endif 02392 break; 02393 case 16: /* 3 -> 4 Di 16 Do 16 */ 02394 #if LH_CALC_ENGINE_16_BIT_LO 02395 switch (lutParam->colorLutWordSize) 02396 { 02397 case 8: /* 3 -> 4 Di 16 Do 16 Lut 8 */ 02398 switch (lutParam->colorLutGridPoints) 02399 { 02400 case 16: /* 3 -> 4 Di 16 Do 16 Lut 8 Grid 16 */ 02401 proc2call = NewCalcProc(LHCalc3to4_Di16_Do16_Lut8_G16_LO); 02402 break; 02403 case 32: /* 3 -> 4 Di 16 Do 16 Lut 8 Grid 32 */ 02404 proc2call = NewCalcProc(LHCalc3to4_Di16_Do16_Lut8_G32_LO); 02405 break; 02406 } 02407 break; 02408 case 16: /* 3 -> 4 Di 16 Do 16 Lut 16 */ 02409 switch (lutParam->colorLutGridPoints) 02410 { 02411 case 16: /* 3 -> 4 Di 16 Do 16 Lut 16 Grid 16 */ 02412 proc2call = NewCalcProc(LHCalc3to4_Di16_Do16_Lut16_G16_LO); 02413 break; 02414 case 32: /* 3 -> 4 Di 16 Do 16 Lut 16 Grid 32 */ 02415 proc2call = NewCalcProc(LHCalc3to4_Di16_Do16_Lut16_G32_LO); 02416 break; 02417 } 02418 break; 02419 } 02420 #endif 02421 break; 02422 } 02423 break; 02424 } 02425 break; 02426 #endif 02427 } 02428 break; 02429 #if LH_CALC_ENGINE_ALL_FORMATS_LO 02430 case 4: /* 4 -> */ 02431 switch ( lutParam->colorLutOutDim ) 02432 { 02433 case 3: /* 4 -> 3 */ 02434 switch (info->usedSizeIn) 02435 { 02436 case 8: /* 4 -> 3 Di 8 */ 02437 switch (info->usedSizeOut) 02438 { 02439 case 8: /* 4 -> 3 Di 8 Do 8 */ 02440 switch (lutParam->colorLutWordSize) 02441 { 02442 case 8: /* 4 -> 3 Di 8 Do 8 Lut 8 */ 02443 switch (lutParam->colorLutGridPoints) 02444 { 02445 case 8: /* 4 -> 3 Di 8 Do 8 Lut 8 Grid 8 */ 02446 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut8_G8_LO); 02447 break; 02448 case 16: /* 4 -> 3 Di 8 Do 8 Lut 8 Grid 16 */ 02449 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut8_G16_LO); 02450 break; 02451 } 02452 break; 02453 case 16: /* 4 -> 3 Di 8 Do 8 Lut 16 */ 02454 switch (lutParam->colorLutGridPoints) 02455 { 02456 case 8: /* 4 -> 3 Di 8 Do 8 Lut 16 Grid 8 */ 02457 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut16_G8_LO); 02458 break; 02459 case 16: /* 4 -> 3 Di 8 Do 8 Lut 16 Grid 16 */ 02460 proc2call = NewCalcProc(LHCalc4to3_Di8_Do8_Lut16_G16_LO); 02461 break; 02462 } 02463 break; 02464 } 02465 break; 02466 case 16: /* 4 -> 3 Di 8 Do 16 */ 02467 #if LH_CALC_ENGINE_MIXED_DATAFORMAT 02468 switch (lutParam->colorLutWordSize) 02469 { 02470 case 8: /* 4 -> 3 Di 8 Do 16 Lut 8 */ 02471 switch (lutParam->colorLutGridPoints) 02472 { 02473 case 8: /* 4 -> 3 Di 8 Do 16 Lut 8 Grid 8 */ 02474 proc2call = NewCalcProc(LHCalc4to3_Di8_Do16_Lut8_G8_LO); 02475 break; 02476 case 16: /* 4 -> 3 Di 8 Do 16 Lut 8 Grid 16 */ 02477 proc2call = NewCalcProc(LHCalc4to3_Di8_Do16_Lut8_G16_LO); 02478 break; 02479 } 02480 break; 02481 case 16: /* 4 -> 3 Di 8 Do 16 Lut 16 */ 02482 switch (lutParam->colorLutGridPoints) 02483 { 02484 case 8: /* 4 -> 3 Di 8 Do 16 Lut 16 Grid 8 */ 02485 proc2call = NewCalcProc(LHCalc4to3_Di8_Do16_Lut16_G8_LO); 02486 break; 02487 case 16: /* 4 -> 3 Di 8 Do 16 Lut 16 Grid 16 */ 02488 proc2call = NewCalcProc(LHCalc4to3_Di8_Do16_Lut16_G16_LO); 02489 break; 02490 } 02491 break; 02492 } 02493 #endif 02494 break; 02495 } 02496 break; 02497 case 16: /* 4 -> 3 Di 16 */ 02498 switch (info->usedSizeOut) 02499 { 02500 case 8: /* 4 -> 3 Di 16 Do 8 */ 02501 #if LH_CALC_ENGINE_MIXED_DATAFORMAT 02502 switch (lutParam->colorLutWordSize) 02503 { 02504 case 8: /* 4 -> 3 Di 16 Do 8 Lut 8 */ 02505 switch (lutParam->colorLutGridPoints) 02506 { 02507 case 8: /* 4 -> 3 Di 16 Do 8 Lut 8 Grid 8 */ 02508 proc2call = NewCalcProc(LHCalc4to3_Di16_Do8_Lut8_G8_LO); 02509 break; 02510 case 16: /* 4 -> 3 Di 16 Do 8 Lut 8 Grid 16 */ 02511 proc2call = NewCalcProc(LHCalc4to3_Di16_Do8_Lut8_G16_LO); 02512 break; 02513 } 02514 break; 02515 case 16: /* 4 -> 3 Di 16 Do 8 Lut 16 */ 02516 switch (lutParam->colorLutGridPoints) 02517 { 02518 case 8: /* 4 -> 3 Di 16 Do 8 Lut 16 Grid 8 */ 02519 proc2call = NewCalcProc(LHCalc4to3_Di16_Do8_Lut16_G8_LO); 02520 break; 02521 case 16: /* 4 -> 3 Di 16 Do 8 Lut 16 Grid 16 */ 02522 proc2call = NewCalcProc(LHCalc4to3_Di16_Do8_Lut16_G16_LO); 02523 break; 02524 } 02525 break; 02526 } 02527 #endif 02528 break; 02529 case 16: /* 4 -> 3 Di 16 Do 16 */ 02530 #if LH_CALC_ENGINE_16_BIT_LO 02531 switch (lutParam->colorLutWordSize) 02532 { 02533 case 8: /* 4 -> 3 Di 16 Do 16 Lut 8 */ 02534 switch (lutParam->colorLutGridPoints) 02535 { 02536 case 8: /* 4 -> 3 Di 16 Do 16 Lut 8 Grid 8 */ 02537 proc2call = NewCalcProc(LHCalc4to3_Di16_Do16_Lut8_G8_LO); 02538 break; 02539 case 16: /* 4 -> 3 Di 16 Do 16 Lut 8 Grid 16 */ 02540 proc2call = NewCalcProc(LHCalc4to3_Di16_Do16_Lut8_G16_LO); 02541 break; 02542 } 02543 break; 02544 case 16: /* 4 -> 3 Di 16 Do 16 Lut 16 */ 02545 switch (lutParam->colorLutGridPoints) 02546 { 02547 case 8: /* 4 -> 3 Di 16 Do 16 Lut 16 Grid 8 */ 02548 proc2call = NewCalcProc(LHCalc4to3_Di16_Do16_Lut16_G8_LO); 02549 break; 02550 case 16: /* 4 -> 3 Di 16 Do 16 Lut 16 Grid 16 */ 02551 proc2call = NewCalcProc(LHCalc4to3_Di16_Do16_Lut16_G16_LO); 02552 break; 02553 } 02554 break; 02555 } 02556 #endif 02557 break; 02558 } 02559 break; 02560 } 02561 break; 02562 case 4: /* 4 -> 4 */ 02563 switch (info->usedSizeIn) 02564 { 02565 case 8: /* 4 -> 4 Di 8 */ 02566 switch (info->usedSizeOut) 02567 { 02568 case 8: /* 4 -> 4 Di 8 Do 8 */ 02569 switch (lutParam->colorLutWordSize) 02570 { 02571 case 8: /* 4 -> 4 Di 8 Do 8 Lut 8 */ 02572 switch (lutParam->colorLutGridPoints) 02573 { 02574 case 8: /* 4 -> 4 Di 8 Do 8 Lut 8 Grid 8 */ 02575 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut8_G8_LO); 02576 break; 02577 case 16: /* 4 -> 4 Di 8 Do 8 Lut 8 Grid 16 */ 02578 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut8_G16_LO); 02579 break; 02580 } 02581 break; 02582 case 16: /* 4 -> 4 Di 8 Do 8 Lut 16 */ 02583 switch (lutParam->colorLutGridPoints) 02584 { 02585 case 8: /* 4 -> 4 Di 8 Do 8 Lut 16 Grid 8 */ 02586 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut16_G8_LO); 02587 break; 02588 case 16: /* 4 -> 4 Di 8 Do 8 Lut 16 Grid 16 */ 02589 proc2call = NewCalcProc(LHCalc4to4_Di8_Do8_Lut16_G16_LO); 02590 break; 02591 } 02592 break; 02593 } 02594 break; 02595 case 16: /* 4 -> 4 Di 8 Do 16 */ 02596 #if LH_CALC_ENGINE_MIXED_DATAFORMAT 02597 switch (lutParam->colorLutWordSize) 02598 { 02599 case 8: /* 4 -> 4 Di 8 Do 16 Lut 8 */ 02600 switch (lutParam->colorLutGridPoints) 02601 { 02602 case 8: /* 4 -> 4 Di 8 Do 16 Lut 8 Grid 8 */ 02603 proc2call = NewCalcProc(LHCalc4to4_Di8_Do16_Lut8_G8_LO); 02604 break; 02605 case 16: /* 4 -> 4 Di 8 Do 16 Lut 8 Grid 16 */ 02606 proc2call = NewCalcProc(LHCalc4to4_Di8_Do16_Lut8_G16_LO); 02607 break; 02608 } 02609 break; 02610 case 16: /* 4 -> 4 Di 8 Do 16 Lut 16 */ 02611 switch (lutParam->colorLutGridPoints) 02612 { 02613 case 8: /* 4 -> 4 Di 8 Do 16 Lut 16 Grid 8 */ 02614 proc2call = NewCalcProc(LHCalc4to4_Di8_Do16_Lut16_G8_LO); 02615 break; 02616 case 16: /* 4 -> 4 Di 8 Do 16 Lut 16 Grid 16 */ 02617 proc2call = NewCalcProc(LHCalc4to4_Di8_Do16_Lut16_G16_LO); 02618 break; 02619 } 02620 break; 02621 } 02622 #endif 02623 break; 02624 } 02625 break; 02626 case 16: /* 4 -> 4 Di 16 */ 02627 switch (info->usedSizeOut) 02628 { 02629 case 8: /* 4 -> 4 Di 16 Do 8 */ 02630 #if LH_CALC_ENGINE_MIXED_DATAFORMAT 02631 switch (lutParam->colorLutWordSize) 02632 { 02633 case 8: /* 4 -> 4 Di 16 Do 8 Lut 8 */ 02634 switch (lutParam->colorLutGridPoints) 02635 { 02636 case 8: /* 4 -> 4 Di 16 Do 8 Lut 8 Grid 8 */ 02637 proc2call = NewCalcProc(LHCalc4to4_Di16_Do8_Lut8_G8_LO); 02638 break; 02639 case 16: /* 4 -> 4 Di 16 Do 8 Lut 8 Grid 16 */ 02640 proc2call = NewCalcProc(LHCalc4to4_Di16_Do8_Lut8_G16_LO); 02641 break; 02642 } 02643 break; 02644 case 16: /* 4 -> 4 Di 16 Do 8 Lut 16 */ 02645 switch (lutParam->colorLutGridPoints) 02646 { 02647 case 8: /* 4 -> 4 Di 16 Do 8 Lut 16 Grid 8 */ 02648 proc2call = NewCalcProc(LHCalc4to4_Di16_Do8_Lut16_G8_LO); 02649 break; 02650 case 16: /* 4 -> 4 Di 16 Do 8 Lut 16 Grid 16 */ 02651 proc2call = NewCalcProc(LHCalc4to4_Di16_Do8_Lut16_G16_LO); 02652 break; 02653 } 02654 break; 02655 } 02656 #endif 02657 break; 02658 case 16: /* 4 -> 4 Di 16 Do 16 */ 02659 #if LH_CALC_ENGINE_16_BIT_LO 02660 switch (lutParam->colorLutWordSize) 02661 { 02662 case 8: /* 4 -> 4 Di 16 Do 16 Lut 8 */ 02663 switch (lutParam->colorLutGridPoints) 02664 { 02665 case 8: /* 4 -> 4 Di 16 Do 16 Lut 8 Grid 8 */ 02666 proc2call = NewCalcProc(LHCalc4to4_Di16_Do16_Lut8_G8_LO); 02667 break; 02668 case 16: /* 4 -> 4 Di 16 Do 16 Lut 8 Grid 16 */ 02669 proc2call = NewCalcProc(LHCalc4to4_Di16_Do16_Lut8_G16_LO); 02670 break; 02671 } 02672 break; 02673 case 16: /* 4 -> 4 Di 16 Do 16 Lut 16 */ 02674 switch (lutParam->colorLutGridPoints) 02675 { 02676 case 8: /* 4 -> 4 Di 16 Do 16 Lut 16 Grid 8 */ 02677 proc2call = NewCalcProc(LHCalc4to4_Di16_Do16_Lut16_G8_LO); 02678 break; 02679 case 16: /* 4 -> 4 Di 16 Do 16 Lut 16 Grid 16 */ 02680 proc2call = NewCalcProc(LHCalc4to4_Di16_Do16_Lut16_G16_LO); 02681 break; 02682 } 02683 break; 02684 } 02685 #endif 02686 break; 02687 } 02688 break; 02689 } 02690 break; 02691 } 02692 break; 02693 #endif 02694 } 02695 02696 LH_END_PROC("FindLookupRoutine") 02697 return proc2call; 02698 }

CMError LHCheckBitMapPrivate CMMModelPtr  modelingData,
const CMBitmap inBitMap,
CMBitmapCallBackUPP  progressProc,
void *  refCon,
CMBitmap outBitMap
 

Definition at line 4255 of file lh_core/runtime.c.

04260 { 04261 CMCalcParam calcParam; 04262 CMLutParam lutParam; 04263 CMError err = -1; 04264 ColorSpaceInfo info; 04265 CalcProcPtr calcRoutine = nil; 04266 CMBitmap bitMapIn = *inBitMap; 04267 CMBitmap bitMapOut; 04268 OSType inColorSpace = modelingData->firstColorSpace; 04269 Boolean progressProcWasCalled = FALSE; 04270 SINT32 offset; 04271 SINT32 progressTimer; 04272 SINT32 dimLoop; 04273 Boolean matchInPlace = FALSE; 04274 long progressProcCount = 0; 04275 SINT32 inLineCount; 04276 04277 LH_START_PROC("LHCheckBitMapPrivate") 04278 04279 if( (modelingData)->gamutLutParam.colorLut == 0 )return cmMethodError; 04280 LOCK_DATA((modelingData)->gamutLutParam.inputLut); 04281 LOCK_DATA((modelingData)->gamutLutParam.colorLut); 04282 LOCK_DATA((modelingData)->gamutLutParam.outputLut); 04283 04284 SetMem(&info, sizeof(ColorSpaceInfo), 0); 04285 SetMem(&calcParam, sizeof(CMCalcParam), 0); 04286 04287 if ( (outBitMap == nil ) || (modelingData->gamutLutParam.colorLut == nil) ) 04288 { 04289 err = cmInvalidDstMap; 04290 goto CleanupAndExit; 04291 } 04292 bitMapOut = *outBitMap; 04293 FillLutParamChk(&lutParam, modelingData); 04294 FillCalcParam(&calcParam, &bitMapIn, &bitMapOut); 04295 04296 err = CheckInputColorSpace( &bitMapIn, &calcParam, &info, inColorSpace, lutParam.colorLutInDim ); 04297 inLineCount = calcParam.cmLineCount; 04298 if (err) 04299 goto CleanupAndExit; 04300 04301 err = CheckOutputColorSpaceChk( &bitMapOut, &calcParam, &info ); 04302 if (err) 04303 goto CleanupAndExit; 04304 04305 info.inPlace = bitMapOut.image == bitMapIn.image && info.tempInBuffer == nil && info.tempOutBuffer == nil; 04306 calcRoutine = FindCalcRoutine( &calcParam, &lutParam, &info, modelingData->lookup ); 04307 if (calcRoutine == nil) 04308 { 04309 err = cmMethodError; 04310 goto CleanupAndExit; 04311 } 04312 04313 /* ------------------------------------------------- 8 or 16 bit data --------------------------------------------------------- */ 04314 if ((info.tempInBuffer == nil) && (info.tempOutBuffer == nil) && modelingData->hasNamedColorProf == NoNamedColorProfile) 04315 { 04316 if (progressProc == nil) 04317 err = CallCalcProc(calcRoutine,&calcParam, &lutParam); /* no callback proc - do it all in one step */ 04318 else 04319 { 04320 calcParam.cmLineCount = kMaxTempBlock / calcParam.cmInputBytesPerLine; 04321 if (calcParam.cmLineCount < 1) 04322 calcParam.cmLineCount = 1; 04323 else if (calcParam.cmLineCount > bitMapIn.height) 04324 calcParam.cmLineCount = bitMapIn.height; 04325 04326 progressTimer = TickCount(); 04327 while ( info.processedLinesIn < bitMapIn.height ) 04328 { 04329 err = CallCalcProc(calcRoutine,&calcParam, &lutParam); 04330 04331 for (dimLoop = 0; dimLoop< lutParam.colorLutInDim; dimLoop++) 04332 calcParam.inputData[dimLoop] = (Ptr)calcParam.inputData[dimLoop] + calcParam.cmLineCount * calcParam.cmInputBytesPerLine; 04333 04334 for (dimLoop = 0; dimLoop< lutParam.colorLutOutDim; dimLoop++) 04335 calcParam.outputData[dimLoop] = (Ptr)calcParam.outputData[dimLoop] + calcParam.cmLineCount * calcParam.cmOutputBytesPerLine; 04336 04337 info.processedLinesIn += calcParam.cmLineCount; 04338 if ( info.processedLinesIn + calcParam.cmLineCount > bitMapIn.height ) 04339 calcParam.cmLineCount = bitMapIn.height-info.processedLinesIn; 04340 04341 /* - - - - - handle CMBitmapCallBackProc - - - - - */ 04342 if ( progressProc && ( progressTimer + kProgressTicks < (SINT32)TickCount()) ) 04343 { 04344 progressProcWasCalled = TRUE; 04345 if (CallCMBitmapCallBackProc ( progressProc, bitMapIn.height, info.processedLinesIn, (void *)refCon )) 04346 { 04347 info.processedLinesIn = bitMapIn.height; 04348 err = userCanceledErr; 04349 } else 04350 progressTimer = TickCount(); 04351 progressProcCount = info.processedLinesIn; 04352 } 04353 } 04354 } 04355 } 04356 else if (modelingData->hasNamedColorProf != NamedColorProfileOnly ){ 04357 info.processedLinesIn = 0; 04358 progressTimer = TickCount(); 04359 if( info.tempInBuffer && info.tempOutBuffer ){ 04360 if( inLineCount > calcParam.cmLineCount )inLineCount = calcParam.cmLineCount; 04361 } 04362 else if( info.tempInBuffer ){ 04363 } 04364 else if( info.tempOutBuffer ){ 04365 inLineCount = calcParam.cmLineCount; 04366 } 04367 else if( progressProc ){ 04368 inLineCount = kMaxTempBlock / calcParam.cmInputBytesPerLine; 04369 if (inLineCount < 1) 04370 inLineCount = 1; 04371 else if (inLineCount > bitMapIn.height) 04372 inLineCount = bitMapIn.height; 04373 } 04374 while ( info.processedLinesIn < bitMapIn.height ) 04375 { 04376 if ( info.processedLinesIn + inLineCount > bitMapIn.height ) 04377 inLineCount = bitMapIn.height-info.processedLinesIn; 04378 04379 if (info.origSizeIn == 5 ) /* input is 5 bit */ 04380 Convert5To8 ( bitMapIn.image, (Ptr)info.tempInBuffer, info.processedLinesIn, inLineCount, bitMapIn.width, bitMapIn.rowBytes ); 04381 #ifdef PI_Application_h 04382 else if (info.origSizeIn == 6 ) /* output is 5 bit */ 04383 Convert565To8 ( bitMapIn.image, (Ptr)info.tempInBuffer, info.processedLinesIn, inLineCount, bitMapIn.width, bitMapIn.rowBytes ); 04384 #endif 04385 else if (info.origSizeIn == 10 ) 04386 Convert10To16 ( bitMapIn.image, (Ptr)info.tempInBuffer, info.processedLinesIn, inLineCount, bitMapIn.width, bitMapIn.rowBytes ); 04387 04388 if (modelingData->hasNamedColorProf == NamedColorProfileAtBegin ){ 04389 err = ConvertIndexToLabBitmap( modelingData, bitMapIn.image, 04390 (Ptr)info.tempInBuffer, info.processedLinesIn, 04391 inLineCount, bitMapIn.width, 04392 bitMapIn.rowBytes, 04393 calcParam.cmInputBytesPerLine, 04394 calcParam.cmInputPixelOffset*8 ); 04395 if (err) 04396 goto CleanupAndExit; 04397 } 04398 calcParam.cmLineCount = inLineCount; 04399 err = CallCalcProc( calcRoutine, &calcParam, &lutParam ); 04400 if (err) 04401 goto CleanupAndExit; 04402 04403 if( info.origSizeOut == 1 ) /* output is 5 bit */ 04404 Convert8To1 ( (Ptr)info.tempOutBuffer, bitMapOut.image, info.processedLinesIn, calcParam.cmLineCount, bitMapOut.width, bitMapOut.rowBytes); 04405 04406 info.processedLinesIn += inLineCount; 04407 /* - - - - - handle CMBitmapCallBackProc - - - - - */ 04408 if ( progressProc && ( progressTimer + kProgressTicks < (SINT32)TickCount()) ) 04409 { 04410 progressProcWasCalled = TRUE; 04411 if (CallCMBitmapCallBackProc ( progressProc, bitMapIn.height, info.processedLinesIn, (void *)refCon )) 04412 { 04413 info.processedLinesIn = bitMapIn.height; 04414 err = userCanceledErr; 04415 } else 04416 progressTimer = TickCount(); 04417 progressProcCount = info.processedLinesIn; 04418 } 04419 if( !info.tempInBuffer ){ 04420 offset = calcParam.cmLineCount * calcParam.cmInputBytesPerLine; 04421 for (dimLoop = 0; dimLoop< lutParam.colorLutInDim; dimLoop++) 04422 calcParam.inputData[dimLoop] = (Ptr)calcParam.inputData[dimLoop] + offset; 04423 } 04424 if( !info.tempOutBuffer ){ 04425 offset = calcParam.cmLineCount * calcParam.cmOutputBytesPerLine; 04426 for (dimLoop = 0; dimLoop< lutParam.colorLutOutDim; dimLoop++) 04427 calcParam.outputData[dimLoop] = (Ptr)calcParam.outputData[dimLoop] + offset; 04428 } 04429 } 04430 DisposeIfPtr((Ptr)info.tempInBuffer); 04431 DisposeIfPtr((Ptr)info.tempOutBuffer); 04432 } 04433 else{ 04434 DisposeIfPtr((Ptr)info.tempInBuffer); 04435 err = cmMethodError; 04436 goto CleanupAndExit; 04437 } 04438 if (err) 04439 goto CleanupAndExit; 04440 04441 if( progressProcWasCalled && progressProcCount != bitMapIn.height ) 04442 CallCMBitmapCallBackProc ( progressProc, bitMapIn.height, bitMapIn.height, (void *)refCon ); 04443 CleanupAndExit: 04444 UNLOCK_DATA((modelingData)->gamutLutParam.inputLut); 04445 UNLOCK_DATA((modelingData)->gamutLutParam.colorLut); 04446 UNLOCK_DATA((modelingData)->gamutLutParam.outputLut); 04447 04448 LH_END_PROC("LHCheckBitMapPrivate") 04449 04450 return err; 04451 }

CMError LHCheckColorsPrivate CMMModelPtr  modelingData,
CMColor myColors,
UINT32  count,
UINT8 result
 

Definition at line 3871 of file lh_core/runtime.c.

References AllocBufferCheckCM(), CalcProcPtr, CallCalcProc, CMError, CMCalcParam::cmLineCount, cmMethodError, Convert8To1(), DisposeIfPtr(), FillCalcParamCM(), FillLutParamChk(), FindCalcRoutine(), ColorSpaceInfo::inPlace, LH_END_PROC, LH_START_PROC, LOCK_DATA, NamedColorProfileAtEnd, NamedColorProfileOnly, nil, ColorSpaceInfo::origSizeIn, ColorSpaceInfo::origSizeOut, ColorSpaceInfo::processedLinesIn, Ptr, SetMem(), ColorSpaceInfo::tempOutBuffer, unimpErr, UNLOCK_DATA, ColorSpaceInfo::usedSizeIn, and ColorSpaceInfo::usedSizeOut.

03875 { 03876 CMCalcParam calcParam; 03877 CMLutParam lutParam; 03878 CMError err = -1; 03879 ColorSpaceInfo info; 03880 CalcProcPtr calcRoutine = nil; 03881 03882 LH_START_PROC("LHCheckColorsPrivate") 03883 03884 SetMem(&info, sizeof(ColorSpaceInfo), 0); 03885 SetMem(&calcParam, sizeof(CMCalcParam), 0); 03886 03887 /* disabling check colors with Named Color Profile */ 03888 if ( modelingData->hasNamedColorProf == NamedColorProfileOnly || 03889 modelingData->hasNamedColorProf == NamedColorProfileAtEnd ){ 03890 err = unimpErr; 03891 goto CleanupAndExit; 03892 } 03893 03894 info.origSizeIn = 16; 03895 info.origSizeOut = 16; 03896 info.usedSizeIn = 16; 03897 info.usedSizeOut = 16; 03898 03899 if( (modelingData)->gamutLutParam.colorLut == 0 )return cmMethodError; 03900 LOCK_DATA((modelingData)->gamutLutParam.inputLut); 03901 LOCK_DATA((modelingData)->gamutLutParam.colorLut); 03902 LOCK_DATA((modelingData)->gamutLutParam.outputLut); 03903 03904 FillLutParamChk(&lutParam, modelingData); 03905 FillCalcParamCM(&calcParam, &lutParam, myColors, count ); 03906 03907 AllocBufferCheckCM(&calcParam, &info); 03908 03909 info.inPlace = info.tempOutBuffer == nil; 03910 calcRoutine = FindCalcRoutine( &calcParam, &lutParam, &info, modelingData->lookup ); 03911 if (calcRoutine == nil) 03912 { 03913 err = cmMethodError; 03914 goto CleanupAndExit; 03915 } 03916 03917 err = CallCalcProc(calcRoutine, &calcParam, &lutParam); 03918 03919 Convert8To1( (Ptr)info.tempOutBuffer, (Ptr)result, info.processedLinesIn, calcParam.cmLineCount, count, count*sizeof(CMColor)); 03920 03921 DisposeIfPtr((Ptr)info.tempOutBuffer); 03922 03923 CleanupAndExit: 03924 UNLOCK_DATA((modelingData)->gamutLutParam.inputLut); 03925 UNLOCK_DATA((modelingData)->gamutLutParam.colorLut); 03926 UNLOCK_DATA((modelingData)->gamutLutParam.outputLut); 03927 03928 LH_END_PROC("LHCheckColorsPrivate") 03929 return err; 03930 }

CMError LHCheckColorsPrivateMS CMMModelPtr  modelingData,
CMColor myColors,
UINT32  count,
UINT8 result
 

Definition at line 3797 of file lh_core/runtime.c.

03801 { 03802 CMCalcParam calcParam; 03803 CMLutParam lutParam; 03804 CMError err = -1; 03805 ColorSpaceInfo info; 03806 CalcProcPtr calcRoutine = nil; 03807 03808 LH_START_PROC("LHCheckColorsPrivateMS") 03809 03810 if( (modelingData)->gamutLutParam.colorLut == 0 )return cmMethodError; 03811 LOCK_DATA((modelingData)->gamutLutParam.inputLut); 03812 LOCK_DATA((modelingData)->gamutLutParam.colorLut); 03813 LOCK_DATA((modelingData)->gamutLutParam.outputLut); 03814 03815 /* preprocess for NamedColor stuff */ 03816 if (modelingData->hasNamedColorProf == NamedColorProfileOnly){ 03817 err = unimpErr; 03818 goto CleanupAndExit; 03819 } 03820 else if (modelingData->hasNamedColorProf==NamedColorProfileAtBegin){ 03821 err = ConvertNamedIndexToPCS(modelingData,myColors,count); 03822 if (err) goto CleanupAndExit; 03823 } 03824 03825 SetMem(&info, sizeof(ColorSpaceInfo), 0); 03826 SetMem(&calcParam, sizeof(CMCalcParam), 0); 03827 03828 info.origSizeIn = 16; 03829 info.origSizeOut = 8; 03830 info.usedSizeIn = 16; 03831 info.usedSizeOut = 8; 03832 03833 FillLutParamChk(&lutParam, modelingData); 03834 FillCalcParamCM(&calcParam, &lutParam, myColors, count ); 03835 calcParam.outputData[0] = (Ptr)result; 03836 calcParam.cmOutputBytesPerLine = count*sizeof(UINT8); 03837 calcParam.cmOutputPixelOffset = 1; 03838 calcParam.cmOutputColorSpace = cmGraySpace8Bit; /* cmGraySpace is 16 bit */ 03839 03840 03841 info.inPlace = (UINT8 *)myColors == result; 03842 calcRoutine = FindCalcRoutine( &calcParam, &lutParam, &info, modelingData->lookup ); 03843 if (calcRoutine == nil) 03844 { 03845 err = cmMethodError; 03846 goto CleanupAndExit; 03847 } 03848 03849 err = CallCalcProc(calcRoutine,&calcParam, &lutParam); 03850 if (err) 03851 goto CleanupAndExit; 03852 03853 /* postprocess for NamedColor stuff */ 03854 if( modelingData->hasNamedColorProf == NamedColorProfileAtEnd ){ 03855 err = unimpErr; 03856 goto CleanupAndExit; 03857 } 03858 CleanupAndExit: 03859 UNLOCK_DATA((modelingData)->gamutLutParam.inputLut); 03860 UNLOCK_DATA((modelingData)->gamutLutParam.colorLut); 03861 UNLOCK_DATA((modelingData)->gamutLutParam.outputLut); 03862 03863 LH_END_PROC("LHCheckColorsPrivateMS") 03864 return err; 03865 }

CMError LHMatchBitMapPlanePrivate CMMModelPtr  modelingData,
const LH_CMBitmapPlane bitMapLH,
CMBitmapCallBackUPP  progressProc,
void *  refCon,
LH_CMBitmapPlane matchedBitMapLH
 

Definition at line 4466 of file lh_core/runtime.c.

04471 { 04472 CMCalcParam calcParam; 04473 CMLutParam lutParam; 04474 CMError err = -1; 04475 ColorSpaceInfo info; 04476 CalcProcPtr calcRoutine = nil; 04477 LH_CMBitmapPlane * secondBitmapLH = matchedBitMapLH; 04478 OSType inColorSpace = (modelingData)->firstColorSpace; 04479 OSType outColorSpace = (modelingData)->lastColorSpace; 04480 Boolean progressProcWasCalled = FALSE; 04481 Boolean matchInPlace = FALSE; 04482 SINT32 dimLoop; 04483 04484 LH_START_PROC("LHMatchBitMapPlanePrivate") 04485 04486 SetMem(&info, sizeof(ColorSpaceInfo), 0); 04487 SetMem(&calcParam, sizeof(CMCalcParam), 0); 04488 04489 if (secondBitmapLH == nil) 04490 { 04491 secondBitmapLH = (LH_CMBitmapPlane *)bitMapLH; 04492 matchInPlace = TRUE; 04493 } 04494 04495 LOCK_DATA((modelingData)->lutParam.inputLut); 04496 LOCK_DATA((modelingData)->lutParam.colorLut); 04497 LOCK_DATA((modelingData)->lutParam.outputLut); 04498 04499 /* create CMBitmap based on the LH_CMBitmapPlane - so we can use the 'standard' setup functions */ 04500 { 04501 CMBitmap bitMap; 04502 CMBitmap secondBitmap; 04503 04504 bitMap.image = bitMapLH->image[0]; 04505 bitMap.width = bitMapLH->width; 04506 bitMap.height = bitMapLH->height; 04507 bitMap.rowBytes = bitMapLH->rowBytes; 04508 bitMap.pixelSize = bitMapLH->pixelSize; 04509 bitMap.space = bitMapLH->space; 04510 04511 secondBitmap.image = secondBitmapLH->image[0]; 04512 secondBitmap.width = secondBitmapLH->width; 04513 secondBitmap.height = secondBitmapLH->height; 04514 secondBitmap.rowBytes = secondBitmapLH->rowBytes; 04515 secondBitmap.pixelSize = secondBitmapLH->pixelSize; 04516 secondBitmap.space = secondBitmapLH->space; 04517 04518 FillLutParam(&lutParam, modelingData); 04519 FillCalcParam(&calcParam, &bitMap, &secondBitmap); 04520 04521 err = CheckInputColorSpace(&bitMap,&calcParam, &info, inColorSpace, lutParam.colorLutInDim ); 04522 if (err) 04523 goto CleanupAndExit; 04524 err = CheckOutputColorSpace(&secondBitmap,&calcParam, &info, outColorSpace, lutParam.colorLutOutDim ); 04525 if (err) 04526 goto CleanupAndExit; 04527 } 04528 04529 /* now update the input/output data pointers */ 04530 for (dimLoop = 0; dimLoop < 8; dimLoop++) 04531 { 04532 calcParam.inputData[dimLoop] = bitMapLH->image[dimLoop]; 04533 calcParam.outputData[dimLoop] = secondBitmapLH->image[dimLoop]; 04534 } 04535 04536 calcParam.cmInputPixelOffset = bitMapLH->elementOffset; 04537 calcParam.cmOutputPixelOffset = secondBitmapLH->elementOffset; 04538 if (bitMapLH == secondBitmapLH) /* matching in place - check if pixeloffsets are ok */ 04539 { 04540 if (calcParam.cmInputPixelOffset < calcParam.cmOutputPixelOffset) 04541 { 04542 err = cmInvalidDstMap; 04543 goto CleanupAndExit; 04544 } 04545 if (info.origSizeIn * lutParam.colorLutInDim < info.origSizeOut * lutParam.colorLutOutDim) 04546 { 04547 err = cmInvalidDstMap; 04548 goto CleanupAndExit; 04549 } 04550 } else 04551 { 04552 calcParam.copyAlpha = (calcParam.cmInputColorSpace & cmAlphaSpace) && (calcParam.cmOutputColorSpace & cmAlphaSpace); 04553 } 04554 04555 info.inPlace = info.tempInBuffer == nil && info.tempOutBuffer == nil; 04556 calcRoutine = FindCalcRoutine( &calcParam, &lutParam, &info, modelingData->lookup ); 04557 if (calcRoutine == nil) 04558 { 04559 err = cmMethodError; 04560 goto CleanupAndExit; 04561 } 04562 04563 /* ------------------------------------------------- 8 or 16 bit data --------------------------------------------------------- */ 04564 if ((info.tempInBuffer == nil) && (info.tempOutBuffer == nil)) 04565 { 04566 err = CallCalcProc(calcRoutine,&calcParam, &lutParam); 04567 } 04568 /* ----------------------------------------------- input is 5 or 10 bit ------------------------------------------------------- */ 04569 else if ((info.tempInBuffer != nil) && (info.tempOutBuffer == nil)) 04570 { 04571 DisposeIfPtr((Ptr)info.tempInBuffer); 04572 } 04573 /* ----------------------------------------------- output is 5 or 10 bit ------------------------------------------------------- */ 04574 else if ((info.tempInBuffer == nil) && (info.tempOutBuffer != nil)) 04575 { 04576 DisposeIfPtr((Ptr)info.tempOutBuffer); 04577 } 04578 /* ------------------------------------------ input and output are 5 or 10 bit ------------------------------------------------- */ 04579 else 04580 { 04581 DisposeIfPtr((Ptr)info.tempInBuffer); 04582 DisposeIfPtr((Ptr)info.tempOutBuffer); 04583 } 04584 04585 if (progressProcWasCalled) 04586 CallCMBitmapCallBackProc ( progressProc, 0, 0, (void *)refCon ); 04587 CleanupAndExit: 04588 UNLOCK_DATA((modelingData)->lutParam.inputLut); 04589 UNLOCK_DATA((modelingData)->lutParam.colorLut); 04590 UNLOCK_DATA((modelingData)->lutParam.outputLut); 04591 04592 LH_END_PROC("LHMatchBitMapPlanePrivate") 04593 return err; 04594 }

CMError LHMatchBitMapPrivate CMMModelPtr  modelingData,
const CMBitmap inBitMap,
CMBitmapCallBackUPP  progressProc,
void *  refCon,
CMBitmap outBitMap
 

Definition at line 3995 of file lh_core/runtime.c.

04000 { 04001 CMCalcParam calcParam; 04002 CMLutParam lutParam; 04003 CMError err = -1; 04004 ColorSpaceInfo info; 04005 CalcProcPtr calcRoutine = nil; 04006 CMBitmap bitMapOut; 04007 CMBitmap bitMapIn = *inBitMap; 04008 OSType inColorSpace = modelingData->firstColorSpace; 04009 OSType outColorSpace = modelingData->lastColorSpace; 04010 Boolean progressProcWasCalled = FALSE; 04011 SINT32 offset; 04012 SINT32 progressTimer; 04013 SINT32 dimLoop; 04014 Boolean matchInPlace = FALSE; 04015 long progressProcCount = 0; 04016 SINT32 inLineCount; 04017 Ptr aBuffer; 04018 04019 LH_START_PROC("LHMatchBitMapPrivate") 04020 04021 LOCK_DATA((modelingData)->lutParam.inputLut); 04022 LOCK_DATA((modelingData)->lutParam.colorLut); 04023 LOCK_DATA((modelingData)->lutParam.outputLut); 04024 04025 if( outBitMap == nil ){ 04026 bitMapOut = *inBitMap; 04027 matchInPlace = TRUE; 04028 } 04029 else{ 04030 bitMapOut = *outBitMap; 04031 } 04032 04033 SetMem(&info, sizeof(ColorSpaceInfo), 0); 04034 SetMem(&calcParam, sizeof(CMCalcParam), 0); 04035 04036 FillLutParam(&lutParam, modelingData); 04037 FillCalcParam(&calcParam, &bitMapIn, &bitMapOut); 04038 04039 err = CheckInputColorSpace( &bitMapIn, &calcParam, &info, inColorSpace, lutParam.colorLutInDim ); 04040 inLineCount = calcParam.cmLineCount; 04041 if (err) 04042 goto CleanupAndExit; 04043 04044 if (matchInPlace){ 04045 err = SetOutputColorSpaceInplace( &calcParam, &info, outColorSpace); 04046 if (err) 04047 goto CleanupAndExit; 04048 } 04049 err = CheckOutputColorSpace( &bitMapOut, &calcParam, &info, outColorSpace, lutParam.colorLutOutDim ); 04050 if (err) 04051 goto CleanupAndExit; 04052 04053 if (matchInPlace) /* matching in place - check if pixel sizes are ok */ 04054 { 04055 if (info.inputPixelSize < info.outputPixelSize) 04056 { 04057 err = cmInvalidDstMap; 04058 goto CleanupAndExit; 04059 } 04060 /* set the color space field to the output color space */ 04061 bitMapIn.space = calcParam.cmOutputColorSpace; 04062 } else 04063 { 04064 calcParam.copyAlpha = (calcParam.cmInputColorSpace & cmAlphaSpace) && (calcParam.cmOutputColorSpace & cmAlphaSpace); 04065 } 04066 04067 info.inPlace = bitMapOut.image == bitMapIn.image && info.tempInBuffer == nil && info.tempOutBuffer == nil; 04068 calcRoutine = FindCalcRoutine( &calcParam, &lutParam, &info, modelingData->lookup ); 04069 if (calcRoutine == nil) 04070 { 04071 err = cmMethodError; 04072 goto CleanupAndExit; 04073 } 04074 04075 if( info.inPlace && calcParam.cmInputPixelOffset < calcParam.cmOutputPixelOffset ){ 04076 for( dimLoop=0; dimLoop<8; dimLoop++){ /* now work backwards */ 04077 calcParam.inputData[dimLoop] = (Ptr)calcParam.inputData[dimLoop] + (calcParam.cmLineCount-1) * calcParam.cmInputBytesPerLine + (calcParam.cmPixelPerLine-1) * calcParam.cmInputPixelOffset; 04078 calcParam.outputData[dimLoop] = (Ptr)calcParam.outputData[dimLoop] + (calcParam.cmLineCount-1) * calcParam.cmOutputBytesPerLine + (calcParam.cmPixelPerLine-1) * calcParam.cmOutputPixelOffset; 04079 } 04080 calcParam.cmInputPixelOffset = -calcParam.cmInputPixelOffset; 04081 calcParam.cmOutputPixelOffset = -calcParam.cmOutputPixelOffset; 04082 calcParam.cmInputBytesPerLine = -calcParam.cmInputBytesPerLine; 04083 calcParam.cmOutputBytesPerLine = -calcParam.cmOutputBytesPerLine; 04084 } 04085 /* ------------------------------------------------- 8 or 16 bit data --------------------------------------------------------- */ 04086 if ((info.tempInBuffer == nil) && (info.tempOutBuffer == nil)&& modelingData->hasNamedColorProf == NoNamedColorProfile) 04087 { 04088 if (progressProc == nil) 04089 err = CallCalcProc(calcRoutine,&calcParam, &lutParam); /* no callback proc - do it all in one step */ 04090 else 04091 { 04092 calcParam.cmLineCount = kMaxTempBlock / calcParam.cmInputBytesPerLine; 04093 if (calcParam.cmLineCount < 1) 04094 calcParam.cmLineCount = 1; 04095 else if (calcParam.cmLineCount > bitMapIn.height) 04096 calcParam.cmLineCount = bitMapIn.height; 04097 04098 progressTimer = TickCount(); 04099 while ( info.processedLinesIn < bitMapIn.height ) 04100 { 04101 err = CallCalcProc(calcRoutine,&calcParam, &lutParam); 04102 04103 for (dimLoop = 0; dimLoop< lutParam.colorLutInDim; dimLoop++) 04104 calcParam.inputData[dimLoop] = (Ptr)calcParam.inputData[dimLoop] + calcParam.cmLineCount * calcParam.cmInputBytesPerLine; 04105 04106 for (dimLoop = 0; dimLoop< lutParam.colorLutOutDim; dimLoop++) 04107 calcParam.outputData[dimLoop] = (Ptr)calcParam.outputData[dimLoop] + calcParam.cmLineCount * calcParam.cmOutputBytesPerLine; 04108 04109 info.processedLinesIn += calcParam.cmLineCount; 04110 if ( info.processedLinesIn + calcParam.cmLineCount > bitMapIn.height ) 04111 calcParam.cmLineCount = bitMapIn.height-info.processedLinesIn; 04112 04113 /* - - - - - handle CMBitmapCallBackProc - - - - - */ 04114 if ( progressProc && ( progressTimer + kProgressTicks < (SINT32)TickCount()) ) 04115 { 04116 progressProcWasCalled = TRUE; 04117 if (CallCMBitmapCallBackProc ( progressProc, bitMapIn.height, info.processedLinesIn, (void *)refCon )) 04118 { 04119 info.processedLinesIn = bitMapIn.height; 04120 err = userCanceledErr; 04121 } else 04122 progressTimer = TickCount(); 04123 progressProcCount = info.processedLinesIn; 04124 } 04125 } 04126 } 04127 } 04128 else if (modelingData->hasNamedColorProf != NamedColorProfileOnly ){ 04129 info.processedLinesIn = 0; 04130 progressTimer = TickCount(); 04131 if( info.tempInBuffer && info.tempOutBuffer ){ 04132 if( inLineCount > calcParam.cmLineCount )inLineCount = calcParam.cmLineCount; 04133 } 04134 else if( info.tempInBuffer ){ 04135 if( progressProc && modelingData->hasNamedColorProf == NamedColorProfileAtEnd ){ 04136 inLineCount /= 32; 04137 if( inLineCount < 1 ) inLineCount = 1; 04138 } 04139 } 04140 else if( info.tempOutBuffer ){ 04141 inLineCount = calcParam.cmLineCount; 04142 } 04143 else if( progressProc ){ 04144 inLineCount = kMaxTempBlock / calcParam.cmInputBytesPerLine; 04145 if (inLineCount < 1) 04146 inLineCount = 1; 04147 else if (inLineCount > bitMapIn.height) 04148 inLineCount = bitMapIn.height; 04149 if( modelingData->hasNamedColorProf == NamedColorProfileAtEnd ){ 04150 inLineCount /= 32; 04151 if( inLineCount < 1 ) inLineCount = 1; 04152 } 04153 } 04154 while ( info.processedLinesIn < bitMapIn.height ) 04155 { 04156 if ( info.processedLinesIn + inLineCount > bitMapIn.height ) 04157 inLineCount = bitMapIn.height-info.processedLinesIn; 04158 04159 if (info.origSizeIn == 5 ) /* input is 5 bit */ 04160 Convert5To8 ( bitMapIn.image, (Ptr)info.tempInBuffer, info.processedLinesIn, inLineCount, bitMapIn.width, bitMapIn.rowBytes ); 04161 #ifdef PI_Application_h 04162 else if (info.origSizeIn == 6 ) /* output is 5 bit */ 04163 Convert565To8 ( bitMapIn.image, (Ptr)info.tempInBuffer, info.processedLinesIn, inLineCount, bitMapIn.width, bitMapIn.rowBytes ); 04164 #endif 04165 else if (info.origSizeIn == 10 ) 04166 Convert10To16 ( bitMapIn.image, (Ptr)info.tempInBuffer, info.processedLinesIn, inLineCount, bitMapIn.width, bitMapIn.rowBytes ); 04167 04168 if (modelingData->hasNamedColorProf == NamedColorProfileAtBegin ){ 04169 err = ConvertIndexToLabBitmap( modelingData, bitMapIn.image, 04170 (Ptr)info.tempInBuffer, info.processedLinesIn, 04171 inLineCount, bitMapIn.width, 04172 bitMapIn.rowBytes, 04173 calcParam.cmInputBytesPerLine, 04174 calcParam.cmInputPixelOffset*8 ); 04175 if (err) 04176 goto CleanupAndExit; 04177 } 04178 calcParam.cmLineCount = inLineCount; 04179 err = CallCalcProc( calcRoutine, &calcParam, &lutParam ); 04180 if (err) 04181 goto CleanupAndExit; 04182 04183 if (modelingData->hasNamedColorProf == NamedColorProfileAtEnd ){ 04184 if( info.tempOutBuffer )aBuffer = (Ptr)info.tempOutBuffer; 04185 else aBuffer = bitMapOut.image; 04186 err = ConvertLabToIndexBitmap( modelingData, aBuffer, 04187 info.processedLinesIn, 04188 calcParam.cmLineCount, 04189 bitMapOut.width, bitMapOut.rowBytes ); 04190 if (err) 04191 goto CleanupAndExit; 04192 } 04193 04194 if( info.origSizeOut == 5 ) /* output is 5 bit */ 04195 Convert8To5 ( (Ptr)info.tempOutBuffer, bitMapOut.image, info.processedLinesIn, calcParam.cmLineCount, bitMapOut.width, bitMapOut.rowBytes); 04196 #ifdef PI_Application_h 04197 else if( info.origSizeOut == 6 ) /* output is 5 bit */ 04198 Convert8To565 ( (Ptr)info.tempOutBuffer, bitMapOut.image, info.processedLinesIn, calcParam.cmLineCount, bitMapOut.width, bitMapOut.rowBytes); 04199 #endif 04200 else if( info.origSizeOut == 10 ) /* output is 10 bit */ 04201 Convert16To10 ( (Ptr)info.tempOutBuffer, bitMapOut.image, info.processedLinesIn, calcParam.cmLineCount, bitMapOut.width, bitMapOut.rowBytes); 04202 04203 info.processedLinesIn += inLineCount; 04204 /* - - - - - handle CMBitmapCallBackProc - - - - - */ 04205 if ( progressProc && ( progressTimer + kProgressTicks < (SINT32)TickCount()) ) 04206 { 04207 progressProcWasCalled = TRUE; 04208 if (CallCMBitmapCallBackProc ( progressProc, bitMapIn.height, info.processedLinesIn, (void *)refCon )) 04209 { 04210 info.processedLinesIn = bitMapIn.height; 04211 err = userCanceledErr; 04212 } else 04213 progressTimer = TickCount(); 04214 progressProcCount = info.processedLinesIn; 04215 } 04216 if( !info.tempInBuffer ){ 04217 offset = calcParam.cmLineCount * calcParam.cmInputBytesPerLine; 04218 for (dimLoop = 0; dimLoop< lutParam.colorLutInDim; dimLoop++) 04219 calcParam.inputData[dimLoop] = (Ptr)calcParam.inputData[dimLoop] + offset; 04220 } 04221 if( !info.tempOutBuffer ){ 04222 offset = calcParam.cmLineCount * calcParam.cmOutputBytesPerLine; 04223 for (dimLoop = 0; dimLoop< lutParam.colorLutOutDim; dimLoop++) 04224 calcParam.outputData[dimLoop] = (Ptr)calcParam.outputData[dimLoop] + offset; 04225 } 04226 } 04227 } 04228 else{ 04229 CopyIndexData( &bitMapIn, &bitMapOut, &info ); 04230 } 04231 if (err) 04232 goto CleanupAndExit; 04233 04234 if( progressProcWasCalled && progressProcCount != bitMapIn.height ) 04235 CallCMBitmapCallBackProc ( progressProc, bitMapIn.height, bitMapIn.height, (void *)refCon ); 04236 CleanupAndExit: 04237 04238 /* Clean up temporary storage */ 04239 DisposeIfPtr((Ptr)info.tempInBuffer); 04240 DisposeIfPtr((Ptr)info.tempOutBuffer); 04241 04242 UNLOCK_DATA((modelingData)->lutParam.inputLut); 04243 UNLOCK_DATA((modelingData)->lutParam.colorLut); 04244 UNLOCK_DATA((modelingData)->lutParam.outputLut); 04245 04246 LH_END_PROC("LHMatchBitMapPrivate") 04247 04248 return err; 04249 }

CMError LHMatchColorsPrivate CMMModelPtr  modelingData,
CMColor myColors,
SINT32  count
 

Definition at line 3733 of file lh_core/runtime.c.

References CalcProcPtr, CallCalcProc, CMError, cmMethodError, CMLutParam::colorLut, ConvertNamedIndexToColors(), ConvertNamedIndexToPCS(), ConvertPCSToNamedIndex(), FillCalcParamCM(), FillLutParam(), FindCalcRoutine(), ColorSpaceInfo::inPlace, CMLutParam::inputLut, LH_END_PROC, LH_START_PROC, LOCK_DATA, NamedColorProfileAtBegin, NamedColorProfileOnly, nil, ColorSpaceInfo::origSizeIn, ColorSpaceInfo::origSizeOut, CMLutParam::outputLut, SetMem(), TRUE, UNLOCK_DATA, ColorSpaceInfo::usedSizeIn, and ColorSpaceInfo::usedSizeOut.

03736 { 03737 CMCalcParam calcParam; 03738 CMLutParam lutParam; 03739 CMError err = -1; 03740 ColorSpaceInfo info; 03741 CalcProcPtr calcRoutine = nil; 03742 03743 LH_START_PROC("LHMatchColorsPrivate") 03744 03745 LOCK_DATA((modelingData)->lutParam.inputLut); 03746 LOCK_DATA((modelingData)->lutParam.colorLut); 03747 LOCK_DATA((modelingData)->lutParam.outputLut); 03748 03749 /* preprocess for NamedColor stuff */ 03750 if (modelingData->hasNamedColorProf == NamedColorProfileOnly){ 03751 err = ConvertNamedIndexToColors(modelingData,myColors,count); 03752 goto CleanupAndExit; 03753 } 03754 else if (modelingData->hasNamedColorProf==NamedColorProfileAtBegin){ 03755 err = ConvertNamedIndexToPCS(modelingData,myColors,count); 03756 if (err) goto CleanupAndExit; 03757 } 03758 03759 SetMem(&info, sizeof(ColorSpaceInfo), 0); 03760 SetMem(&calcParam, sizeof(CMCalcParam), 0); 03761 03762 info.origSizeIn = 16; 03763 info.origSizeOut = 16; 03764 info.usedSizeIn = 16; 03765 info.usedSizeOut = 16; 03766 03767 FillLutParam(&lutParam, modelingData); 03768 FillCalcParamCM(&calcParam, &lutParam, myColors, count ); 03769 03770 info.inPlace = TRUE; 03771 calcRoutine = FindCalcRoutine( &calcParam, &lutParam, &info, modelingData->lookup ); 03772 if (calcRoutine == nil) 03773 { 03774 err = cmMethodError; 03775 goto CleanupAndExit; 03776 } 03777 03778 err = CallCalcProc(calcRoutine,&calcParam, &lutParam); 03779 if (err) 03780 goto CleanupAndExit; 03781 03782 /* postprocess for NamedColor stuff */ 03783 err = ConvertPCSToNamedIndex(modelingData,myColors,count); 03784 03785 CleanupAndExit: 03786 UNLOCK_DATA((modelingData)->lutParam.inputLut); 03787 UNLOCK_DATA((modelingData)->lutParam.colorLut); 03788 UNLOCK_DATA((modelingData)->lutParam.outputLut); 03789 03790 LH_END_PROC("LHMatchColorsPrivate") 03791 return err; 03792 }

CMError SetOutputColorSpaceInplace CMCalcParamPtr  calcParam,
ColorSpaceInfo info,
OSType  outColorSpace
 

Definition at line 1910 of file lh_core/runtime.c.

References cm16PerChannelPacking, cm8PerChannelPacking, cmBGR24Space, cmBGR32Space, cmBGRSpace, cmCMY24Space, cmCMYK32Space, CMError, cmGrayASpace, cmGraySpace, cmHLS32Space, cmHSV32Space, CMCalcParam::cmInputColorSpace, CMCalcParam::cmInputPixelOffset, cmKYMC32Space, cmKYMCSpace, cmLAB24Space, cmLAB32Space, cmLUV32Space, cmMCEight8Space, cmMCFive8Space, cmMCSeven8Space, cmMCSix8Space, CMCalcParam::cmOutputColorSpace, cmRGB16_565Space, cmRGB16Space, cmRGB24Space, cmRGB32Space, cmRGBSpace, cmWord565ColorPacking, cmWord5ColorPacking, cmXYZ32Space, cmYXY32Space, icSigCmyData, icSigCmykData, icSigGrayData, icSigHlsData, icSigHsvData, icSigLabData, icSigLuvData, icSigMCH5Data, icSigMCH6Data, icSigMCH7Data, icSigMCH8Data, icSigRgbData, icSigXYZData, icSigYxyData, ColorSpaceInfo::inputPixelSize, LH_END_PROC, LH_START_PROC, noErr, and ColorSpaceInfo::origSizeIn.

01913 { 01914 CMError err = noErr; 01915 01916 LH_START_PROC("SetOutputColorSpaceInplace") 01917 01918 switch ( outColorSpace ) 01919 { 01920 case icSigXYZData: 01921 calcParam->cmOutputColorSpace = cmXYZ32Space; 01922 break; 01923 case icSigLuvData: 01924 calcParam->cmOutputColorSpace = cmLUV32Space; 01925 break; 01926 case icSigYxyData: 01927 calcParam->cmOutputColorSpace = cmYXY32Space; 01928 break; 01929 case icSigHsvData: 01930 calcParam->cmOutputColorSpace = cmHSV32Space; 01931 break; 01932 case icSigHlsData: 01933 calcParam->cmOutputColorSpace = cmHLS32Space; 01934 break; 01935 case icSigGrayData: 01936 if (calcParam->cmInputPixelOffset == 1) 01937 calcParam->cmOutputColorSpace = cmGraySpace|cm8PerChannelPacking; 01938 else if (calcParam->cmInputPixelOffset == 2) 01939 calcParam->cmOutputColorSpace = cmGraySpace; 01940 else 01941 calcParam->cmOutputColorSpace = cmGrayASpace; 01942 break; 01943 01944 case icSigRgbData: 01945 /* based on the size of the input bitmap, select the right rgb packing format */ 01946 #ifdef PI_Application_h 01947 if( (calcParam->cmInputColorSpace & 0x1f) == cmBGRSpace ){ 01948 if (info->inputPixelSize < 24){ 01949 if (info->origSizeIn == 6){ 01950 calcParam->cmOutputColorSpace = cmBGRSpace|cmWord565ColorPacking; 01951 } 01952 else{ /* output is 5 bit */ 01953 calcParam->cmOutputColorSpace = cmBGRSpace|cmWord5ColorPacking; 01954 } 01955 } 01956 if (info->inputPixelSize < 32) 01957 calcParam->cmOutputColorSpace = cmBGR24Space; 01958 else if (info->inputPixelSize == 32) 01959 calcParam->cmOutputColorSpace = cmBGR32Space; 01960 else if (info->inputPixelSize == 48) 01961 calcParam->cmOutputColorSpace = cmBGRSpace | cm16PerChannelPacking; 01962 else if (info->inputPixelSize == 64) 01963 calcParam->cmOutputColorSpace = cmBGR32Space | cm16PerChannelPacking; 01964 break; 01965 } 01966 #endif 01967 if (info->inputPixelSize < 24) 01968 #ifdef PI_Application_h 01969 if (info->origSizeIn == 6){ 01970 calcParam->cmOutputColorSpace = cmRGB16_565Space; 01971 } 01972 else /* output is 5 bit */ 01973 #endif 01974 calcParam->cmOutputColorSpace = cmRGB16Space; 01975 else if (info->inputPixelSize < 32) 01976 calcParam->cmOutputColorSpace = cmRGB24Space; 01977 else if (info->inputPixelSize == 32) 01978 calcParam->cmOutputColorSpace = cmRGB32Space; 01979 else if (info->inputPixelSize == 48) 01980 calcParam->cmOutputColorSpace = cmRGBSpace | cm16PerChannelPacking; 01981 else if (info->inputPixelSize == 64) 01982 calcParam->cmOutputColorSpace = cmRGB32Space | cm16PerChannelPacking; 01983 break; 01984 01985 case icSigLabData: 01986 /* based on the size of the input bitmap, select the right lab packing format */ 01987 if (info->inputPixelSize < 32) 01988 calcParam->cmOutputColorSpace = cmLAB24Space; 01989 else 01990 calcParam->cmOutputColorSpace = cmLAB32Space; 01991 break; 01992 01993 case icSigCmyData: 01994 calcParam->cmOutputColorSpace = cmCMY24Space; 01995 break; 01996 case icSigCmykData: 01997 #ifdef PI_Application_h 01998 if( (calcParam->cmInputColorSpace & 0x1f) == cmKYMCSpace ){ 01999 calcParam->cmOutputColorSpace = cmKYMC32Space; 02000 break; 02001 } 02002 #endif 02003 calcParam->cmOutputColorSpace = cmCMYK32Space; 02004 break; 02005 02006 case icSigMCH5Data: 02007 calcParam->cmOutputColorSpace = cmMCFive8Space; 02008 break; 02009 case icSigMCH6Data: 02010 calcParam->cmOutputColorSpace = cmMCSix8Space; 02011 break; 02012 case icSigMCH7Data: 02013 calcParam->cmOutputColorSpace = cmMCSeven8Space; 02014 break; 02015 case icSigMCH8Data: 02016 calcParam->cmOutputColorSpace = cmMCEight8Space; 02017 break; 02018 default: 02019 break; 02020 } 02021 02022 LH_END_PROC("SetOutputColorSpaceInplace") 02023 return err; 02024 }


Generated on Sat May 15 19:45:31 2004 for test by doxygen 1.3.7