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 dec97/test/control.c.

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

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

Definition at line 91 of file dec97/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.

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 dec97/test/control.c.

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

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 dec97/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.

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