コード例 #1
0
ファイル: cms_test.py プロジェクト: dlajarretie/uniconvertor
	def test21_DoTransformWithIncorrectInputBuffer(self):
		cmyk = cms.COLORB()
		rgb = 255
		try:
			cms.cmsDoTransform(self.transform, rgb, cmyk)
		except cms.cmsError:
			return
		self.fail()
コード例 #2
0
 def test17_DoTransformWithNullInput(self):
     rgb = cms.COLORB()
     cmyk = cms.COLORB()
     cms.cmsDoTransform(self.transform, rgb, cmyk)
     self.assertNotEqual(0, cmyk[0])
     self.assertNotEqual(0, cmyk[1])
     self.assertNotEqual(0, cmyk[2])
     self.assertNotEqual(0, cmyk[3])
コード例 #3
0
 def test21_DoTransformWithIncorrectInputBuffer(self):
     cmyk = cms.COLORB()
     rgb = 255
     try:
         cms.cmsDoTransform(self.transform, rgb, cmyk)
     except cms.cmsError:
         return
     self.fail()
コード例 #4
0
ファイル: cms_test.py プロジェクト: dlajarretie/uniconvertor
	def test17_DoTransformWithNullInput(self):
		rgb = cms.COLORB()
		cmyk = cms.COLORB()
		cms.cmsDoTransform(self.transform, rgb, cmyk)
		self.assertNotEqual(0, cmyk[0])
		self.assertNotEqual(0, cmyk[1])
		self.assertNotEqual(0, cmyk[2])
		self.assertNotEqual(0, cmyk[3])
コード例 #5
0
 def test20_DoTransformWithIncorrectColorValues(self):
     rgb = cms.COLORB()
     cmyk = cms.COLORB()
     rgb[0] = 455
     rgb[1] = 255
     rgb[2] = 255
     try:
         cms.cmsDoTransform(self.transform, rgb, cmyk)
     except:
         self.fail()
コード例 #6
0
ファイル: cms_test.py プロジェクト: dlajarretie/uniconvertor
	def test20_DoTransformWithIncorrectColorValues(self):
		rgb = cms.COLORB()
		cmyk = cms.COLORB()
		rgb[0] = 455
		rgb[1] = 255
		rgb[2] = 255
		try:
			cms.cmsDoTransform(self.transform, rgb, cmyk)
		except:
			self.fail()
コード例 #7
0
ファイル: cms_test.py プロジェクト: dlajarretie/uniconvertor
	def test22_DoTransformWithIncorrectOutputBuffer(self):
		rgb = cms.COLORB()
		rgb[0] = 255
		rgb[1] = 255
		rgb[2] = 255
		cmyk = 255
		try:
			cms.cmsDoTransform(self.transform, rgb, cmyk)
		except cms.cmsError:
			return
		self.fail()
コード例 #8
0
ファイル: cms_test.py プロジェクト: dlajarretie/uniconvertor
	def test19_DoTransformWithIntermediateInput(self):
		rgb = cms.COLORB()
		cmyk = cms.COLORB()
		rgb[0] = 100
		rgb[1] = 190
		rgb[2] = 150
		cms.cmsDoTransform(self.transform, rgb, cmyk)
		self.assertNotEqual(0, cmyk[0])
		self.assertNotEqual(0, cmyk[1])
		self.assertNotEqual(0, cmyk[2])
		self.assertNotEqual(0, cmyk[3])
コード例 #9
0
ファイル: cms_test.py プロジェクト: dlajarretie/uniconvertor
	def test18_DoTransformWithMaximumAllowedInput(self):
		rgb = cms.COLORB()
		cmyk = cms.COLORB()
		rgb[0] = 255
		rgb[1] = 255
		rgb[2] = 255
		cms.cmsDoTransform(self.transform, rgb, cmyk)
		self.assertEqual(0, cmyk[0])
		self.assertEqual(0, cmyk[1])
		self.assertEqual(0, cmyk[2])
		self.assertEqual(0, cmyk[3])
コード例 #10
0
 def test22_DoTransformWithIncorrectOutputBuffer(self):
     rgb = cms.COLORB()
     rgb[0] = 255
     rgb[1] = 255
     rgb[2] = 255
     cmyk = 255
     try:
         cms.cmsDoTransform(self.transform, rgb, cmyk)
     except cms.cmsError:
         return
     self.fail()
コード例 #11
0
 def test19_DoTransformWithIntermediateInput(self):
     rgb = cms.COLORB()
     cmyk = cms.COLORB()
     rgb[0] = 100
     rgb[1] = 190
     rgb[2] = 150
     cms.cmsDoTransform(self.transform, rgb, cmyk)
     self.assertNotEqual(0, cmyk[0])
     self.assertNotEqual(0, cmyk[1])
     self.assertNotEqual(0, cmyk[2])
     self.assertNotEqual(0, cmyk[3])
コード例 #12
0
 def test18_DoTransformWithMaximumAllowedInput(self):
     rgb = cms.COLORB()
     cmyk = cms.COLORB()
     rgb[0] = 255
     rgb[1] = 255
     rgb[2] = 255
     cms.cmsDoTransform(self.transform, rgb, cmyk)
     self.assertEqual(0, cmyk[0])
     self.assertEqual(0, cmyk[1])
     self.assertEqual(0, cmyk[2])
     self.assertEqual(0, cmyk[3])
コード例 #13
0
	def processRGB(self,r,g,b):
		RGB = COLORB()
		RGB[0] = int(round(r, 3)*255)
		RGB[1] = int(round(g, 3)*255)
		RGB[2] = int(round(b, 3)*255)
		
		outRGB = COLORB()
		outRGB[0] = 0
		outRGB[1] = 0
		outRGB[2] = 0		
		cmsDoTransform(self.rgb_monitor, RGB, outRGB, 1)
		
		return round(outRGB[0]/255.0, 3), round(outRGB[1]/255.0, 3), round(outRGB[2]/255.0, 3)
コード例 #14
0
	def processCMYK(self,c,m,y,k):
		CMYK = COLORB()
		CMYK[0] = int(round(c, 3)*255)
		CMYK[1] = int(round(m, 3)*255)
		CMYK[2] = int(round(y, 3)*255)
		CMYK[3] = int(round(k, 3)*255)
		
		outRGB = COLORB()
		outRGB[0] = 0
		outRGB[1] = 0
		outRGB[2] = 0	
		cmsDoTransform(self.cmyk_rgb, CMYK, outRGB, 1)
		
		return round(outRGB[0]/255.0, 3), round(outRGB[1]/255.0, 3), round(outRGB[2]/255.0, 3)
コード例 #15
0
	def convertRGB(self,r,g,b):
		RGB = COLORB()
		RGB[0] = int(round(r, 3)*255)
		RGB[1] = int(round(g, 3)*255)
		RGB[2] = int(round(b, 3)*255)
		
		CMYK = COLORB()
		CMYK[0] = 0
		CMYK[1] = 0
		CMYK[2] = 0
		CMYK[3] = 0
		cmsDoTransform(self.rgb_cmyk, RGB, CMYK, 1)
		
		return round(CMYK[0]/255.0, 3), round(CMYK[1]/255.0, 3), round(CMYK[2]/255.0, 3), round(CMYK[3]/255.0, 3)
コード例 #16
0
    def processRGB(self, r, g, b):
        RGB = COLORB()
        RGB[0] = int(round(r, 3) * 255)
        RGB[1] = int(round(g, 3) * 255)
        RGB[2] = int(round(b, 3) * 255)

        outRGB = COLORB()
        outRGB[0] = 0
        outRGB[1] = 0
        outRGB[2] = 0
        cmsDoTransform(self.rgb_monitor, RGB, outRGB, 1)

        return round(outRGB[0] / 255.0,
                     3), round(outRGB[1] / 255.0,
                               3), round(outRGB[2] / 255.0, 3)
コード例 #17
0
    def processCMYK(self, c, m, y, k):
        CMYK = COLORB()
        CMYK[0] = int(round(c, 3) * 255)
        CMYK[1] = int(round(m, 3) * 255)
        CMYK[2] = int(round(y, 3) * 255)
        CMYK[3] = int(round(k, 3) * 255)

        outRGB = COLORB()
        outRGB[0] = 0
        outRGB[1] = 0
        outRGB[2] = 0
        cmsDoTransform(self.cmyk_rgb, CMYK, outRGB, 1)

        return round(outRGB[0] / 255.0,
                     3), round(outRGB[1] / 255.0,
                               3), round(outRGB[2] / 255.0, 3)
コード例 #18
0
    def convertRGB(self, r, g, b):
        RGB = COLORB()
        RGB[0] = int(round(r, 3) * 255)
        RGB[1] = int(round(g, 3) * 255)
        RGB[2] = int(round(b, 3) * 255)

        CMYK = COLORB()
        CMYK[0] = 0
        CMYK[1] = 0
        CMYK[2] = 0
        CMYK[3] = 0
        cmsDoTransform(self.rgb_cmyk, RGB, CMYK, 1)

        return round(CMYK[0] / 255.0,
                     3), round(CMYK[1] / 255.0,
                               3), round(CMYK[2] / 255.0,
                                         3), round(CMYK[3] / 255.0, 3)