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

Method testGreyscaleJPG

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

Source from the content-addressed store, hash-verified

493 self.tearDown()
494
495 def testGreyscaleJPG( self ) :
496
497 displayWindow = imath.Box2i(
498 imath.V2i( 0, 0 ),
499 imath.V2i( 199, 99 )
500 )
501
502 dataWindow = displayWindow
503
504 imgOrig = self.__makeGreyscaleImage( dataWindow, displayWindow )
505
506 w = IECore.Writer.create( imgOrig, os.path.join( "test", "IECoreImage", "data", "jpg", "output.jpg" ) )
507 self.assertIsInstance( w, IECoreImage.ImageWriter )
508
509 w.write()
510
511 self.assertTrue( os.path.exists( os.path.join( "test", "IECoreImage", "data", "jpg", "output.jpg" ) ) )
512
513 r = IECore.Reader.create( os.path.join( "test", "IECoreImage", "data", "jpg", "output.jpg" ) )
514 imgNew = r.read()
515
516 channelNames = r.channelNames()
517 self.assertEqual( len(channelNames), 1 )
518
519 self.__verifyImageRGB( imgNew, imgOrig )
520
521 @unittest.skipIf( not os.path.exists( os.environ.get( "OCIO", "" ) ), "Insufficient color specification. Linear -> Cineon conversion is not possible with an OCIO config" )
522 def testDPX( self ) :

Callers

nothing calls this directly

Calls 8

__makeGreyscaleImageMethod · 0.95
__verifyImageRGBMethod · 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