Beispiel #1
0
 def test01_OpenProfile(self):
     self.assertNotEqual(None, self.inProfile)
     self.assertNotEqual(None, self.outProfile)
     self.assertNotEqual(None, cms.cmsCreateRGBProfile())
     self.assertNotEqual(None, cms.cmsCreateCMYKProfile())
     self.assertNotEqual(None, cms.cmsCreateLabProfile())
     self.assertNotEqual(None, cms.cmsCreateGrayProfile())
Beispiel #2
0
	def test01_OpenProfile(self):
		self.assertNotEqual(None, self.inProfile)
		self.assertNotEqual(None, self.outProfile)
		self.assertNotEqual(None, cms.cmsCreateRGBProfile())
		self.assertNotEqual(None, cms.cmsCreateCMYKProfile())
		self.assertNotEqual(None, cms.cmsCreateLabProfile())
		self.assertNotEqual(None, cms.cmsCreateGrayProfile())
	def refresh_profiles(self):
		if app.config.preferences.user_rgb_profile and os.path.isfile(app.config.preferences.user_rgb_profile):
			rgb_file=app.config.user_rgb_profile
			self.hRGB   = cmsOpenProfileFromFile(rgb_file, "r")
		else:
			self.hRGB   = cmsCreateRGBProfile()
			
		if app.config.preferences.user_cmyk_profile and os.path.isfile(app.config.preferences.user_cmyk_profile):
			cmyk_file=app.config.preferences.user_cmyk_profile
			self.hCMYK  = cmsOpenProfileFromFile(cmyk_file, "r")
		else:
			self.hCMYK  = cmsCreateCMYKProfile()
			
		if app.config.preferences.user_monitor_profile and os.path.isfile(app.config.preferences.user_monitor_profile):
			monitor_file=app.config.preferences.user_monitor_profile
			self.hMONITOR  = cmsOpenProfileFromFile(cmyk_file, "r")
		else:
			self.hMONITOR  = cmsCreateRGBProfile()
	
		self.cmyk_rgb = cmsCreateTransform(self.hCMYK, 
								   TYPE_CMYK_8, 
								   self.hRGB, 
								   TYPE_RGB_8, 
								   INTENT_RELATIVE_COLORIMETRIC,
								   #INTENT_PERCEPTUAL, 
								   cmsFLAGS_NOTPRECALC)		
		
		self.rgb_cmyk = cmsCreateTransform(self.hRGB, 
								   TYPE_RGB_8,
								   self.hCMYK, 
								   TYPE_CMYK_8,  
								   INTENT_PERCEPTUAL, 
								   cmsFLAGS_NOTPRECALC)			
		
		self.rgb_monitor = cmsCreateTransform(self.hRGB, 
								   TYPE_RGB_8,
								   self.hRGB, 
								   TYPE_RGB_8,  
								   INTENT_PERCEPTUAL, 0)			
		
		self.cmyk_monitor = cmsCreateTransform(self.hCMYK, 
								   TYPE_CMYK_8,
								   self.hRGB, 
								   TYPE_RGB_8,  
								   INTENT_PERCEPTUAL, 
								   cmsFLAGS_NOTPRECALC)
    def refresh_profiles(self):
        if app.config.preferences.user_rgb_profile and os.path.isfile(
                app.config.preferences.user_rgb_profile):
            rgb_file = app.config.user_rgb_profile
            self.hRGB = cmsOpenProfileFromFile(rgb_file, "r")
        else:
            self.hRGB = cmsCreateRGBProfile()

        if app.config.preferences.user_cmyk_profile and os.path.isfile(
                app.config.preferences.user_cmyk_profile):
            cmyk_file = app.config.preferences.user_cmyk_profile
            self.hCMYK = cmsOpenProfileFromFile(cmyk_file, "r")
        else:
            self.hCMYK = cmsCreateCMYKProfile()

        if app.config.preferences.user_monitor_profile and os.path.isfile(
                app.config.preferences.user_monitor_profile):
            monitor_file = app.config.preferences.user_monitor_profile
            self.hMONITOR = cmsOpenProfileFromFile(cmyk_file, "r")
        else:
            self.hMONITOR = cmsCreateRGBProfile()

        self.cmyk_rgb = cmsCreateTransform(
            self.hCMYK,
            TYPE_CMYK_8,
            self.hRGB,
            TYPE_RGB_8,
            INTENT_RELATIVE_COLORIMETRIC,
            #INTENT_PERCEPTUAL,
            cmsFLAGS_NOTPRECALC)

        self.rgb_cmyk = cmsCreateTransform(self.hRGB, TYPE_RGB_8, self.hCMYK,
                                           TYPE_CMYK_8, INTENT_PERCEPTUAL,
                                           cmsFLAGS_NOTPRECALC)

        self.rgb_monitor = cmsCreateTransform(self.hRGB, TYPE_RGB_8, self.hRGB,
                                              TYPE_RGB_8, INTENT_PERCEPTUAL, 0)

        self.cmyk_monitor = cmsCreateTransform(self.hCMYK, TYPE_CMYK_8,
                                               self.hRGB, TYPE_RGB_8,
                                               INTENT_PERCEPTUAL,
                                               cmsFLAGS_NOTPRECALC)