Test IECoreImage.ImagePrimitive load/save
( self )
| 83 | # \todo Verify behaviour when dataWindow and displayWindow are contradictory or inconsistent |
| 84 | |
| 85 | def testLoadSave( self ) : |
| 86 | """ Test IECoreImage.ImagePrimitive load/save """ |
| 87 | |
| 88 | windowMin = imath.V2i( 0, 0 ) |
| 89 | windowMax = imath.V2i( 100, 100 ) |
| 90 | w = imath.Box2i( windowMin, windowMax ) |
| 91 | i = IECoreImage.ImagePrimitive( w, w ) |
| 92 | i["R"] = IECore.FloatVectorData( 101 * 101 ) |
| 93 | i["G"] = IECore.FloatVectorData( 101 * 101 ) |
| 94 | i["B"] = IECore.FloatVectorData( 101 * 101 ) |
| 95 | self.assertTrue( i.channelsValid() ) |
| 96 | |
| 97 | IECore.Writer.create( i, os.path.join( "test", "IECore", "data", "output.cob" ) ).write() |
| 98 | |
| 99 | i2 = IECore.Reader.create( os.path.join( "test", "IECore", "data", "output.cob" ) ).read() |
| 100 | self.assertEqual( type( i2 ), IECoreImage.ImagePrimitive ) |
| 101 | |
| 102 | self.assertEqual( i.displayWindow, i2.displayWindow ) |
| 103 | self.assertEqual( i.dataWindow, i2.dataWindow ) |
| 104 | self.assertEqual( i.channelNames(), i2.channelNames() ) |
| 105 | self.assertTrue( i2.channelsValid() ) |
| 106 | |
| 107 | def testChannelNames( self ) : |
| 108 |
nothing calls this directly
no test coverage detected