Hi guys,
I wanted to use the smart function, "cmsDoTransform", in c# so I made my
own wrapper and tried it. But while the program is running, *the first call
works fine* but *the second call throws "System.AccessViolationException".*
Please take a look at my code in C++ wrapper and let me know what I am
missing.
Thanks in advance!
code in c++:
extern "C" __declspec(dllexport) void ToneMapping(int* intPtr, int size,
char* icc1, int len_icc1, char* icc2, int len_icc2)
{
char* icc_1 = (char*)malloc(sizeof(char)*len_icc1 +1);
char* icc_2 = (char*)malloc(sizeof(char)*len_icc2 +1);
memcpy(icc_1, icc1, len_icc1);
memcpy(icc_2, icc2, len_icc2);
cmsHPROFILE hInProfile, hOutProfile;
cmsHTRANSFORM hTransform;
hInProfile = cmsOpenProfileFromFile(icc_2, "r");
hOutProfile = cmsOpenProfileFromFile(icc_1, "r");
hTransform = cmsCreateTransform(hInProfile,
TYPE_BGR_8,
hOutProfile,
TYPE_BGR_8,
INTENT_PERCEPTUAL, 0);
cmsDoTransform(hTransform, intPtr,
intPtr,
size);
free(icc_1);
free(icc_2);
}
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user