Ejemplo n.º 1
0
	def test07_CreateTransformWithInvalidIntent(self):
		self.assertNotEqual(None, cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGB_8,
														self.outProfile, cms.TYPE_CMYK_8, 3))
		try:
			cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGB_8,
									self.outProfile, cms.TYPE_CMYK_8, 4)
		except cms.cmsError:
			return
		self.fail()
Ejemplo n.º 2
0
	def test05_CreateTransformWithCustomIntent(self):
		self.assertNotEqual(None, cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGB_8, self.outProfile,
														cms.TYPE_CMYK_8, cms.INTENT_PERCEPTUAL))
		self.assertNotEqual(None, cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGB_8, self.outProfile,
														cms.TYPE_CMYK_8, cms.INTENT_RELATIVE_COLORIMETRIC))
		self.assertNotEqual(None, cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGB_8, self.outProfile,
														cms.TYPE_CMYK_8, cms.INTENT_SATURATION))
		self.assertNotEqual(None, cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGB_8, self.outProfile,
														cms.TYPE_CMYK_8, cms.INTENT_ABSOLUTE_COLORIMETRIC))
Ejemplo n.º 3
0
	def test04_CreateTransform(self):
		self.assertNotEqual(None, cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGB_8,
														self.outProfile, cms.TYPE_CMYK_8))
		self.assertNotEqual(None, cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGBA_8,
														self.outProfile, cms.TYPE_CMYK_8))
		self.assertNotEqual(None, cms.cmsCreateTransform(self.outProfile, cms.TYPE_CMYK_8,
														self.inProfile, cms.TYPE_RGBA_8))
		self.assertNotEqual(None, cms.cmsCreateTransform(self.outProfile, cms.TYPE_CMYK_8,
														self.inProfile, cms.TYPE_RGB_8))
Ejemplo n.º 4
0
	def setUp(self):
		self.inProfile = cms.cmsOpenProfileFromFile('cms_data/sRGB.icm')
		self.outProfile = cms.cmsOpenProfileFromFile('cms_data/GenericCMYK.icm')
		self.transform = cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGBA_8,
											 self.outProfile, cms.TYPE_CMYK_8,
											 cms.INTENT_PERCEPTUAL,
											 cms.cmsFLAGS_NOTPRECALC)
		self.transform2 = cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGBA_8,
											 self.outProfile, cms.TYPE_CMYK_8,
											 cms.INTENT_PERCEPTUAL, 0)
Ejemplo n.º 5
0
	def test06_CreateTransformWithCustomFlags(self):
		self.assertNotEqual(None, cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGB_8, self.outProfile,
														cms.TYPE_CMYK_8, cms.INTENT_PERCEPTUAL,
														cms.cmsFLAGS_NOTPRECALC | cms.cmsFLAGS_GAMUTCHECK))
		self.assertNotEqual(None, cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGB_8, self.outProfile,
														cms.TYPE_CMYK_8, cms.INTENT_PERCEPTUAL,
														cms.cmsFLAGS_PRESERVEBLACK | cms.cmsFLAGS_BLACKPOINTCOMPENSATION))
		self.assertNotEqual(None, cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGB_8, self.outProfile,
														cms.TYPE_CMYK_8, cms.INTENT_PERCEPTUAL,
														cms.cmsFLAGS_NOTPRECALC | cms.cmsFLAGS_HIGHRESPRECALC))
		self.assertNotEqual(None, cms.cmsCreateTransform(self.inProfile, cms.TYPE_RGB_8, self.outProfile,
														cms.TYPE_CMYK_8, cms.INTENT_PERCEPTUAL,
														cms.cmsFLAGS_NOTPRECALC | cms.cmsFLAGS_LOWRESPRECALC))
Ejemplo n.º 6
0
	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)