MCPcopy Create free account
hub / github.com/ImageEngine/cortex / testSeparateRGB

Method testSeparateRGB

test/IECoreImage/LuminanceOpTest.py:53–71  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

51 self.assertEqual( o["removeColorChannels"].getTypedValue(), True )
52
53 def testSeparateRGB( self ) :
54
55 w = imath.Box2i( imath.V2i( 0 ), imath.V2i( 2, 0 ) )
56 i = IECoreImage.ImagePrimitive( w, w )
57 i["R"] = IECore.FloatVectorData( [ 1, 2, 3 ] )
58 i["G"] = IECore.FloatVectorData( [ 4, 5, 6 ] )
59 i["B"] = IECore.FloatVectorData( [ 7, 8, 9 ] )
60
61 ii = IECoreImage.LuminanceOp()( input=i, weights=imath.Color3f( 1, 2, 3 ) )
62
63 self.assertTrue( not "R" in ii )
64 self.assertTrue( not "G" in ii )
65 self.assertTrue( not "B" in ii )
66
67 self.assertTrue( "Y" in ii )
68
69 self.assertAlmostEqual( ii["Y"][0], 30 )
70 self.assertAlmostEqual( ii["Y"][1], 36 )
71 self.assertAlmostEqual( ii["Y"][2], 42 )
72
73 def testCs( self ) :
74

Callers

nothing calls this directly

Calls 2

ImagePrimitiveMethod · 0.80
LuminanceOpMethod · 0.80

Tested by

no test coverage detected