grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / libs / lcms2 / testbed / testthread.cpp
blob435445c7ed9ce3c045ddfbfc076a59b7b3a2167b
2 #include <windows.h>
3 #include "lcms.h"
5 static cmsHPROFILE prof_xyz,prof_rgb;
6 static cmsHTRANSFORM trans_xyz_to_rgb,trans_rgb_to_xyz;
8 static DWORD WINAPI make_trans_xyz_to_rgb(LPVOID lpParameter)
10 trans_xyz_to_rgb = cmsCreateTransform(
11 prof_xyz,TYPE_XYZ_DBL,
12 prof_rgb,TYPE_RGB_DBL,
13 INTENT_ABSOLUTE_COLORIMETRIC,cmsFLAGS_NOTPRECALC);
14 return 0;
17 static DWORD WINAPI make_trans_rgb_to_xyz(LPVOID lpParameter)
19 trans_rgb_to_xyz = cmsCreateTransform(
20 prof_rgb,TYPE_RGB_DBL,
21 prof_xyz,TYPE_XYZ_DBL,
22 INTENT_ABSOLUTE_COLORIMETRIC,cmsFLAGS_NOTPRECALC);
23 return 0;
26 int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR
27 lpCmdLine,int nCmdShow)
29 prof_xyz = cmsCreateXYZProfile();
30 prof_rgb = cmsOpenProfileFromFile("AdobeRGB1998.icc","rb");
31 //cmsCreate_sRGBProfile();
32 for (int i=0;i<10;++i)
34 #define try_threads
35 #ifdef try_threads
36 DWORD threadid;
37 HANDLE workers[2];
38 workers[0] = CreateThread(NULL,0,make_trans_xyz_to_rgb,NULL,0,&threadid);
39 workers[1] = CreateThread(NULL,0,make_trans_rgb_to_xyz,NULL,0,&threadid);
40 WaitForMultipleObjects(2,workers,TRUE,INFINITE);
41 for (unsigned i=0;i<2;++i)
42 CloseHandle(workers[i]);
43 #else
44 make_trans_xyz_to_rgb(0);
45 make_trans_rgb_to_xyz(0);
46 #endif
47 cmsDeleteTransform(trans_xyz_to_rgb);
48 cmsDeleteTransform(trans_rgb_to_xyz);
50 cmsCloseProfile(prof_rgb);
51 cmsCloseProfile(prof_xyz);