test: ntgdi/icm/mscmm.w98/mscmm/access.c File Reference

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

# access.c File Reference

`#include "Windef.h"`
`#include "WinGdi.h"`
`#include <wtypes.h>`
`#include "ICM.h"`
`#include "General.h"`

Go to the source code of this file.

## Functions

CMError | CMGetProfileHeader (CMProfileRef prof, CMCoreProfileHeader *header)
CMError | CMGetProfileElement (CMProfileRef prof, OSType tag, unsigned long *elementSize, void *elementData)
CMError | CMGetPartialProfileElement (CMProfileRef prof, OSType tag, unsigned long offset, unsigned long *byteCount, void *elementData)
Boolean | CMProfileElementExists (CMProfileRef prof, OSType tag)

## Function Documentation

CMError CMGetPartialProfileElement | ( | CMProfileRef | prof,
|  | OSType | tag,
|  | unsigned long | offset,
|  | unsigned long * | byteCount,
|  | void * | elementData
| ) |

Definition at line 85 of file ntgdi/icm/mscmm.w98/mscmm/access.c.

References BOOL, cmElementTagNotFound, CMError, GetColorProfileElement(), and noErr.

Referenced by CMConvIndexToNameProfile(), CMConvNameToIndexProfile(), CMGetNamedProfileInfoProfile(), CMGetProfileElement(), Extract_MFT_Alut(), Extract_MFT_Elut(), Extract_MFT_Xlut(), and GetMatrixFromProfile().

    00090 {
    00091         BOOL bool;
    00092         BOOL ret;
    00093
    00094         if (!byteCount)
    00095         {
    00096                 return -1;
    00097         }
    00098         SetLastError(0);
    00099         /*ret = IsColorProfileTagPresent( (HPROFILE)prof, (TAGTYPE)tag, &bool );*/
    00100         if( elementData == 0 ) *byteCount = 0;
    00101         ret = GetColorProfileElement( (HPROFILE)prof, (TAGTYPE)tag, offset, byteCount, elementData, &bool );
    00102         if( ret )               return (noErr);
    00103         /*                                      GetColorProfileElement returns FALSE for calls with elementData = 0
    00104                                                 but byteCount is set correctly */
    00105         else if( elementData == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER )      return (noErr);
    00106
    00107         return (cmElementTagNotFound);
    00108 }

CMError CMGetProfileElement | ( | CMProfileRef | prof,
|  | OSType | tag,
|  | unsigned long * | elementSize,
|  | void * | elementData
| ) |

Definition at line 59 of file ntgdi/icm/mscmm.w98/mscmm/access.c.

References CMError, and CMGetPartialProfileElement().

Referenced by Create_LH_ProfileSet(), DoAbsoluteShiftForPCS_Cube16(), DoMakeGamutForMonitor(), Extract_Gray_Luts(), Extract_TRC_Alut(), Extract_TRC_Elut(), Extract_TRC_Matrix(), ExtractAll_MFT_Luts(), InitNamedColorProfileData(), MakeSessionFromLink(), and MyAdd_NL_SequenceDescTag().

    00063 {
    00064         return (CMGetPartialProfileElement(prof, tag, 0, elementSize, elementData));
    00065 }

CMError CMGetProfileHeader | ( | CMProfileRef | prof,
|  | CMCoreProfileHeader * | header
| ) |

Definition at line 30 of file ntgdi/icm/mscmm.w98/mscmm/access.c.

References badProfileError, BOOL, CMCoreProfileHeader, CMError, CMProfileRef, GetColorProfileHeader(), icMagicNumber, and noErr.

Referenced by CMMConcatInitPrivate(), CMMInitPrivate(), CMValidateProfile(), Create_LH_ProfileSet(), CreateCombi(), MakeSessionFromLink(), MyAdd_NL_SequenceDescTag(), MyGetColorSpaces(), and PrepareCombiLUTs().

    00032 {
    00033         BOOL bool;
    00034         CMError ret = badProfileError;
    00035
    00036         bool = GetColorProfileHeader( (HPROFILE)prof, (PPROFILEHEADER) header );
    00037         if (header->magic == icMagicNumber && bool )
    00038                 ret = noErr;
    00039
    00040         return (ret);
    00041 }

Boolean CMProfileElementExists | ( | CMProfileRef | prof,
|  | OSType | tag
| ) |

Definition at line 123 of file ntgdi/icm/mscmm.w98/mscmm/access.c.

References BOOL, Boolean, and IsColorProfileTagPresent().

Referenced by CMValAToB(), CMValBToA(), CMValColorSpace(), CMValGray(), CMValLink(), CMValMftOutput(), CMValNamed(), and CMValRGB().

    00125 {
    00126         BOOL bool;
    00127         IsColorProfileTagPresent( (HPROFILE)prof, (TAGTYPE)tag, &bool );
    00128         return (BOOLEAN)bool;
    00129 }