( self )
| 187 | self.assertTrue( not "obj" in e ) |
| 188 | |
| 189 | def testCanWrite( self ) : |
| 190 | |
| 191 | displayWindow = imath.Box2i( |
| 192 | imath.V2i( 0, 0 ), |
| 193 | imath.V2i( 99, 99 ) |
| 194 | ) |
| 195 | |
| 196 | dataWindow = displayWindow |
| 197 | |
| 198 | image = self.__makeFloatImage( dataWindow, displayWindow, dataType = IECore.FloatVectorData ) |
| 199 | self.assertTrue( IECoreImage.ImageWriter.canWrite( image, os.path.join( "test", "IECoreImage", "data", "exr", "output.exr" ) ) ) |
| 200 | |
| 201 | # we dont support writing images of different channel types |
| 202 | image["R"] = IECore.DoubleVectorData( [ x for x in image["R"] ] ) |
| 203 | self.assertFalse( IECoreImage.ImageWriter.canWrite( image, os.path.join( "test", "IECoreImage", "data", "exr", "output.exr" ) ) ) |
| 204 | |
| 205 | # we dont support writing images if OIIO doesn't know how to use the channels |
| 206 | image["R"] = IECore.StringVectorData( [ str(x) for x in image["R"] ] ) |
| 207 | image["G"] = IECore.StringVectorData( [ str(x) for x in image["G"] ] ) |
| 208 | image["B"] = IECore.StringVectorData( [ str(x) for x in image["B"] ] ) |
| 209 | self.assertFalse( IECoreImage.ImageWriter.canWrite( image, os.path.join( "test", "IECoreImage", "data", "exr", "output.exr" ) ) ) |
| 210 | |
| 211 | # we dont support writing non-images |
| 212 | self.assertFalse( IECoreImage.ImageWriter.canWrite( IECore.CompoundObject(), os.path.join( "test", "IECoreImage", "data", "exr", "output.exr" ) ) ) |
| 213 | |
| 214 | def testWrite( self ) : |
| 215 |
nothing calls this directly
no test coverage detected