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

control.c File Reference

#include "generic.h"

Go to the source code of this file.

Functions

void CreateINTENTControl (LPSTR FileName, LPSTR SaveFileName, DWORD Inter_Intent)
void CreateCRDControl (LPSTR FileName, LPSTR SaveFileName, DWORD Inter_Intent, BOOL AllowBinary)
void CreateProfCRDControl (LPSTR DevProfile, LPSTR TargetProfile, LPSTR SaveFileName, DWORD Inter_Intent, BOOL AllowBinary)
void ColorSpaceControl (LPSTR FileName, LPSTR SaveFileName, DWORD InpDrvClrSp, DWORD Intent, WORD CSAType, BOOL AllowBinary)


Function Documentation

void ColorSpaceControl LPSTR  FileName,
LPSTR  SaveFileName,
DWORD  InpDrvClrSp,
DWORD  Intent,
WORD  CSAType,
BOOL  AllowBinary
 

Definition at line 232 of file jul98/test/control.c.

References AllowBinary, BOOL, CHANDLE, CSIG, DWORD, FileName, FreeCP(), GetCPDevSpace, GetFocus(), GetPS2ColorSpaceArray(), GetPS2CSA_ABC(), GetPS2CSA_DEFG_Intent(), icSigCmykData, icSigGrayData, icSigRgbData, Intent, LoadCP32(), LPCHANDLE, LPCSIG, MemAlloc(), MemFree(), MEMPTR, NULL, TYPE_CIEBASEDDEF, and TYPE_CIEBASEDDEFG.

00239 { 00240 BOOL Ret; 00241 CHANDLE cp; 00242 HGLOBAL hCP; 00243 HGLOBAL hBuffer; 00244 MEMPTR lpBuffer; 00245 OFSTRUCT OfStruct; 00246 HFILE hOutput; 00247 DWORD cbSize; 00248 CSIG ColorSpace; 00249 00250 if( !LoadCP32( (LPCSTR) FileName, &hCP, (LPCHANDLE) &cp) ) 00251 { 00252 return; 00253 } 00254 switch (InpDrvClrSp) 00255 { 00256 case 0: break; 00257 case 1: InpDrvClrSp = icSigGrayData; break; 00258 case 3: InpDrvClrSp = icSigRgbData; break; 00259 case 4: InpDrvClrSp = icSigCmykData; break; 00260 default: InpDrvClrSp = 0; break; 00261 } 00262 00263 // Create CieBasedDEF(G) first. if can not, create CieBasedABC. 00264 if (CSAType == 405) 00265 { 00266 Ret = GetPS2ColorSpaceArray(cp, Intent, InpDrvClrSp, NULL, &cbSize, AllowBinary); 00267 if (Ret) 00268 { 00269 if (!MemAlloc(cbSize, &hBuffer, &lpBuffer)) 00270 return; 00271 Ret = GetPS2ColorSpaceArray(cp, Intent, InpDrvClrSp, lpBuffer, &cbSize, AllowBinary); 00272 00273 hOutput = OpenFile(SaveFileName, &OfStruct, OF_CREATE); 00274 cbSize = _lwrite(hOutput, lpBuffer, cbSize); 00275 _lclose(hOutput); 00276 00277 MemFree(hBuffer); 00278 } 00279 } 00280 // Create CieBasedABC 00281 else if (CSAType == 406) 00282 { 00283 Ret = GetPS2ColorSpaceArray(cp, Intent, icSigRgbData, NULL, &cbSize, AllowBinary); 00284 if (Ret) 00285 { 00286 if (!MemAlloc(cbSize, &hBuffer, &lpBuffer)) 00287 return; 00288 Ret = GetPS2ColorSpaceArray(cp, Intent, icSigRgbData, lpBuffer, &cbSize, AllowBinary); 00289 00290 hOutput = OpenFile(SaveFileName, &OfStruct, OF_CREATE); 00291 cbSize = _lwrite(hOutput, lpBuffer, cbSize); 00292 _lclose(hOutput); 00293 00294 MemFree(hBuffer); 00295 } 00296 } 00297 #if 0 00298 else if (CSAType == 406) 00299 { 00300 Ret = GetPS2CSA_ABC( cp, NULL, &cbSize, InpDrvClrSp, AllowBinary); 00301 if (Ret) 00302 { 00303 if (!MemAlloc(cbSize, &hBuffer, &lpBuffer)) 00304 return; 00305 Ret = GetPS2CSA_ABC( cp, lpBuffer, &cbSize, InpDrvClrSp, AllowBinary); 00306 00307 hOutput = OpenFile(SaveFileName, &OfStruct, OF_CREATE); 00308 cbSize = _lwrite(hOutput, lpBuffer, cbSize); 00309 _lclose(hOutput); 00310 00311 MemFree(hBuffer); 00312 } 00313 00314 } 00315 else if ((CSAType == 407) && 00316 (GetCPDevSpace(cp, (LPCSIG) &ColorSpace))) 00317 { 00318 if (ColorSpace == icSigRgbData) 00319 Ret = GetPS2CSA_DEFG_Intent(cp, NULL, &cbSize, 00320 InpDrvClrSp, Intent, TYPE_CIEBASEDDEF, AllowBinary); 00321 else if (ColorSpace == icSigCmykData) 00322 Ret = GetPS2CSA_DEFG_Intent(cp, NULL, &cbSize, 00323 InpDrvClrSp, Intent, TYPE_CIEBASEDDEFG, AllowBinary); 00324 if (Ret) 00325 { 00326 if (!MemAlloc(cbSize, &hBuffer, &lpBuffer)) 00327 return; 00328 if (ColorSpace == icSigRgbData) 00329 Ret = GetPS2CSA_DEFG_Intent(cp, lpBuffer, &cbSize, 00330 InpDrvClrSp, Intent, TYPE_CIEBASEDDEF, AllowBinary); 00331 else if (ColorSpace == icSigCmykData) 00332 Ret = GetPS2CSA_DEFG_Intent(cp, lpBuffer, &cbSize, 00333 InpDrvClrSp, Intent, TYPE_CIEBASEDDEFG, AllowBinary); 00334 hOutput = OpenFile(SaveFileName, &OfStruct, OF_CREATE); 00335 cbSize = _lwrite(hOutput, lpBuffer, cbSize); 00336 _lclose(hOutput); 00337 00338 MemFree(hBuffer); 00339 } 00340 00341 } 00342 #endif 00343 FreeCP(hCP); 00344 if (!Ret) 00345 MessageBox( GetFocus(), "No CRD created.", NULL, MB_OK ); 00346 return; 00347 }

void CreateCRDControl LPSTR  FileName,
LPSTR  SaveFileName,
DWORD  Inter_Intent,
BOOL  AllowBinary
 

Definition at line 91 of file jul98/test/control.c.

References AllowBinary, BOOL, CHANDLE, CSIG, DWORD, FileName, FreeCP(), GetFocus(), GetPS2ColorRenderingDictionary(), icAbsoluteColorimetric, icPerceptual, icRelativeColorimetric, icSaturation, Intent, LoadCP32(), LPCHANDLE, MemAlloc(), MemFree(), MEMPTR, and NULL.

Referenced by OpenFiles().

00096 { 00097 BOOL Ret; 00098 CHANDLE cp; 00099 HGLOBAL hCP; 00100 HGLOBAL hBuffer; 00101 MEMPTR lpBuffer; 00102 OFSTRUCT OfStruct; 00103 HFILE hOutput; 00104 DWORD cbSize; 00105 CSIG Intent; 00106 00107 if( !LoadCP32( (LPCSTR) FileName, &hCP, (LPCHANDLE) &cp) ) 00108 { 00109 return; 00110 } 00111 00112 switch (Inter_Intent) 00113 { 00114 case 0: Intent = icPerceptual; break; 00115 case 1: Intent = icRelativeColorimetric; break; 00116 case 2: Intent = icSaturation; break; 00117 case 3: Intent = icAbsoluteColorimetric; break; 00118 default: return; 00119 } 00120 00121 Ret = GetPS2ColorRenderingDictionary(cp, Intent, NULL, &cbSize, AllowBinary); 00122 if (Ret) 00123 { 00124 if (!MemAlloc(cbSize, &hBuffer, &lpBuffer)) 00125 return; 00126 Ret = GetPS2ColorRenderingDictionary(cp, Intent, lpBuffer, &cbSize, AllowBinary); 00127 hOutput = OpenFile(SaveFileName, &OfStruct, OF_CREATE); 00128 cbSize = _lwrite(hOutput, lpBuffer, cbSize); 00129 _lclose(hOutput); 00130 MemFree(hBuffer); 00131 } 00132 FreeCP(hCP); 00133 00134 if (!Ret) 00135 MessageBox( GetFocus(), "No CRD created.", NULL, MB_OK ); 00136 }

void CreateINTENTControl LPSTR  FileName,
LPSTR  SaveFileName,
DWORD  Inter_Intent
 

Definition at line 25 of file jul98/test/control.c.

References BOOL, CHANDLE, CSIG, DWORD, FileName, FreeCP(), GetFocus(), GetPS2ColorRenderingIntent(), icAbsoluteColorimetric, icPerceptual, icRelativeColorimetric, icSaturation, Intent, LoadCP32(), LPCHANDLE, MemAlloc(), MemFree(), MEMPTR, and NULL.

Referenced by OpenFiles().

00029 { 00030 BOOL Ret; 00031 CHANDLE cp; 00032 HGLOBAL hCP; 00033 HGLOBAL hBuffer; 00034 MEMPTR lpBuffer; 00035 OFSTRUCT OfStruct; 00036 HFILE hOutput; 00037 DWORD cbSize; 00038 CSIG Intent; 00039 00040 if( !LoadCP32( (LPCSTR) FileName, &hCP, (LPCHANDLE) &cp) ) 00041 { 00042 return; 00043 } 00044 00045 switch (Inter_Intent) 00046 { 00047 case 0: Intent = icPerceptual; break; 00048 case 1: Intent = icRelativeColorimetric; break; 00049 case 2: Intent = icSaturation; break; 00050 case 3: Intent = icAbsoluteColorimetric; break; 00051 default: return; 00052 } 00053 00054 Ret = GetPS2ColorRenderingIntent(cp, Intent, NULL, &cbSize); 00055 if (Ret) 00056 { 00057 if (!MemAlloc(cbSize, &hBuffer, &lpBuffer)) 00058 return; 00059 Ret = GetPS2ColorRenderingIntent(cp, Intent, lpBuffer, &cbSize); 00060 hOutput = OpenFile(SaveFileName, &OfStruct, OF_CREATE); 00061 cbSize = _lwrite(hOutput, lpBuffer, cbSize); 00062 _lclose(hOutput); 00063 MemFree(hBuffer); 00064 } 00065 FreeCP(hCP); 00066 00067 if (!Ret) 00068 MessageBox( GetFocus(), "No PS2 Intent created.", NULL, MB_OK ); 00069 }

void CreateProfCRDControl LPSTR  DevProfile,
LPSTR  TargetProfile,
LPSTR  SaveFileName,
DWORD  Inter_Intent,
BOOL  AllowBinary
 

Definition at line 158 of file jul98/test/control.c.

References AllowBinary, BOOL, CHANDLE, CSIG, DWORD, FreeCP(), GetFocus(), GetPS2PreviewColorRenderingDictionary(), icAbsoluteColorimetric, icPerceptual, icRelativeColorimetric, icSaturation, Intent, LoadCP32(), LPCHANDLE, MemAlloc(), MemFree(), MEMPTR, NULL, and TargetProfile.

Referenced by OpenFiles().

00164 { 00165 BOOL Ret; 00166 CHANDLE cpDev, cpTar; 00167 HGLOBAL hDevCP = 0, hTarCP = 0; 00168 HGLOBAL hBuffer; 00169 MEMPTR lpBuffer; 00170 OFSTRUCT OfStruct; 00171 HFILE hOutput; 00172 DWORD cbSize; 00173 CSIG Intent; 00174 00175 LoadCP32( (LPCSTR) DevProfile, &hDevCP, (LPCHANDLE) &cpDev); 00176 LoadCP32( (LPCSTR) TargetProfile, &hTarCP, (LPCHANDLE) &cpTar); 00177 00178 if (!hDevCP || !hTarCP) 00179 { 00180 if (hDevCP) FreeCP(hDevCP); 00181 if (hTarCP) FreeCP(hTarCP); 00182 return; 00183 } 00184 00185 switch (Inter_Intent) 00186 { 00187 case 0: Intent = icPerceptual; break; 00188 case 1: Intent = icRelativeColorimetric; break; 00189 case 2: Intent = icSaturation; break; 00190 case 3: Intent = icAbsoluteColorimetric; break; 00191 default: return; 00192 } 00193 00194 Ret = GetPS2PreviewColorRenderingDictionary(cpDev, cpTar, Intent, NULL, &cbSize, AllowBinary); 00195 if (Ret) 00196 { 00197 if (!MemAlloc(cbSize, &hBuffer, &lpBuffer)) 00198 return; 00199 Ret = GetPS2PreviewColorRenderingDictionary(cpDev, cpTar, Intent, lpBuffer, &cbSize, AllowBinary); 00200 hOutput = OpenFile(SaveFileName, &OfStruct, OF_CREATE); 00201 cbSize = _lwrite(hOutput, lpBuffer, cbSize); 00202 _lclose(hOutput); 00203 MemFree(hBuffer); 00204 } 00205 FreeCP(hDevCP); 00206 FreeCP(hTarCP); 00207 00208 if (!Ret) 00209 MessageBox( GetFocus(), "No CRD created.", NULL, MB_OK ); 00210 }


Generated on Sat May 15 19:43:17 2004 for test by doxygen 1.3.7