MCPcopy Create free account
hub / github.com/DentonW/DevIL / ILAPIENTRY ilApplyProfile

Function ILAPIENTRY ilApplyProfile

DevIL/src-IL/src/il_profiles.cpp:54–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52#endif//IL_NO_LCMS
53
54ILboolean ILAPIENTRY ilApplyProfile(ILstring InProfile, ILstring OutProfile)
55{
56#ifndef IL_NO_LCMS
57 cmsHPROFILE hInProfile, hOutProfile;
58 cmsHTRANSFORM hTransform;
59 ILubyte *Temp;
60 ILint Format=0;
61#ifdef _UNICODE
62 char AnsiName[512];
63#endif//_UNICODE
64
65 if (iCurImage == NULL) {
66 ilSetError(IL_ILLEGAL_OPERATION);
67 return IL_FALSE;
68 }
69
70 switch (iCurImage->Type)
71 {
72 case IL_BYTE:
73 case IL_UNSIGNED_BYTE:
74 switch (iCurImage->Format)
75 {
76 case IL_LUMINANCE:
77 Format = TYPE_GRAY_8;
78 break;
79 case IL_RGB:
80 Format = TYPE_RGB_8;
81 break;
82 case IL_BGR:
83 Format = TYPE_BGR_8;
84 break;
85 case IL_RGBA:
86 Format = TYPE_RGBA_8;
87 break;
88 case IL_BGRA:
89 Format = TYPE_BGRA_8;
90 break;
91 default:
92 ilSetError(IL_INTERNAL_ERROR);
93 return IL_FALSE;
94 }
95 break;
96
97 case IL_SHORT:
98 case IL_UNSIGNED_SHORT:
99 switch (iCurImage->Format)
100 {
101 case IL_LUMINANCE:
102 Format = TYPE_GRAY_16;
103 break;
104 case IL_RGB:
105 Format = TYPE_RGB_16;
106 break;
107 case IL_BGR:
108 Format = TYPE_BGR_16;
109 break;
110 case IL_RGBA:
111 Format = TYPE_RGBA_16;

Callers

nothing calls this directly

Calls 1

ilSetErrorFunction · 0.85

Tested by

no test coverage detected