From: Noel C. <NCa...@Pr...> - 2018-03-27 13:54:35
|
Hi Jordi, I only use Little CMS with C++ myself, and this sounds like the kind of problem that requires more language-specific knowledge of Python than I have. Acknowledging that I know nothing about Python, at first glance your array data [255,255,255] does not sound like it matches your chosen data type of lcms.TYPE_RGB_DBL. Are you trying to process byte-wide data? If so, DBL implies 64 bit double precision floating point, and that doesn't seem the right choice for the format. Hope this helps point you in the right direction. -Noel From: Gonzalez Cano, Jordi [mailto:jor...@hp...] Sent: Tue, March 27, 2018 5:12 AM To: lcm...@li... Subject: [Lcms-user] LCMS python I would like to use the LCMS with python, but when I want to call the function cmsDoTransform the following error appears: TypeError: in method 'cmsDoTransform', argument 2 of type 'void const *' What I am sending to the cmsDoTransform si the following: array = [255,255,255] labColor = lcmsF.transformToLab(array,profileInURL,"RGB","perceptual") --------------- def transformToLab(inputColor, profileInURL, formatIn, intent, BPC = True): LabColor = [] labProfile = lcms.cmsCreateLab4Profile(lcms.cmsCIExyY()) inputProfile = lcms.cmsOpenProfileFromFile(profileInURL, "r") if(formatIn == "RGB"): inType = lcms.TYPE_RGB_DBL elif(formatIn == "CMYK"): inType = lcms.TYPE_CMYK_DBL if(intent == "perceptual"): m_intent = lcms.INTENT_PERCEPTUAL if(BPC): m_BPC = lcms.cmsFLAGS_BLACKPOINTCOMPENSATION else: m_BPC = 0 transform = lcms.cmsCreateTransform(inputProfile, inType, labProfile, lcms.TYPE_Lab_DBL, m_intent, m_BPC) lcms.cmsDoTransform(transform,inputColor, LabColor, DIM_OUT) return LabColor How I am supposed to do it? Thanks, Jordi G.C. |