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

Method testGreyscaleTIF

test/IECoreImage/ImageWriterTest.py:666–688  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

664 self.assertTrue( "A" in imgNew )
665
666 def testGreyscaleTIF( self ) :
667
668 displayWindow = imath.Box2i(
669 imath.V2i( 0, 0 ),
670 imath.V2i( 199, 99 )
671 )
672
673 dataWindow = displayWindow
674
675 imgOrig = self.__makeGreyscaleImage( dataWindow, displayWindow )
676
677 w = IECore.Writer.create( imgOrig, os.path.join( "test", "IECoreImage", "data", "tiff", "output.tif" ) )
678 self.assertIsInstance( w, IECoreImage.ImageWriter )
679
680 w.write()
681
682 self.assertTrue( os.path.exists( os.path.join( "test", "IECoreImage", "data", "tiff", "output.tif" ) ) )
683
684 r = IECore.Reader.create( os.path.join( "test", "IECoreImage", "data", "tiff", "output.tif" ) )
685 imgNew = r.read()
686
687 channelNames = r.channelNames()
688 self.assertEqual( len(channelNames), 1 )
689
690 def testRoundTripTIF( self ) :
691

Callers

nothing calls this directly

Calls 7

__makeGreyscaleImageMethod · 0.95
joinMethod · 0.80
lenFunction · 0.50
createMethod · 0.45
writeMethod · 0.45
readMethod · 0.45
channelNamesMethod · 0.45

Tested by

no test coverage detected