test: lh_open/pi_valid.c File Reference

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

# pi_valid.c File Reference

`#include "General.h"`

Go to the source code of this file.

## Functions

PI_Boolean | CMValInput (CMProfileRef prof, icHeader *aHeader)
PI_Boolean | CMValDisplay (CMProfileRef prof, icHeader *aHeader)
PI_Boolean | CMValOutput (CMProfileRef prof, icHeader *aHeader)
PI_Boolean | CMValLink (CMProfileRef prof)
PI_Boolean | CMValColorSpace (CMProfileRef prof, icHeader *aHeader)
PI_Boolean | CMValAbstract (CMProfileRef prof, icHeader *aHeader)
PI_Boolean | CMValNamed (CMProfileRef prof, icHeader *aHeader)
PI_Boolean | CMValGray (CMProfileRef prof)
PI_Boolean | CMValRGB (CMProfileRef prof)
PI_Boolean | CMValAToB (CMProfileRef prof)
PI_Boolean | CMValBToA (CMProfileRef prof)
PI_Boolean | CMValMftOutput (CMProfileRef prof)
CMError | CMValidateProfile (CMProfileRef prof, PI_Boolean *valid)

## Function Documentation

PI_Boolean CMValAbstract | ( | CMProfileRef | prof,
|  | icHeader * | aHeader
| ) |

Definition at line 209 of file lh_open/pi_valid.c.

References CMValAToB(), FALSE, icSigLabData, icSigXYZData, icHeader::pcs, and PI_Boolean.

    00211 {
    00212         PI_Boolean valid;
    00213         switch (aHeader->pcs)
    00214         {
    00215
    00216                 case icSigXYZData:
    00217                 case icSigLabData:
    00218                         valid = CMValAToB(prof);
    00219                         break;
    00220
    00221                 default:
    00222                         valid = FALSE;
    00223         }
    00224
    00225         return (valid);
    00226 }

PI_Boolean CMValAToB | ( | CMProfileRef | prof | ) |

Definition at line 268 of file lh_open/pi_valid.c.

References CMProfileElementExists(), CMProfileRef, icSigAToB0Tag, icSigCopyrightTag, icSigMediaWhitePointTag, icSigProfileDescriptionTag, and PI_Boolean.

    00269 {
    00270         PI_Boolean valid;
    00271         valid = CMProfileElementExists((CMProfileRef)prof, icSigProfileDescriptionTag);
    00272
    00273         if (valid)
    00274                 valid = CMProfileElementExists((CMProfileRef)prof, icSigAToB0Tag);
    00275
    00276         if (valid)
    00277                 valid = CMProfileElementExists((CMProfileRef)prof, icSigMediaWhitePointTag);/* change to enum */
    00278
    00279         if (valid)
    00280                 valid = CMProfileElementExists((CMProfileRef)prof, icSigCopyrightTag);/* change to enum */
    00281
    00282         return (valid);
    00283 }

PI_Boolean CMValBToA | ( | CMProfileRef | prof | ) |

Definition at line 285 of file lh_open/pi_valid.c.

References CMProfileElementExists(), CMProfileRef, icSigBToA0Tag, icSigCopyrightTag, icSigMediaWhitePointTag, icSigProfileDescriptionTag, and PI_Boolean.

    00286 {
    00287         PI_Boolean valid;
    00288         valid = CMProfileElementExists((CMProfileRef)prof, icSigProfileDescriptionTag);
    00289
    00290         if (valid)
    00291                 valid = CMProfileElementExists((CMProfileRef)prof, icSigBToA0Tag);
    00292
    00293         if (valid)
    00294                 valid = CMProfileElementExists((CMProfileRef)prof, icSigMediaWhitePointTag);/* change to enum */
    00295
    00296         if (valid)
    00297                 valid = CMProfileElementExists((CMProfileRef)prof, icSigCopyrightTag);/* change to enum */
    00298
    00299         return (valid);
    00300 }

PI_Boolean CMValColorSpace | ( | CMProfileRef | prof,
|  | icHeader * | aHeader
| ) |

Definition at line 182 of file lh_open/pi_valid.c.

References CMProfileElementExists(), CMProfileRef, FALSE, icSigAToB0Tag, icSigBToA0Tag, icSigCopyrightTag, icSigLabData, icSigMediaWhitePointTag, icSigProfileDescriptionTag, icSigXYZData, icHeader::pcs, and PI_Boolean.

    00184 {
    00185         PI_Boolean valid;
    00186         if (aHeader->pcs != icSigXYZData && aHeader->pcs != icSigLabData){
    00187                 valid = FALSE;
    00188                 return (valid);
    00189         }
    00190
    00191         valid = CMProfileElementExists((CMProfileRef)prof, icSigProfileDescriptionTag);
    00192
    00193         if (valid)
    00194                 valid = CMProfileElementExists((CMProfileRef)prof, icSigAToB0Tag);
    00195
    00196         if (valid)
    00197                 valid = CMProfileElementExists((CMProfileRef)prof, icSigBToA0Tag);
    00198
    00199         if (valid)
    00200                 valid = CMProfileElementExists((CMProfileRef)prof, icSigMediaWhitePointTag);
    00201
    00202         if (valid)
    00203                 valid = CMProfileElementExists((CMProfileRef)prof, icSigCopyrightTag);
    00204
    00205         return (valid);
    00206 }

PI_Boolean CMValDisplay | ( | CMProfileRef | prof,
|  | icHeader * | aHeader
| ) |

Definition at line 88 of file lh_open/pi_valid.c.

References CMValBToA(), CMValGray(), CMValRGB(), icHeader::colorSpace, FALSE, icSigCmyData, icSigCmykData, icSigGrayData, icSigLabData, icSigMCH3Data, icSigMCH4Data, icSigRgbData, icSigXYZData, icHeader::pcs, and PI_Boolean.

    00090 {
    00091         PI_Boolean valid;
    00092         switch (aHeader->colorSpace)
    00093         {
    00094
    00095                 case icSigGrayData:
    00096                         valid = CMValGray(prof);
    00097                         break;
    00098
    00099                 case icSigRgbData:
    00100                         if (aHeader->pcs == icSigLabData){
    00101                                 valid = CMValBToA(prof);
    00102                         }
    00103                         else{
    00104                                 valid = CMValRGB(prof);
    00105                         }
    00106                         break;
    00107                 case icSigMCH3Data:
    00108                 case icSigMCH4Data:
    00109                 case icSigCmyData:
    00110                 case icSigCmykData:
    00111                         valid = CMValBToA(prof);
    00112                         break;
    00113
    00114                 default:
    00115                         valid = FALSE;
    00116         }
    00117
    00118         if (aHeader->pcs != icSigXYZData && aHeader->pcs != icSigLabData){
    00119                 valid = FALSE;
    00120         }
    00121         return (valid);
    00122 }

PI_Boolean CMValGray | ( | CMProfileRef | prof | ) |

Definition at line 251 of file lh_open/pi_valid.c.

References CMProfileElementExists(), CMProfileRef, icSigCopyrightTag, icSigGrayTRCTag, icSigMediaWhitePointTag, icSigProfileDescriptionTag, and PI_Boolean.

    00252 {
    00253         PI_Boolean valid;
    00254         valid = CMProfileElementExists((CMProfileRef)prof, icSigProfileDescriptionTag);
    00255
    00256         if (valid)
    00257                 valid = CMProfileElementExists((CMProfileRef)prof, icSigGrayTRCTag);
    00258
    00259         if (valid)
    00260                 valid = CMProfileElementExists((CMProfileRef)prof, icSigMediaWhitePointTag);
    00261
    00262         if (valid)
    00263                 valid = CMProfileElementExists((CMProfileRef)prof, icSigCopyrightTag);
    00264
    00265         return (valid);
    00266 }

CMError CMValidateProfile | ( | CMProfileRef | prof,
|  | PI_Boolean * | valid
| ) |

Definition at line 302 of file lh_open/pi_valid.c.

    00304 {
    00305         CMError err = noErr;
    00306         icHeader aHeader;
    00307
    00308         *valid = FALSE;
    00309         err = CMGetProfileHeader((CMProfileRef)prof, &aHeader);
    00310
    00311         if (!err)
    00312         {
    00313                 if ((aHeader.version & 0xff000000) >= icVersionNumber ){
    00314                         switch (aHeader.deviceClass)
    00315                           {
    00316                                 case icSigInputClass:
    00317                                 *valid = CMValInput(prof, &aHeader );
    00318                                 break;
    00319
    00320                                 case icSigDisplayClass:
    00321                                 *valid = CMValDisplay(prof, &aHeader );
    00322                                 break;
    00323
    00324                                 case icSigOutputClass:
    00325                                 *valid = CMValOutput(prof, &aHeader );
    00326                                 break;
    00327
    00328                                 case icSigLinkClass:
    00329                                 *valid = CMValLink(prof);
    00330                                 break;
    00331
    00332                                 case icSigColorSpaceClass:
    00333                                 *valid = CMValColorSpace(prof, &aHeader );
    00334                                 break;
    00335
    00336                                 case icSigAbstractClass:
    00337                                 *valid = CMValAbstract(prof, &aHeader );
    00338                                 break;
    00339
    00340                                 case icSigNamedColorClass:
    00341                                 *valid = CMValNamed(prof, &aHeader );
    00342                                 break;
    00343
    00344                                 default:
    00345                                 *valid = FALSE;
    00346                           }
    00347
    00348                 }
    00349                 else
    00350                 {                                                                               /* unknown profile */
    00351                         *valid = FALSE;
    00352                         return (cmProfileError);
    00353                 }
    00354         }
    00355
    00356         return (err);
    00357 }

PI_Boolean CMValInput | ( | CMProfileRef | prof,
|  | icHeader * | aHeader
| ) |

Definition at line 37 of file lh_open/pi_valid.c.

References CMValAToB(), CMValGray(), CMValRGB(), icHeader::colorSpace, FALSE, icSigCmyData, icSigCmykData, icSigGrayData, icSigLabData, icSigMCH2Data, icSigMCH3Data, icSigMCH4Data, icSigMCH5Data, icSigMCH6Data, icSigMCH7Data, icSigMCH8Data, icSigMCH9Data, icSigMCHAData, icSigMCHBData, icSigMCHCData, icSigMCHDData, icSigMCHEData, icSigMCHFData, icSigRgbData, icSigXYZData, icHeader::pcs, and PI_Boolean.

    00039 {
    00040         PI_Boolean valid;
    00041         switch ( aHeader->colorSpace)
    00042         {
    00043
    00044                 case icSigGrayData:
    00045                         valid = CMValGray(prof);
    00046                         break;
    00047
    00048                 case icSigRgbData:
    00049                         if (aHeader->pcs == icSigLabData)
    00050                         {
    00051                                 valid = CMValAToB(prof);
    00052                         }
    00053                         else
    00054                         {
    00055                                 valid = CMValRGB(prof);
    00056                         }
    00057                         break;
    00058
    00059                 case icSigCmyData:
    00060                 case icSigCmykData:
    00061                 case icSigMCH2Data:
    00062                 case icSigMCH3Data:
    00063                 case icSigMCH4Data:
    00064                 case icSigMCH5Data:
    00065                 case icSigMCH6Data:
    00066                 case icSigMCH7Data:
    00067                 case icSigMCH8Data:
    00068                 case icSigMCH9Data:
    00069                 case icSigMCHAData:
    00070                 case icSigMCHBData:
    00071                 case icSigMCHCData:
    00072                 case icSigMCHDData:
    00073                 case icSigMCHEData:
    00074                 case icSigMCHFData:
    00075                         valid = CMValAToB(prof);
    00076                         break;
    00077
    00078                 default:
    00079                         valid = FALSE;
    00080         }
    00081
    00082         if (aHeader->pcs != icSigXYZData && aHeader->pcs != icSigLabData){
    00083                 valid = FALSE;
    00084         }
    00085         return (valid);
    00086 }

PI_Boolean CMValLink | ( | CMProfileRef | prof | ) |

Definition at line 165 of file lh_open/pi_valid.c.

References CMProfileElementExists(), CMProfileRef, icSigAToB0Tag, icSigCopyrightTag, icSigProfileDescriptionTag, icSigProfileSequenceDescTag, and PI_Boolean.

    00166 {
    00167         PI_Boolean valid;
    00168         valid = CMProfileElementExists((CMProfileRef)prof, icSigProfileDescriptionTag);
    00169
    00170         if (valid)
    00171                 valid = CMProfileElementExists((CMProfileRef)prof, icSigAToB0Tag);
    00172
    00173         if (valid)
    00174                 valid = CMProfileElementExists((CMProfileRef)prof, icSigProfileSequenceDescTag);
    00175
    00176         if (valid)
    00177                 valid = CMProfileElementExists((CMProfileRef)prof, icSigCopyrightTag);
    00178
    00179         return (valid);
    00180 }

PI_Boolean CMValMftOutput | ( | CMProfileRef | prof | ) |

Definition at line 359 of file lh_open/pi_valid.c.

References CMProfileElementExists(), CMProfileRef, icSigAToB0Tag, icSigAToB1Tag, icSigAToB2Tag, icSigBToA0Tag, icSigBToA1Tag, icSigBToA2Tag, icSigCopyrightTag, icSigGamutTag, icSigMediaWhitePointTag, icSigProfileDescriptionTag, and PI_Boolean.

    00360 {
    00361         PI_Boolean valid;
    00362         valid = CMProfileElementExists((CMProfileRef)prof, icSigProfileDescriptionTag);
    00363
    00364         if (valid)
    00365                 valid = CMProfileElementExists((CMProfileRef)prof, icSigAToB0Tag);
    00366
    00367         if (valid)
    00368                 valid = CMProfileElementExists((CMProfileRef)prof, icSigAToB1Tag);
    00369
    00370         if (valid)
    00371                 valid = CMProfileElementExists((CMProfileRef)prof, icSigAToB2Tag);
    00372
    00373         if (valid)
    00374                 valid = CMProfileElementExists((CMProfileRef)prof, icSigBToA0Tag);
    00375
    00376         if (valid)
    00377                 valid = CMProfileElementExists((CMProfileRef)prof, icSigBToA1Tag);
    00378
    00379         if (valid)
    00380                 valid = CMProfileElementExists((CMProfileRef)prof, icSigBToA2Tag);
    00381
    00382         if (valid)
    00383                 valid = CMProfileElementExists((CMProfileRef)prof, icSigGamutTag);
    00384
    00385         if (valid)
    00386                 valid = CMProfileElementExists((CMProfileRef)prof, icSigMediaWhitePointTag);
    00387
    00388         if (valid)
    00389                 valid = CMProfileElementExists((CMProfileRef)prof, icSigCopyrightTag);
    00390
    00391         return (valid);
    00392 }

PI_Boolean CMValNamed | ( | CMProfileRef | prof,
|  | icHeader * | aHeader
| ) |

Definition at line 228 of file lh_open/pi_valid.c.

References CMProfileElementExists(), CMProfileRef, FALSE, icSigCopyrightTag, icSigLabData, icSigMediaWhitePointTag, icSigNamedColor2Tag, icSigProfileDescriptionTag, icSigXYZData, icHeader::pcs, and PI_Boolean.

    00230 {
    00231         PI_Boolean valid;
    00232         if (aHeader->pcs != icSigXYZData && aHeader->pcs != icSigLabData){
    00233                 valid = FALSE;
    00234                 return (valid);
    00235         }
    00236
    00237         valid = CMProfileElementExists((CMProfileRef)prof, icSigProfileDescriptionTag);
    00238
    00239         if (valid)
    00240                 valid = CMProfileElementExists((CMProfileRef)prof, icSigNamedColor2Tag);
    00241
    00242         if (valid)
    00243                 valid = CMProfileElementExists((CMProfileRef)prof, icSigMediaWhitePointTag);
    00244
    00245         if (valid)
    00246                 valid = CMProfileElementExists((CMProfileRef)prof, icSigCopyrightTag);
    00247
    00248         return (valid);
    00249 }

PI_Boolean CMValOutput | ( | CMProfileRef | prof,
|  | icHeader * | aHeader
| ) |

Definition at line 124 of file lh_open/pi_valid.c.

References CMValGray(), CMValMftOutput(), icHeader::colorSpace, FALSE, icSigCmyData, icSigCmykData, icSigGrayData, icSigLabData, icSigMCH2Data, icSigMCH3Data, icSigMCH4Data, icSigMCH5Data, icSigMCH6Data, icSigMCH7Data, icSigMCH8Data, icSigMCH9Data, icSigMCHAData, icSigMCHBData, icSigMCHCData, icSigMCHDData, icSigMCHEData, icSigMCHFData, icSigRgbData, icSigXYZData, icHeader::pcs, and PI_Boolean.

    00126 {
    00127         PI_Boolean valid;
    00128         switch (aHeader->colorSpace)
    00129         {
    00130
    00131                 case icSigGrayData:
    00132                         valid = CMValGray(prof);
    00133                         break;
    00134
    00135                 case icSigRgbData:
    00136                 case icSigCmyData:
    00137                 case icSigCmykData:
    00138                 case icSigMCH2Data:
    00139                 case icSigMCH3Data:
    00140                 case icSigMCH4Data:
    00141                 case icSigMCH5Data:
    00142                 case icSigMCH6Data:
    00143                 case icSigMCH7Data:
    00144                 case icSigMCH8Data:
    00145                 case icSigMCH9Data:
    00146                 case icSigMCHAData:
    00147                 case icSigMCHBData:
    00148                 case icSigMCHCData:
    00149                 case icSigMCHDData:
    00150                 case icSigMCHEData:
    00151                 case icSigMCHFData:
    00152                         valid = CMValMftOutput(prof);
    00153                         break;
    00154
    00155                 default:
    00156                         valid = FALSE;
    00157         }
    00158
    00159         if (aHeader->pcs != icSigXYZData && aHeader->pcs != icSigLabData){
    00160                 valid = FALSE;
    00161         }
    00162         return (valid);
    00163 }

PI_Boolean CMValRGB | ( | CMProfileRef | prof | ) |

Definition at line 394 of file lh_open/pi_valid.c.

References CMProfileElementExists(), CMProfileRef, icSigBlueColorantTag, icSigBlueTRCTag, icSigCopyrightTag, icSigGreenColorantTag, icSigGreenTRCTag, icSigMediaWhitePointTag, icSigProfileDescriptionTag, icSigRedColorantTag, icSigRedTRCTag, and PI_Boolean.

    00395 {
    00396         PI_Boolean valid;
    00397         valid = CMProfileElementExists((CMProfileRef)prof, icSigProfileDescriptionTag);
    00398
    00399         if (valid)
    00400                 valid = CMProfileElementExists((CMProfileRef)prof, icSigRedColorantTag);
    00401
    00402         if (valid)
    00403                 valid = CMProfileElementExists((CMProfileRef)prof, icSigGreenColorantTag);
    00404
    00405         if (valid)
    00406                 valid = CMProfileElementExists((CMProfileRef)prof, icSigBlueColorantTag);
    00407
    00408         if (valid)
    00409                 valid = CMProfileElementExists((CMProfileRef)prof, icSigRedTRCTag);
    00410
    00411         if (valid)
    00412                 valid = CMProfileElementExists((CMProfileRef)prof, icSigGreenTRCTag);
    00413
    00414         if (valid)
    00415                 valid = CMProfileElementExists((CMProfileRef)prof, icSigBlueTRCTag);
    00416
    00417         if (valid)
    00418                 valid = CMProfileElementExists((CMProfileRef)prof, icSigMediaWhitePointTag);/* wtpt change to enum */
    00419
    00420         if (valid)
    00421                 valid = CMProfileElementExists((CMProfileRef)prof, icSigCopyrightTag);/* cprt change to enum */
    00422
    00423         return (valid);
    00424 }